mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
revert r133368, apparently I missed the tests to be updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133369 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8dd72b85b2
commit
edcaca8e41
@ -170,6 +170,7 @@ bool LLParser::ParseTopLevelEntities() {
|
||||
case lltok::kw_module: if (ParseModuleAsm()) return true; break;
|
||||
case lltok::kw_target: if (ParseTargetDefinition()) return true; break;
|
||||
case lltok::kw_deplibs: if (ParseDepLibs()) return true; break;
|
||||
case lltok::kw_type: if (ParseUnnamedType()) return true; break;
|
||||
case lltok::LocalVarID: if (ParseUnnamedType()) return true; break;
|
||||
case lltok::LocalVar: if (ParseNamedType()) return true; break;
|
||||
case lltok::GlobalID: if (ParseUnnamedGlobal()) return true; break;
|
||||
@ -290,18 +291,24 @@ bool LLParser::ParseDepLibs() {
|
||||
}
|
||||
|
||||
/// ParseUnnamedType:
|
||||
/// ::= 'type' type
|
||||
/// ::= LocalVarID '=' 'type' type
|
||||
bool LLParser::ParseUnnamedType() {
|
||||
LocTy TypeLoc = Lex.getLoc();
|
||||
unsigned TypeID = NumberedTypes.size();
|
||||
if (Lex.getUIntVal() != TypeID)
|
||||
return Error(Lex.getLoc(), "type expected to be numbered '%" +
|
||||
Twine(TypeID) + "'");
|
||||
Lex.Lex(); // eat LocalVarID;
|
||||
|
||||
if (ParseToken(lltok::equal, "expected '=' after name") ||
|
||||
ParseToken(lltok::kw_type, "expected 'type' after '='"))
|
||||
return true;
|
||||
// Handle the LocalVarID form.
|
||||
if (Lex.getKind() == lltok::LocalVarID) {
|
||||
if (Lex.getUIntVal() != TypeID)
|
||||
return Error(Lex.getLoc(), "type expected to be numbered '%" +
|
||||
Twine(TypeID) + "'");
|
||||
Lex.Lex(); // eat LocalVarID;
|
||||
|
||||
if (ParseToken(lltok::equal, "expected '=' after name"))
|
||||
return true;
|
||||
}
|
||||
|
||||
LocTy TypeLoc = Lex.getLoc();
|
||||
if (ParseToken(lltok::kw_type, "expected 'type' after '='")) return true;
|
||||
|
||||
PATypeHolder Ty(Type::getVoidTy(Context));
|
||||
if (ParseType(Ty)) return true;
|
||||
|
Loading…
Reference in New Issue
Block a user