[llvm] r235233 - [opaque pointer type] Use the parsed explicit pointee type when error-checking geps during LL parsing

David Blaikie dblaikie at gmail.com
Fri Apr 17 15:32:13 PDT 2015


Author: dblaikie
Date: Fri Apr 17 17:32:13 2015
New Revision: 235233

URL: http://llvm.org/viewvc/llvm-project?rev=235233&view=rev
Log:
[opaque pointer type] Use the parsed explicit pointee type when error-checking geps during LL parsing

Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=235233&r1=235232&r2=235233&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Fri Apr 17 17:32:13 2015
@@ -5542,13 +5542,10 @@ int LLParser::ParseGetElementPtr(Instruc
   }
 
   SmallPtrSet<const Type*, 4> Visited;
-  if (!Indices.empty() &&
-      !BasePointerType->getElementType()->isSized(&Visited))
+  if (!Indices.empty() && !Ty->isSized(&Visited))
     return Error(Loc, "base element of getelementptr must be sized");
 
-  if (!GetElementPtrInst::getIndexedType(
-          cast<PointerType>(BaseType->getScalarType())->getElementType(),
-          Indices))
+  if (!GetElementPtrInst::getIndexedType(Ty, Indices))
     return Error(Loc, "invalid getelementptr indices");
   Inst = GetElementPtrInst::Create(Ty, Ptr, Indices);
   if (InBounds)





More information about the llvm-commits mailing list