Print out warning message instead of throwing exception if someone calls static metho...
authorbdemsky <bdemsky>
Mon, 14 Apr 2008 20:07:55 +0000 (20:07 +0000)
committerbdemsky <bdemsky>
Mon, 14 Apr 2008 20:07:55 +0000 (20:07 +0000)
Robust/src/IR/Flat/BuildCode.java

index ed503d7ef8f9739cb1b432ee76eb0084396c094e..3749ee241e5a0ffd8f89ba80e0a157bc2ef6b0d8 100644 (file)
@@ -1697,10 +1697,16 @@ public class BuildCode {
            
            output.print(objectparams.numPointers());
            output.print(", & "+localsprefix);
-           if (fc.getThis()!=null) {
+           if (md.getThis()!=null) {
                output.print(", ");
                output.print("(struct "+md.getThis().getType().getSafeSymbol() +" *)"+ generateTemp(fm,fc.getThis(),lb));
            }
+           if (fc.getThis()!=null&&md.getThis()==null) {
+               System.out.println("WARNING!!!!!!!!!!!!");
+               System.out.println("Source code calls static method"+md+"on an object in "+fm.getMethod()+"!");         
+           }
+           
+
            for(int i=0;i<fc.numArgs();i++) {
                Descriptor var=md.getParameter(i);
                TempDescriptor paramtemp=(TempDescriptor)temptovar.get(var);