diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-03-19 05:21:56 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-03-19 05:21:56 +0000 |
commit | 7cee81703de8333d457ec9e560b0537b71df5a48 (patch) | |
tree | 510812a4ee134e4dbda6b3f38cdaeab84a82a86f /utils/TableGen/Record.cpp | |
parent | b53db4fb321823a8a1f6abc372bdc7c36ef1447f (diff) | |
download | llvm-7cee81703de8333d457ec9e560b0537b71df5a48.tar.gz llvm-7cee81703de8333d457ec9e560b0537b71df5a48.tar.bz2 llvm-7cee81703de8333d457ec9e560b0537b71df5a48.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.cpp')
-rw-r--r-- | utils/TableGen/Record.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index e173cae1bd..e2d9657c4d 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -426,7 +426,7 @@ Init *BinOpInit::Fold() { Args.push_back(RHSs->getArg(i)); ArgNames.push_back(RHSs->getArgName(i)); } - return new DagInit(LHSs->getOperator(), Args, ArgNames); + return new DagInit(LHSs->getOperator(), "", Args, ArgNames); } break; } @@ -679,7 +679,7 @@ Init *DagInit::resolveReferences(Record &R, const RecordVal *RV) { Init *Op = Val->resolveReferences(R, RV); if (Args != NewArgs || Op != Val) - return new DagInit(Op, NewArgs, ArgNames); + return new DagInit(Op, "", NewArgs, ArgNames); return this; } @@ -687,6 +687,8 @@ Init *DagInit::resolveReferences(Record &R, const RecordVal *RV) { std::string DagInit::getAsString() const { std::string Result = "(" + Val->getAsString(); + if (!ValName.empty()) + Result += ":" + ValName; if (Args.size()) { Result += " " + Args[0]->getAsString(); if (!ArgNames[0].empty()) Result += ":$" + ArgNames[0]; |