aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-30 04:13:37 +0000
committerChris Lattner <sabre@nondot.org>2009-12-30 04:13:37 +0000
commit860775c2b05a0d0ecadcbf2e9283912061fb5235 (patch)
tree5d3d5900602cacab11b63aa146eefb1454a1422d /lib/AsmParser
parentc49363bcd92a9b60171199d38e57234757cf00fc (diff)
fix parsing of mdstring values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/LLParser.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index db2a5a92ab..1ef4209dae 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -1888,7 +1888,7 @@ bool LLParser::ParseValID(ValID &ID) {
ID.StrVal = Lex.getStrVal();
ID.Kind = ValID::t_LocalName;
break;
- case lltok::Metadata: { // !{...} MDNode, !"foo" MDString
+ case lltok::Metadata: // !{...} MDNode, !"foo" MDString
Lex.Lex();
// FIXME: This doesn't belong here.
@@ -1905,20 +1905,17 @@ bool LLParser::ParseValID(ValID &ID) {
// Standalone metadata reference
// !{ ..., !42, ... }
- // FIXME: Split MetadataVal into one for MDNode and one for MDString.
- if (!ParseMDNode(ID.MDNodeVal)) {
+ if (Lex.getKind() == lltok::APSInt) {
+ if (ParseMDNode(ID.MDNodeVal)) return true;
ID.Kind = ValID::t_MDNode;
return false;
}
- // FIXME: This can't work.
-
// MDString:
// ::= '!' STRINGCONSTANT
if (ParseMDString(ID.MDStringVal)) return true;
ID.Kind = ValID::t_MDString;
return false;
- }
case lltok::APSInt:
ID.APSIntVal = Lex.getAPSIntVal();
ID.Kind = ValID::t_APSInt;
@@ -2473,7 +2470,7 @@ bool LLParser::ConvertValIDToValue(const Type *Ty, ValID &ID, Value *&V,
case ValID::t_LocalID: V = PFS.GetVal(ID.UIntVal, Ty, ID.Loc); break;
case ValID::t_LocalName: V = PFS.GetVal(ID.StrVal, Ty, ID.Loc); break;
case ValID::t_MDNode: V = ID.MDNodeVal; break;
- case ValID::t_MDString: V = ID.MDStringVal;
+ case ValID::t_MDString: V = ID.MDStringVal; break;
case ValID::t_InlineAsm: {
const PointerType *PTy = dyn_cast<PointerType>(Ty);
const FunctionType *FTy =