summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/TGParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/TGParser.cpp')
-rw-r--r--llvm/utils/TableGen/TGParser.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/TGParser.cpp b/llvm/utils/TableGen/TGParser.cpp
index 1fa8272727b..9d579c2ef7e 100644
--- a/llvm/utils/TableGen/TGParser.cpp
+++ b/llvm/utils/TableGen/TGParser.cpp
@@ -636,6 +636,18 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) {
Init *Operator = ParseIDValue(CurRec);
if (Operator == 0) return 0;
+ // If the operator name is present, parse it.
+ std::string OperatorName;
+ if (Lex.getCode() == tgtok::colon) {
+ if (Lex.Lex() != tgtok::VarName) { // eat the ':'
+ TokError("expected variable name in dag operator");
+ return 0;
+ }
+ OperatorName = Lex.getCurStrVal();
+ Lex.Lex(); // eat the VarName.
+ }
+
+
std::vector<std::pair<llvm::Init*, std::string> > DagArgs;
if (Lex.getCode() != tgtok::r_paren) {
DagArgs = ParseDagArgList(CurRec);
@@ -648,7 +660,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) {
}
Lex.Lex(); // eat the ')'
- return new DagInit(Operator, DagArgs);
+ return new DagInit(Operator, OperatorName, DagArgs);
}
case tgtok::XConcat:
case tgtok::XSRA:
OpenPOWER on IntegriCloud