summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2009-03-19 05:21:56 +0000
committerNate Begeman <natebegeman@mac.com>2009-03-19 05:21:56 +0000
commitdbe3f77f5bfa4e580ddddc85b5afa3bb5a29a921 (patch)
tree2665bfbf970b06c7360f224a7ffb21f1da4e1fcb /llvm/utils/TableGen/TGParser.cpp
parent113d8c9c1c0d539678bbbe45b7dbaeed47726ce3 (diff)
downloadbcm5719-llvm-dbe3f77f5bfa4e580ddddc85b5afa3bb5a29a921.tar.gz
bcm5719-llvm-dbe3f77f5bfa4e580ddddc85b5afa3bb5a29a921.zip
Add support to tablegen for naming the nodes themselves, not just the operands,
in selectiondag patterns. This is required for the upcoming shuffle_vector rewrite, and as it turns out, cleans up a hack in the Alpha instruction info. llvm-svn: 67286
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