complete merging
[c11llvm.git] / CDSPass.cpp
index eeb9b37f10a0a2729e0e9f67ab310d2d2ad1deb4..a807928dd5b9c12f012466e5b28b0ee315704afd 100644 (file)
@@ -184,8 +184,6 @@ void CDSPass::initializeCallbacks(Module &M) {
     SmallString<32> AtomicLoadName("cds_atomic_load" + BitSizeStr);
     SmallString<32> AtomicStoreName("cds_atomic_store" + BitSizeStr);
 
-//    CDSLoad[i]  = M.getOrInsertFunction(LoadName, Ty, PtrTy);
-//    CDSStore[i] = M.getOrInsertFunction(StoreName, VoidTy, PtrTy, Ty);
     CDSLoad[i]  = M.getOrInsertFunction(LoadName, VoidTy, PtrTy);
     CDSStore[i] = M.getOrInsertFunction(StoreName, VoidTy, PtrTy);
     CDSAtomicLoad[i]  = M.getOrInsertFunction(AtomicLoadName, Ty, PtrTy, OrdTy);
@@ -296,8 +294,8 @@ bool CDSPass::runOnFunction(Function &F) {
     bool Res = false;
     const DataLayout &DL = F.getParent()->getDataLayout();
   
-    errs() << "Before\n";
-    F.dump();
+//    errs() << "Before\n";
+//    F.dump();
 
     for (auto &B : F) {
       for (auto &I : B) {
@@ -313,18 +311,13 @@ bool CDSPass::runOnFunction(Function &F) {
     }
 
     for (auto Inst : AllLoadsAndStores) {
-//      Res |= instrumentLoadOrStore(Inst, DL);
-//      errs() << "load and store are not replaced\n";
+      Res |= instrumentLoadOrStore(Inst, DL);
+//      errs() << "load and store are replaced\n";
     }
 
     for (auto Inst : AtomicAccesses) {
       Res |= instrumentAtomic(Inst);
     } 
-
-    if (Res) {
-      errs() << F.getName(); 
-      errs() << " has above instructions replaced\n";
-    }
   }
 //       errs() << "After\n";
 //       F.dump();