[sva-commits] r124809 - in /safecode/trunk: include/safecode/SafeLoadStoreOpts.h lib/OptimizeChecks/SafeLoadStoreOpts.cpp

John Criswell criswell at uiuc.edu
Thu Feb 3 13:33:51 CST 2011


Author: criswell
Date: Thu Feb  3 13:33:51 2011
New Revision: 124809

URL: http://llvm.org/viewvc/llvm-project?rev=124809&view=rev
Log:
Use the new TypeSafety pass to determine if a memory object is used in a
type-consistent fashion.

Modified:
    safecode/trunk/include/safecode/SafeLoadStoreOpts.h
    safecode/trunk/lib/OptimizeChecks/SafeLoadStoreOpts.cpp

Modified: safecode/trunk/include/safecode/SafeLoadStoreOpts.h
URL: http://llvm.org/viewvc/llvm-project/safecode/trunk/include/safecode/SafeLoadStoreOpts.h?rev=124809&r1=124808&r2=124809&view=diff
==============================================================================
--- safecode/trunk/include/safecode/SafeLoadStoreOpts.h (original)
+++ safecode/trunk/include/safecode/SafeLoadStoreOpts.h Thu Feb  3 13:33:51 2011
@@ -17,6 +17,7 @@
 #include "safecode/SAFECode.h"
 #include "safecode/Intrinsic.h"
 
+#include "dsa/TypeSafety.h"
 #include "poolalloc/PoolAllocate.h"
 
 #include "llvm/Pass.h"
@@ -50,6 +51,7 @@
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<InsertSCIntrinsic>();
       AU.addRequired<EQTDDataStructures>();
+      AU.addRequired<dsa::TypeSafety<EQTDDataStructures> >();
       AU.setPreservesCFG();
     }
 };

Modified: safecode/trunk/lib/OptimizeChecks/SafeLoadStoreOpts.cpp
URL: http://llvm.org/viewvc/llvm-project/safecode/trunk/lib/OptimizeChecks/SafeLoadStoreOpts.cpp?rev=124809&r1=124808&r2=124809&view=diff
==============================================================================
--- safecode/trunk/lib/OptimizeChecks/SafeLoadStoreOpts.cpp (original)
+++ safecode/trunk/lib/OptimizeChecks/SafeLoadStoreOpts.cpp Thu Feb  3 13:33:51 2011
@@ -100,6 +100,7 @@
   // Get access to prerequisite passes.
   //
   InsertSCIntrinsic & intrinsic = getAnalysis<InsertSCIntrinsic>();
+  dsa::TypeSafety<EQTDDataStructures> & TS = getAnalysis<dsa::TypeSafety<EQTDDataStructures> >();
 
   //
   // Scan through all uses of the complete run-time check and record any checks
@@ -132,11 +133,9 @@
         // a type-consistent object.
         //
         Function * F = CI->getParent()->getParent();
-        if (DSNode * N = getDSNodeHandle (CheckPtr, F).getNode()) {
-          if (!(N->isNodeCompletelyFolded())) {
-            toRemoveTypeSafe.push_back (CI);
-            continue;
-          }
+        if (TS.isTypeSafe (CheckPtr, F)) {
+          toRemoveTypeSafe.push_back (CI);
+          continue;
         }
       }
     }




More information about the sva-commits mailing list