mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
simplify some code and unbreak the build by not consuming an
extra token. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c17300f3c5
commit
84d03b11d0
@ -503,28 +503,22 @@ bool LLParser::ParseMDNode(MDNode *&Result) {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user