[llvm-commits] [llvm] r133368 - /llvm/trunk/lib/AsmParser/LLParser.cpp
Chris Lattner
sabre at nondot.org
Sat Jun 18 16:38:57 PDT 2011
Author: lattner
Date: Sat Jun 18 18:38:57 2011
New Revision: 133368
URL: http://llvm.org/viewvc/llvm-project?rev=133368&view=rev
Log:
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.
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=133368&r1=133367&r2=133368&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Sat Jun 18 18:38:57 2011
@@ -170,7 +170,6 @@
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 @@
}
/// 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;
- // 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;
+ 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;
More information about the llvm-commits
mailing list