diff options
author | Kostya Serebryany <kcc@google.com> | 2012-10-17 13:40:06 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-10-17 13:40:06 +0000 |
commit | 324d96b9e265b0fd8bf63a28340910def64e2164 (patch) | |
tree | cdb989c3c7063d97e1d7696bffe8702fd825f0c1 /lib | |
parent | 02bf98ab38355aafbe9a763caa019bc06ad9ce3d (diff) | |
download | external_llvm-324d96b9e265b0fd8bf63a28340910def64e2164.zip external_llvm-324d96b9e265b0fd8bf63a28340910def64e2164.tar.gz external_llvm-324d96b9e265b0fd8bf63a28340910def64e2164.tar.bz2 |
[asan] better debug diagnostics in asan compiler module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Instrumentation/AddressSanitizer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index b566994..75f42f3 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -534,7 +534,7 @@ void AddressSanitizer::createInitializerPoisonCalls(Module &M, bool AddressSanitizer::ShouldInstrumentGlobal(GlobalVariable *G) { Type *Ty = cast<PointerType>(G->getType())->getElementType(); - DEBUG(dbgs() << "GLOBAL: " << *G); + DEBUG(dbgs() << "GLOBAL: " << *G << "\n"); if (BL->isIn(*G)) return false; if (!Ty->isSized()) return false; @@ -682,7 +682,7 @@ bool AddressSanitizer::insertGlobalRedzones(Module &M) { FirstDynamic = LastDynamic; } - DEBUG(dbgs() << "NEW GLOBAL:\n" << *NewGlobal); + DEBUG(dbgs() << "NEW GLOBAL: " << *NewGlobal << "\n"); } ArrayType *ArrayOfGlobalStructTy = ArrayType::get(GlobalStructTy, n); @@ -851,6 +851,7 @@ bool AddressSanitizer::maybeInsertAsanInitAtFunctionEntry(Function &F) { bool AddressSanitizer::runOnFunction(Function &F) { if (BL->isIn(F)) return false; if (&F == AsanCtorFunction) return false; + DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n"); // If needed, insert __asan_init before checking for AddressSafety attr. maybeInsertAsanInitAtFunctionEntry(F); @@ -914,8 +915,6 @@ bool AddressSanitizer::runOnFunction(Function &F) { NumInstrumented++; } - DEBUG(dbgs() << F); - bool ChangedStack = poisonStackInFunction(F); // We must unpoison the stack before every NoReturn call (throw, _exit, etc). @@ -925,6 +924,7 @@ bool AddressSanitizer::runOnFunction(Function &F) { IRBuilder<> IRB(CI); IRB.CreateCall(AsanHandleNoReturnFunc); } + DEBUG(dbgs() << "ASAN done instrumenting:\n" << F << "\n"); return NumInstrumented > 0 || ChangedStack || !NoReturnCalls.empty(); } |