Remove support for parsing the "type i32" syntax for defining a numbered

top level type without a specified number.  This asmprinter has never
generated this, as you can tell by no tests being updated.  It also isn't
documented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2011-06-18 23:38:57 +00:00
parent b2318662b6
commit 8dd72b85b2

View File

@ -170,7 +170,6 @@ 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;
@ -291,24 +290,18 @@ bool LLParser::ParseDepLibs() {
}
/// ParseUnnamedType:
/// ::= 'type' type
/// ::= LocalVarID '=' 'type' type
bool LLParser::ParseUnnamedType() {
unsigned TypeID = NumberedTypes.size();
// 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;
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;
PATypeHolder Ty(Type::getVoidTy(Context));
if (ParseType(Ty)) return true;