add default methods to instruction visitors
relax dump api
This commit is contained in:
parent
ef89dc5345
commit
dc47e1da98
|
@ -119,7 +119,7 @@ public class CAstCallGraphUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static void dumpCG(SSAContextInterpreter interp, PointerAnalysis<InstanceKey> PA, CallGraph CG) {
|
||||
public static void dumpCG(SSAContextInterpreter interp, PointerAnalysis<? extends InstanceKey> PA, CallGraph CG) {
|
||||
if (AVOID_DUMP)
|
||||
return;
|
||||
for (CGNode N : CG) {
|
||||
|
|
|
@ -12,29 +12,30 @@ package com.ibm.wala.cast.ir.ssa;
|
|||
|
||||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface AstInstructionVisitor extends SSAInstruction.IVisitor {
|
||||
|
||||
public void visitAstLexicalRead(AstLexicalRead instruction);
|
||||
default void visitAstLexicalRead(AstLexicalRead instruction){ }
|
||||
|
||||
public void visitAstLexicalWrite(AstLexicalWrite instruction);
|
||||
default void visitAstLexicalWrite(AstLexicalWrite instruction){ }
|
||||
|
||||
public void visitAstGlobalRead(AstGlobalRead instruction);
|
||||
default void visitAstGlobalRead(AstGlobalRead instruction){ }
|
||||
|
||||
public void visitAstGlobalWrite(AstGlobalWrite instruction);
|
||||
default void visitAstGlobalWrite(AstGlobalWrite instruction){ }
|
||||
|
||||
public void visitAssert(AstAssertInstruction instruction);
|
||||
default void visitAssert(AstAssertInstruction instruction){ }
|
||||
|
||||
public void visitEachElementGet(EachElementGetInstruction inst);
|
||||
default void visitEachElementGet(EachElementGetInstruction inst){ }
|
||||
|
||||
public void visitEachElementHasNext(EachElementHasNextInstruction inst);
|
||||
default void visitEachElementHasNext(EachElementHasNextInstruction inst){ }
|
||||
|
||||
public void visitIsDefined(AstIsDefinedInstruction inst);
|
||||
default void visitIsDefined(AstIsDefinedInstruction inst){ }
|
||||
|
||||
public void visitEcho(AstEchoInstruction inst);
|
||||
default void visitEcho(AstEchoInstruction inst){ }
|
||||
|
||||
public void visitPropertyRead(AstPropertyRead instruction);
|
||||
default void visitPropertyRead(AstPropertyRead instruction){ }
|
||||
|
||||
public void visitPropertyWrite(AstPropertyWrite instruction);
|
||||
default void visitPropertyWrite(AstPropertyWrite instruction){ }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ public abstract class IR implements IRView {
|
|||
/**
|
||||
* visit each normal (non-phi, non-pi, non-catch) instruction in this IR
|
||||
*/
|
||||
public void visitNormalInstructions(SSAInstruction.Visitor v) {
|
||||
public void visitNormalInstructions(SSAInstruction.IVisitor v) {
|
||||
for (SSAInstruction inst : Iterator2Iterable.make(iterateNormalInstructions())) {
|
||||
inst.visit(v);
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ public abstract class IR implements IRView {
|
|||
/**
|
||||
* visit each instruction in this IR
|
||||
*/
|
||||
public void visitAllInstructions(SSAInstruction.Visitor v) {
|
||||
public void visitAllInstructions(SSAInstruction.IVisitor v) {
|
||||
for (SSAInstruction inst : Iterator2Iterable.make(iterateAllInstructions())) {
|
||||
inst.visit(v);
|
||||
}
|
||||
|
|
|
@ -69,52 +69,53 @@ public abstract class SSAInstruction {
|
|||
/**
|
||||
* This interface is used by Instruction.visit to dispatch based on the instruction type.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public static interface IVisitor {
|
||||
void visitGoto(SSAGotoInstruction instruction);
|
||||
default void visitGoto(SSAGotoInstruction instruction){ }
|
||||
|
||||
void visitArrayLoad(SSAArrayLoadInstruction instruction);
|
||||
default void visitArrayLoad(SSAArrayLoadInstruction instruction){ }
|
||||
|
||||
void visitArrayStore(SSAArrayStoreInstruction instruction);
|
||||
default void visitArrayStore(SSAArrayStoreInstruction instruction){ }
|
||||
|
||||
void visitBinaryOp(SSABinaryOpInstruction instruction);
|
||||
default void visitBinaryOp(SSABinaryOpInstruction instruction){ }
|
||||
|
||||
void visitUnaryOp(SSAUnaryOpInstruction instruction);
|
||||
default void visitUnaryOp(SSAUnaryOpInstruction instruction){ }
|
||||
|
||||
void visitConversion(SSAConversionInstruction instruction);
|
||||
default void visitConversion(SSAConversionInstruction instruction){ }
|
||||
|
||||
void visitComparison(SSAComparisonInstruction instruction);
|
||||
default void visitComparison(SSAComparisonInstruction instruction){ }
|
||||
|
||||
void visitConditionalBranch(SSAConditionalBranchInstruction instruction);
|
||||
default void visitConditionalBranch(SSAConditionalBranchInstruction instruction){ }
|
||||
|
||||
void visitSwitch(SSASwitchInstruction instruction);
|
||||
default void visitSwitch(SSASwitchInstruction instruction){ }
|
||||
|
||||
void visitReturn(SSAReturnInstruction instruction);
|
||||
default void visitReturn(SSAReturnInstruction instruction){ }
|
||||
|
||||
void visitGet(SSAGetInstruction instruction);
|
||||
default void visitGet(SSAGetInstruction instruction){ }
|
||||
|
||||
void visitPut(SSAPutInstruction instruction);
|
||||
default void visitPut(SSAPutInstruction instruction){ }
|
||||
|
||||
void visitInvoke(SSAInvokeInstruction instruction);
|
||||
default void visitInvoke(SSAInvokeInstruction instruction){ }
|
||||
|
||||
void visitNew(SSANewInstruction instruction);
|
||||
default void visitNew(SSANewInstruction instruction){ }
|
||||
|
||||
void visitArrayLength(SSAArrayLengthInstruction instruction);
|
||||
default void visitArrayLength(SSAArrayLengthInstruction instruction){ }
|
||||
|
||||
void visitThrow(SSAThrowInstruction instruction);
|
||||
default void visitThrow(SSAThrowInstruction instruction){ }
|
||||
|
||||
void visitMonitor(SSAMonitorInstruction instruction);
|
||||
default void visitMonitor(SSAMonitorInstruction instruction){ }
|
||||
|
||||
void visitCheckCast(SSACheckCastInstruction instruction);
|
||||
default void visitCheckCast(SSACheckCastInstruction instruction){ }
|
||||
|
||||
void visitInstanceof(SSAInstanceofInstruction instruction);
|
||||
default void visitInstanceof(SSAInstanceofInstruction instruction){ }
|
||||
|
||||
void visitPhi(SSAPhiInstruction instruction);
|
||||
default void visitPhi(SSAPhiInstruction instruction){ }
|
||||
|
||||
void visitPi(SSAPiInstruction instruction);
|
||||
default void visitPi(SSAPiInstruction instruction){ }
|
||||
|
||||
void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction);
|
||||
default void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction){ }
|
||||
|
||||
void visitLoadMetadata(SSALoadMetadataInstruction instruction);
|
||||
default void visitLoadMetadata(SSALoadMetadataInstruction instruction){ }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue