[llvm] r213673 - [ASan] Fix comments about __sanitizer_cov function

Alexey Samsonov vonosmas at gmail.com
Tue Jul 22 10:46:10 PDT 2014


Author: samsonov
Date: Tue Jul 22 12:46:09 2014
New Revision: 213673

URL: http://llvm.org/viewvc/llvm-project?rev=213673&view=rev
Log:
[ASan] Fix comments about __sanitizer_cov function

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=213673&r1=213672&r2=213673&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Tue Jul 22 12:46:09 2014
@@ -1311,8 +1311,7 @@ void AddressSanitizer::InjectCoverageAtB
       Cmp, IP, false, MDBuilder(*C).createBranchWeights(1, 100000));
   IRB.SetInsertPoint(Ins);
   IRB.SetCurrentDebugLocation(EntryLoc);
-  // We pass &F to __sanitizer_cov. We could avoid this and rely on
-  // GET_CALLER_PC, but having the PC of the first instruction is just nice.
+  // __sanitizer_cov gets the PC of the instruction using GET_CALLER_PC.
   IRB.CreateCall(AsanCovFunction);
   StoreInst *Store = IRB.CreateStore(ConstantInt::get(Int8Ty, 1), Guard);
   Store->setAtomic(Monotonic);
@@ -1324,7 +1323,7 @@ void AddressSanitizer::InjectCoverageAtB
 // as the function and inject this code into the entry block (-asan-coverage=1)
 // or all blocks (-asan-coverage=2):
 // if (*Guard) {
-//    __sanitizer_cov(&F);
+//    __sanitizer_cov();
 //    *Guard = 1;
 // }
 // The accesses to Guard are atomic. The rest of the logic is





More information about the llvm-commits mailing list