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 | 01806dc406eb9e25ba0c79e0cf4f81fdbd27e6ef (patch) | |
| tree | dbe0db20356aa3b25d1b57be952ab28668dd69cf /lib/AsmParser/LLParser.cpp | |
| parent | 3f0eb54d7f7bcfb8456eca6fd52cbfc4eee79f59 (diff) | |
| download | external_llvm-01806dc406eb9e25ba0c79e0cf4f81fdbd27e6ef.zip external_llvm-01806dc406eb9e25ba0c79e0cf4f81fdbd27e6ef.tar.gz external_llvm-01806dc406eb9e25ba0c79e0cf4f81fdbd27e6ef.tar.bz2 | |
Add support for empty named metadata too. This isn't particularly
useful, but it is nice for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
| -rw-r--r-- | lib/AsmParser/LLParser.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 8c4d734..3948071 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/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; |
