From ea3c20f400ff486d51ec753c759ef6be40f18eec Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 13 May 2015 22:54:54 +0000 Subject: [PATCH] [opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237311 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/ConstantFold.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IR/ConstantFold.cpp b/lib/IR/ConstantFold.cpp index ec3414d2530..16b113df1b8 100644 --- a/lib/IR/ConstantFold.cpp +++ b/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(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; -- 2.34.1