diff options
author | Manuel Jacob <me@manueljacob.de> | 2016-01-16 20:30:46 +0000 |
---|---|---|
committer | Manuel Jacob <me@manueljacob.de> | 2016-01-16 20:30:46 +0000 |
commit | 5f6eaac6115a44f4ef3d819123f8694d3d5825ea (patch) | |
tree | 4f2535126e469abb4e8af765dcd1692ec466424a /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | |
parent | 7cdedc1e029ea5860f9077abb39013ae7cc6e9cf (diff) | |
download | bcm5719-llvm-5f6eaac6115a44f4ef3d819123f8694d3d5825ea.tar.gz bcm5719-llvm-5f6eaac6115a44f4ef3d819123f8694d3d5825ea.zip |
GlobalValue: use getValueType() instead of getType()->getPointerElementType().
Reviewers: mjacob
Subscribers: jholewinski, arsenm, dsanders, dblaikie
Patch by Eduard Burtescu.
Differential Revision: http://reviews.llvm.org/D16260
llvm-svn: 257999
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index a9df5e5898a..c00765f762e 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1184,7 +1184,7 @@ void AddressSanitizerModule::createInitializerPoisonCalls( } bool AddressSanitizerModule::ShouldInstrumentGlobal(GlobalVariable *G) { - Type *Ty = cast<PointerType>(G->getType())->getElementType(); + Type *Ty = G->getValueType(); DEBUG(dbgs() << "GLOBAL: " << *G << "\n"); if (GlobalsMD.get(G).IsBlacklisted) return false; @@ -1338,8 +1338,7 @@ bool AddressSanitizerModule::InstrumentGlobals(IRBuilder<> &IRB, Module &M) { M, MD.Name.empty() ? G->getName() : MD.Name, /*AllowMerging*/ true); - PointerType *PtrTy = cast<PointerType>(G->getType()); - Type *Ty = PtrTy->getElementType(); + Type *Ty = G->getValueType(); uint64_t SizeInBytes = DL.getTypeAllocSize(Ty); uint64_t MinRZ = MinRedzoneSizeForGlobal(); // MinRZ <= RZ <= kMaxGlobalRedzone |