revert r133368, apparently I missed the tests to be updated.

llvm-svn: 133369
This commit is contained in:
Chris Lattner 2011-06-18 23:51:31 +00:00
parent a7f74ad10e
commit 07037364cd
1 changed files with 15 additions and 8 deletions

View File

@ -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;