Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open up parameter type #837

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
public class ICFGDotExporter {

public static String buildICFGGraph(
Map<MethodSignature, StmtGraph> signatureToStmtGraph, View view, CallGraph callGraph) {
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph, View view, CallGraph callGraph) {
final StringBuilder sb = new StringBuilder();
DotExporter.buildDiGraphObject(sb);
Map<Integer, MethodSignature> calls;
calls = computeCalls(signatureToStmtGraph, view, callGraph);
for (Map.Entry<MethodSignature, StmtGraph> entry : signatureToStmtGraph.entrySet()) {
for (Map.Entry<MethodSignature, StmtGraph<?>> entry : signatureToStmtGraph.entrySet()) {
String graph = DotExporter.buildGraph(entry.getValue(), true, calls, entry.getKey());
sb.append(graph + "\n");
sb.append(graph).append("\n");
}
sb.append("}");
return sb.toString();
Expand All @@ -58,10 +58,10 @@ public static String buildICFGGraph(
* methods.
*/
public static Map<Integer, MethodSignature> computeCalls(
Map<MethodSignature, StmtGraph> stmtGraphSet, View view, CallGraph callgraph) {
Map<MethodSignature, StmtGraph<?>> stmtGraphSet, View view, CallGraph callgraph) {
Map<Integer, MethodSignature> calls = new HashMap<>();
for (Map.Entry<MethodSignature, StmtGraph> entry : stmtGraphSet.entrySet()) {
StmtGraph stmtGraph = entry.getValue();
for (Map.Entry<MethodSignature, StmtGraph<?>> entry : stmtGraphSet.entrySet()) {
StmtGraph<?> stmtGraph = entry.getValue();
MethodSignature source = entry.getKey();
Collection<? extends BasicBlock<?>> blocks;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import sootup.core.model.SootMethod;
import sootup.core.signatures.MethodSignature;
import sootup.core.views.View;
import sootup.java.core.views.JavaView;

/**
* Default implementation for the {@link InterproceduralCFG} interface. Includes all statements
Expand Down Expand Up @@ -136,7 +135,7 @@ private Stmt filterEdgeAndGetCallerStmt(@Nonnull MethodSignature methodSignature
IDESolver.DEFAULT_CACHE_BUILDER.build(loaderMethodToCallers);

public JimpleBasedInterproceduralCFG(
JavaView view,
View view,
MethodSignature mainMethodSignature,
boolean enableExceptions,
boolean includeReflectiveCalls) {
Expand All @@ -149,22 +148,22 @@ public JimpleBasedInterproceduralCFG(
}

public String buildICFGGraph(CallGraph callGraph) {
Map<MethodSignature, StmtGraph> signatureToStmtGraph = new LinkedHashMap<>();
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph = new LinkedHashMap<>();
computeAllCalls(mainMethodSignature, signatureToStmtGraph, callGraph);
return ICFGDotExporter.buildICFGGraph(signatureToStmtGraph, view, callGraph);
}

public void computeAllCalls(
MethodSignature methodSignature,
Map<MethodSignature, StmtGraph> signatureToStmtGraph,
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph,
CallGraph callGraph) {
ArrayList<MethodSignature> visitedMethods = new ArrayList<>();
computeAllCalls(methodSignature, signatureToStmtGraph, callGraph, visitedMethods);
}

private void computeAllCalls(
MethodSignature methodSignature,
Map<MethodSignature, StmtGraph> signatureToStmtGraph,
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph,
CallGraph callGraph,
List<MethodSignature> visitedMethods) {
visitedMethods.add(methodSignature);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void ICFGInterfaceDotExport() {
/** Compute the Edges of the given methodSignature from the provided callGraph */
public String edgesFromCallGraph(
MethodSignature methodSignature, JimpleBasedInterproceduralCFG icfg, CallGraph callGraph) {
Map<MethodSignature, StmtGraph> signatureToStmtGraph = new LinkedHashMap<>();
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph = new LinkedHashMap<>();
icfg.computeAllCalls(methodSignature, signatureToStmtGraph, callGraph);
Map<Integer, MethodSignature> calls;
calls = ICFGDotExporter.computeCalls(signatureToStmtGraph, view, callGraph);
Expand Down
Loading