MCPcopy Create free account
hub / github.com/LFYSec/MScan / IRBuildHelper

Method IRBuildHelper

src/main/java/pascal/taie/ir/IRBuildHelper.java:74–94  ·  view source on GitHub ↗
(JMethod method)

Source from the content-addressed store, hash-verified

72 private int tempCounter = 0;
73
74 public IRBuildHelper(JMethod method) {
75 this.method = method;
76 // build this variable
77 vars = new ArrayList<>();
78 thisVar = method.isStatic() ? null :
79 newVar(THIS, method.getDeclaringClass().getType());
80 // build parameters
81 params = new ArrayList<>(method.getParamCount());
82 for (int i = 0; i < method.getParamCount(); ++i) {
83 params.add(newVar(PARAM + i, method.getParamType(i)));
84 }
85 // build return variable
86 Type retType = method.getReturnType();
87 if (!retType.equals(VoidType.VOID)) {
88 returnVar = newVar(RETURN, retType);
89 returnVars = Set.of(returnVar);
90 } else {
91 returnVar = null;
92 returnVars = Set.of();
93 }
94 }
95
96 /**
97 * @return {@code this} variable of the IR being built.

Callers

nothing calls this directly

Calls 10

newVarMethod · 0.95
getParamCountMethod · 0.80
getParamTypeMethod · 0.80
getTypeMethod · 0.65
addMethod · 0.65
ofMethod · 0.65
isStaticMethod · 0.45
getDeclaringClassMethod · 0.45
getReturnTypeMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected