From 8d1f04f73e7cf6be4a5ee48604fc62beb688e7a2 Mon Sep 17 00:00:00 2001 From: jjenista Date: Tue, 31 May 2011 18:05:19 +0000 Subject: [PATCH] name flat IR graphs to include method signature to avoid losing some graphs --- Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java b/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java index bd39fa6f..8b113cf9 100644 --- a/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java +++ b/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java @@ -41,7 +41,14 @@ public class FlatIRGraph { for(Iterator it_methods=cd.getMethods(); it_methods.hasNext(); ) { MethodDescriptor md = (MethodDescriptor)it_methods.next(); FlatMethod fm = state.getMethodFlat(md); - writeFlatIRGraph(fm,cd.getSymbol()+"."+md.getSymbol()); + + // make sure the graph name reflects the method signature so + // overloaded methods don't clobber one another + String graphName = cd.getSymbol()+"."+md.getSymbol(); + for (int i = 0; i < fm.numParameters(); ++i) { + graphName += fm.getParameter(i).getSymbol(); + } + writeFlatIRGraph(fm, graphName); } } } @@ -58,7 +65,7 @@ public class FlatIRGraph { // take symbols out of graphname that cause dot to fail graphname = graphname.replaceAll("[\\W]", ""); - flatbw=new BufferedWriter(new FileWriter(graphname+"_flatIRGraph.dot") ); + flatbw=new BufferedWriter(new FileWriter("FLATIR_"+graphname+".dot") ); flatbw.write("digraph "+graphname+" {\n"); visited=new HashSet(); -- 2.34.1