diff options
| author | Dan Gohman <gohman@apple.com> | 2010-07-21 23:38:33 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-07-21 23:38:33 +0000 |
| commit | 79bb121f9d1cb711d91ca0ffe0ce5425cfaa3d0c (patch) | |
| tree | bc129644ee9db39dc25a41c22ce01b14ede5728f /lib/AsmParser/LLParser.cpp | |
| parent | c4b3e8bb1375c611674fdb43b2b5cad5868ff8d5 (diff) | |
| download | external_llvm-79bb121f9d1cb711d91ca0ffe0ce5425cfaa3d0c.zip external_llvm-79bb121f9d1cb711d91ca0ffe0ce5425cfaa3d0c.tar.gz external_llvm-79bb121f9d1cb711d91ca0ffe0ce5425cfaa3d0c.tar.bz2 | |
Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
| -rw-r--r-- | lib/AsmParser/LLParser.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 06229d7..61b1ae5 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -543,7 +543,7 @@ bool LLParser::ParseNamedMetadata() { ParseToken(lltok::lbrace, "Expected '{' here")) return true; - SmallVector<MDNode *, 8> Elts; + NamedMDNode *NMD = M->getOrInsertNamedMetadata(Name); if (Lex.getKind() != lltok::rbrace) do { if (ParseToken(lltok::exclaim, "Expected '!' here")) @@ -551,13 +551,12 @@ bool LLParser::ParseNamedMetadata() { MDNode *N = 0; if (ParseMDNodeID(N)) return true; - Elts.push_back(N); + NMD->addOperand(N); } while (EatIfPresent(lltok::comma)); if (ParseToken(lltok::rbrace, "expected end of metadata node")) return true; - NamedMDNode::Create(Context, Name, Elts.data(), Elts.size(), M); return false; } |
