aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-05-13 22:54:54 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-05-13 22:54:54 +0000
commite7107060f8d1a0b771a9c0e242006d2c355f8abc (patch)
treeda09260def4e9188811065c23cb8dba33188b4c9 /llvm/lib/IR/ConstantFold.cpp
parent6dc139729882d5c363dda1e0994a71b88da4bd5e (diff)
downloadllvm-e7107060f8d1a0b771a9c0e242006d2c355f8abc.zip
llvm-e7107060f8d1a0b771a9c0e242006d2c355f8abc.tar.gz
llvm-e7107060f8d1a0b771a9c0e242006d2c355f8abc.tar.bz2
[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type
llvm-svn: 237311
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index ec3414d..16b113d 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -1385,7 +1385,7 @@ static ICmpInst::Predicate areGlobalsPotentiallyEqual(const GlobalValue *GV1,
if (GV->hasExternalWeakLinkage() || GV->hasWeakAnyLinkage())
return true;
if (const auto *GVar = dyn_cast<GlobalVariable>(GV)) {
- Type *Ty = GVar->getType()->getPointerElementType();
+ Type *Ty = GVar->getValueType();
// A global with opaque type might end up being zero sized.
if (!Ty->isSized())
return true;