[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type

llvm-svn: 237311
This commit is contained in:
David Blaikie 2015-05-13 22:54:54 +00:00
parent 6dc1397298
commit e7107060f8
1 changed files with 1 additions and 1 deletions

View File

@ -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;