[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type
llvm-svn: 237311
This commit is contained in:
parent
6dc1397298
commit
e7107060f8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue