[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it throu...
[oota-llvm.git] / lib / IR / ConstantFold.cpp
index ec3414d25308b12e9b505cba77defcdc55e71250..16b113df1b80ed51cf4fb93eaac7c91a338ac896 100644 (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;