import java.util.Map;
import java.util.Set;
+import IR.Descriptor;
import IR.MethodDescriptor;
-public class MethodLocationInfo {
+public class MethodLocationInfo extends LocationInfo {
String returnLocName;
String thisLocName;
- String PCLocName;
- Map<Integer, String> mapParamIdxToLocName;
- Map<String, FlowNode> mapLocNameToFlowNode;
- MethodDescriptor md;
+ CompositeLocation pcLoc;
+ String globalLocName;
+
+ Map<Integer, CompositeLocation> mapParamIdxToInferLoc;
+ Set<String> paramLocNameSet;
public MethodLocationInfo(MethodDescriptor md) {
this.md = md;
- this.mapParamIdxToLocName = new HashMap<Integer, String>();
- this.mapLocNameToFlowNode = new HashMap<String, FlowNode>();
- this.PCLocName = SSJavaAnalysis.TOP;
+ this.paramLocNameSet = new HashSet<String>();
+ this.pcLoc = new CompositeLocation(new Location(md, Location.TOP));
+ this.mapParamIdxToInferLoc = new HashMap<Integer, CompositeLocation>();
+ }
+
+ public void addMapParamIdxToInferLoc(int paramIdx, CompositeLocation inferLoc) {
+ mapParamIdxToInferLoc.put(paramIdx, inferLoc);
+ }
+
+ public Map<Integer, CompositeLocation> getMapParamIdxToInferLoc() {
+ return mapParamIdxToInferLoc;
+ }
+
+ public String getGlobalLocName() {
+ return globalLocName;
+ }
+
+ public void setGlobalLocName(String globalLocName) {
+ this.globalLocName = globalLocName;
}
public String getReturnLocName() {
this.thisLocName = thisLocName;
}
- public String getPCLocName() {
- return PCLocName;
- }
-
- public void setPCLocName(String pCLocName) {
- PCLocName = pCLocName;
+ public CompositeLocation getPCLoc() {
+ return pcLoc;
}
- public void addParameter(String name, FlowNode node, int idx) {
- mapParamIdxToLocName.put(new Integer(idx), name);
- mapLocNameToFlowNode.put(name, node);
+ public void setPCLoc(CompositeLocation pcLoc) {
+ this.pcLoc = pcLoc;
}
- public Set<String> getParameterLocNameSet() {
- Set<String> paramSet = new HashSet<String>();
-
- paramSet.add(PCLocName);
-
- if (thisLocName != null) {
- paramSet.add(thisLocName);
- }
-
- if (returnLocName != null) {
- paramSet.add(returnLocName);
- }
-
- paramSet.addAll(mapLocNameToFlowNode.keySet());
-
- return paramSet;
+ public void removeMaplocalVarToLocSet(Descriptor localVarDesc) {
+ String localVarLocSymbol = localVarDesc.getSymbol();
+ getDescSet(localVarLocSymbol).remove(localVarDesc);
}
}