mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-18 06:38:41 +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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
///ParseNamedMetadata:
|
/// ParseNamedMetadata:
|
||||||
/// !foo = !{ !1, !2 }
|
/// !foo = !{ !1, !2 }
|
||||||
bool LLParser::ParseNamedMetadata() {
|
bool LLParser::ParseNamedMetadata() {
|
||||||
assert(Lex.getKind() == lltok::NamedOrCustomMD);
|
assert(Lex.getKind() == lltok::NamedOrCustomMD);
|
||||||
Lex.Lex();
|
Lex.Lex();
|
||||||
std::string Name = Lex.getStrVal();
|
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;
|
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;
|
SmallVector<MetadataBase *, 8> Elts;
|
||||||
do {
|
do {
|
||||||
if (ParseToken(lltok::Metadata, "Expected '!' here"))
|
if (ParseToken(lltok::Metadata, "Expected '!' here"))
|
||||||
return true;
|
return true;
|
||||||
Lex.Lex();
|
|
||||||
|
|
||||||
// FIXME: This rejects MDStrings. Are they legal in an named MDNode or not?
|
// FIXME: This rejects MDStrings. Are they legal in an named MDNode or not?
|
||||||
MDNode *N = 0;
|
MDNode *N = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user