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

David Blaikie dblaikie at gmail.com
Wed May 13 15:54:55 PDT 2015


Author: dblaikie
Date: Wed May 13 17:54:54 2015
New Revision: 237311

URL: http://llvm.org/viewvc/llvm-project?rev=237311&view=rev
Log:
[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type

Modified:
    llvm/trunk/lib/IR/ConstantFold.cpp

Modified: llvm/trunk/lib/IR/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantFold.cpp?rev=237311&r1=237310&r2=237311&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantFold.cpp (original)
+++ llvm/trunk/lib/IR/ConstantFold.cpp Wed May 13 17:54:54 2015
@@ -1385,7 +1385,7 @@ static ICmpInst::Predicate areGlobalsPot
     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;





More information about the llvm-commits mailing list