From: jjenista Date: Thu, 14 May 2009 22:34:21 +0000 (+0000) Subject: use sese pretty id and id to generate method names, param struct and local struct... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1182a29c6c7b4dafe907ad1db57647092b2a037b;p=IRC.git use sese pretty id and id to generate method names, param struct and local struct that is unique--keep a mapping of seses to the bogus flat method for retrieval in order to reproduce those names at call sites. Also some bug fixes --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 0d1cbb67..1aa82557 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1,4 +1,5 @@ package IR.Flat; +import IR.Tree.Modifiers; import IR.Tree.FlagExpressionNode; import IR.Tree.DNFFlag; import IR.Tree.DNFFlagAtom; @@ -54,6 +55,7 @@ public class BuildCode { SafetyAnalysis sa; PrefetchAnalysis pa; MLPAnalysis mlpa; + Hashtable sese2bogusFlatMeth; boolean nonSESEpass=true; WriteBarrier wb; DiscoverConflicts dc; @@ -97,6 +99,9 @@ public class BuildCode { this.dc=new DiscoverConflicts(locality, st, typeanalysis); dc.doAnalysis(); } + if(state.MLP) { + sese2bogusFlatMeth = new Hashtable(); + } } /** The buildCode method outputs C code for all the methods. The Flat @@ -1554,17 +1559,21 @@ public class BuildCode { PrintWriter outputMethods ) { - /* + FlatMethod fm = fsen.getEnclosingFlatMeth(); MethodDescriptor md = fm.getMethod(); ClassDescriptor cn = md.getClassDesc(); - + //Creates bogus method descriptor to index into tables Modifiers bogusmod=new Modifiers(); - MethodDescriptor bogusmd=new MethodDescriptor(bogusmod, new TypeDescriptor(TypeDescriptor.VOID), fsen.getIdentifier()); + MethodDescriptor bogusmd=new MethodDescriptor(bogusmod, + new TypeDescriptor(TypeDescriptor.VOID), + fsen.getPrettyIdentifier()+fsen.getIdentifier()); FlatMethod bogusfm=new FlatMethod(bogusmd, null); - + sese2bogusFlatMeth.put(fsen, bogusfm); + + //Build paramsobj for bogus method descriptor ParamsObject objectparams=new ParamsObject(bogusmd, tag++); paramstable.put(bogusmd, objectparams); @@ -1572,14 +1581,15 @@ public class BuildCode { for(int i=0; i