From 7cee81703de8333d457ec9e560b0537b71df5a48 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Thu, 19 Mar 2009 05:21:56 +0000 Subject: 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 --- utils/TableGen/Record.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utils/TableGen/Record.cpp') 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]; -- cgit v1.2.3