From 1b9d40620be8be192b28e61c3856354c24a5555c Mon Sep 17 00:00:00 2001 From: weiyu Date: Tue, 2 Jul 2019 16:39:03 -0700 Subject: [PATCH] enable the instrumentation of non-atomic loads and stores --- CDSPass.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CDSPass.cpp b/CDSPass.cpp index eef8769..684e03f 100644 --- a/CDSPass.cpp +++ b/CDSPass.cpp @@ -337,8 +337,7 @@ bool CDSPass::runOnFunction(Function &F) { } for (auto Inst : AllLoadsAndStores) { - // Res |= instrumentLoadOrStore(Inst, DL); - // errs() << "load and store are replaced\n"; + Res |= instrumentLoadOrStore(Inst, DL); } for (auto Inst : AtomicAccesses) { @@ -348,13 +347,13 @@ bool CDSPass::runOnFunction(Function &F) { // only instrument functions that contain atomics if (Res && HasAtomic) { IRBuilder<> IRB(F.getEntryBlock().getFirstNonPHI()); + /* Unused for now Value *ReturnAddress = IRB.CreateCall( Intrinsic::getDeclaration(F.getParent(), Intrinsic::returnaddress), IRB.getInt32(0)); + */ Value * FuncName = IRB.CreateGlobalStringPtr(F.getName()); - - errs() << "function name: " << F.getName() << "\n"; IRB.CreateCall(CDSFuncEntry, FuncName); EscapeEnumerator EE(F, "cds_cleanup", true); -- 2.34.1