1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Parse GEP with attached custom metadata. This happens during libprofile_rt.bca build.

llvm-svn: 84002
This commit is contained in:
Devang Patel 2009-10-13 18:49:55 +00:00
parent dd5d38175d
commit e911e90808

View File

@ -3554,11 +3554,15 @@ bool LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
SmallVector<Value*, 16> Indices; SmallVector<Value*, 16> Indices;
while (EatIfPresent(lltok::comma)) { while (EatIfPresent(lltok::comma)) {
if (Lex.getKind() == lltok::NamedOrCustomMD)
break;
if (ParseTypeAndValue(Val, EltLoc, PFS)) return true; if (ParseTypeAndValue(Val, EltLoc, PFS)) return true;
if (!isa<IntegerType>(Val->getType())) if (!isa<IntegerType>(Val->getType()))
return Error(EltLoc, "getelementptr index must be an integer"); return Error(EltLoc, "getelementptr index must be an integer");
Indices.push_back(Val); Indices.push_back(Val);
} }
if (Lex.getKind() == lltok::NamedOrCustomMD)
if (ParseOptionalCustomMetadata()) return true;
if (!GetElementPtrInst::getIndexedType(Ptr->getType(), if (!GetElementPtrInst::getIndexedType(Ptr->getType(),
Indices.begin(), Indices.end())) Indices.begin(), Indices.end()))