Search in sources :

Example 1 with OuterClassTag

use of soot.tagkit.OuterClassTag in project soot by Sable.

the class AbstractASMBackend method generateOuterClassReference.

/**
 * Emits the bytecode for a reference to an outer class if necessary
 */
protected void generateOuterClassReference() {
    SootClass outerClass = sc.getOuterClass();
    String outerClassName = slashify(outerClass.getName());
    String enclosingMethod = null;
    String enclosingMethodSig = null;
    if (sc.hasTag("EnclosingMethodTag")) {
        EnclosingMethodTag emTag = (EnclosingMethodTag) sc.getTag("EnclosingMethodTag");
        if (!sc.hasOuterClass()) {
            outerClassName = slashify(emTag.getEnclosingClass());
        }
        enclosingMethod = emTag.getEnclosingMethod();
        enclosingMethodSig = emTag.getEnclosingMethodSig();
    }
    if (!sc.hasOuterClass() && sc.hasTag("OuterClassTag")) {
        outerClassName = slashify(((OuterClassTag) sc.getTag("OuterClassTag")).getName());
    }
    cv.visitOuterClass(outerClassName, enclosingMethod, enclosingMethodSig);
}
Also used : EnclosingMethodTag(soot.tagkit.EnclosingMethodTag) OuterClassTag(soot.tagkit.OuterClassTag)

Aggregations

EnclosingMethodTag (soot.tagkit.EnclosingMethodTag)1 OuterClassTag (soot.tagkit.OuterClassTag)1