[llvm-commits] [llvm] r92279 - /llvm/trunk/lib/AsmParser/LLParser.cpp
Chris Lattner
sabre at nondot.org
Tue Dec 29 14:35:40 PST 2009
Author: lattner
Date: Tue Dec 29 16:35:39 2009
New Revision: 92279
URL: http://llvm.org/viewvc/llvm-project?rev=92279&view=rev
Log:
simplify some code and unbreak the build by not consuming an
extra token.
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=92279&r1=92278&r2=92279&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Dec 29 16:35:39 2009
@@ -503,28 +503,22 @@
return false;
}
-///ParseNamedMetadata:
+/// ParseNamedMetadata:
/// !foo = !{ !1, !2 }
bool LLParser::ParseNamedMetadata() {
assert(Lex.getKind() == lltok::NamedOrCustomMD);
Lex.Lex();
std::string Name = Lex.getStrVal();
- if (ParseToken(lltok::equal, "expected '=' here"))
+ if (ParseToken(lltok::equal, "expected '=' here") ||
+ ParseToken(lltok::Metadata, "Expected '!' here") ||
+ ParseToken(lltok::lbrace, "Expected '{' here"))
return true;
- if (Lex.getKind() != lltok::Metadata)
- return TokError("Expected '!' here");
- Lex.Lex();
-
- if (Lex.getKind() != lltok::lbrace)
- return TokError("Expected '{' here");
- Lex.Lex();
SmallVector<MetadataBase *, 8> Elts;
do {
if (ParseToken(lltok::Metadata, "Expected '!' here"))
return true;
- Lex.Lex();
// FIXME: This rejects MDStrings. Are they legal in an named MDNode or not?
MDNode *N = 0;
More information about the llvm-commits
mailing list