diff options
| author | Dan Gohman <gohman@apple.com> | 2010-07-13 19:42:44 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-07-13 19:42:44 +0000 |
| commit | afd69cf5b75265008413ac34a061995400b4131c (patch) | |
| tree | d08d57cf255f9d196f45b05698f3ad3977e92011 /llvm/lib/AsmParser | |
| parent | b43455feaf5161f9688c8782fdf469a874765e37 (diff) | |
| download | bcm5719-llvm-afd69cf5b75265008413ac34a061995400b4131c.tar.gz bcm5719-llvm-afd69cf5b75265008413ac34a061995400b4131c.zip | |
Add support for empty named metadata too. This isn't particularly
useful, but it is nice for consistency.
llvm-svn: 108262
Diffstat (limited to 'llvm/lib/AsmParser')
| -rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 8c4d7348eb1..3948071c420 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -544,20 +544,21 @@ bool LLParser::ParseNamedMetadata() { return true; SmallVector<MDNode *, 8> Elts; - do { - // Null is a special case since it is typeless. - if (EatIfPresent(lltok::kw_null)) { - Elts.push_back(0); - continue; - } + if (Lex.getKind() != lltok::rbrace) + do { + // Null is a special case since it is typeless. + if (EatIfPresent(lltok::kw_null)) { + Elts.push_back(0); + continue; + } - if (ParseToken(lltok::exclaim, "Expected '!' here")) - return true; + if (ParseToken(lltok::exclaim, "Expected '!' here")) + return true; - MDNode *N = 0; - if (ParseMDNodeID(N)) return true; - Elts.push_back(N); - } while (EatIfPresent(lltok::comma)); + MDNode *N = 0; + if (ParseMDNodeID(N)) return true; + Elts.push_back(N); + } while (EatIfPresent(lltok::comma)); if (ParseToken(lltok::rbrace, "expected end of metadata node")) return true; |

