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 | 0e263b7cfc3342b6632c25e8599976a5389020b3 (patch) | |
tree | 510812a4ee134e4dbda6b3f38cdaeab84a82a86f /utils/TableGen/Record.cpp | |
parent | 11b7fa09a96fcb4253c88775aa2af4e59c63f822 (diff) | |
download | external_llvm-0e263b7cfc3342b6632c25e8599976a5389020b3.zip external_llvm-0e263b7cfc3342b6632c25e8599976a5389020b3.tar.gz external_llvm-0e263b7cfc3342b6632c25e8599976a5389020b3.tar.bz2 |
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 e173cae..e2d9657 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]; |