summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-10-31 17:11:27 +0000
committerKostya Serebryany <kcc@google.com>2014-10-31 17:11:27 +0000
commit001ea5fe15f737c867320f8a7e5fe45e2783e6d2 (patch)
treea96b5264c21e86156a537a8854a2b8a8a775a4f0 /llvm/lib
parente9f6a717dd9003b597defee48567431a7db7f9f4 (diff)
downloadbcm5719-llvm-001ea5fe15f737c867320f8a7e5fe45e2783e6d2.tar.gz
bcm5719-llvm-001ea5fe15f737c867320f8a7e5fe45e2783e6d2.zip
[asan] fix caller-calee instrumentation to emit new cache for every call site
llvm-svn: 220973
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 3f0db3630b9..de7b83d0294 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1405,13 +1405,13 @@ void AddressSanitizer::InjectCoverageForIndirectCalls(
const int kCacheSize = 16;
const int kCacheAlignment = 64; // Align for better performance.
Type *Ty = ArrayType::get(IntptrTy, kCacheSize);
- GlobalVariable *CalleeCache =
- new GlobalVariable(*F.getParent(), Ty, false, GlobalValue::PrivateLinkage,
- Constant::getNullValue(Ty), "__asan_gen_callee_cache");
- CalleeCache->setAlignment(kCacheAlignment);
for (auto I : IndirCalls) {
IRBuilder<> IRB(I);
CallSite CS(I);
+ GlobalVariable *CalleeCache = new GlobalVariable(
+ *F.getParent(), Ty, false, GlobalValue::PrivateLinkage,
+ Constant::getNullValue(Ty), "__asan_gen_callee_cache");
+ CalleeCache->setAlignment(kCacheAlignment);
IRB.CreateCall2(AsanCovIndirCallFunction,
IRB.CreatePointerCast(CS.getCalledValue(), IntptrTy),
IRB.CreatePointerCast(CalleeCache, IntptrTy));
OpenPOWER on IntegriCloud