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.h | |
parent | b53db4fb321823a8a1f6abc372bdc7c36ef1447f (diff) | |
download | external_llvm-7cee81703de8333d457ec9e560b0537b71df5a48.zip external_llvm-7cee81703de8333d457ec9e560b0537b71df5a48.tar.gz external_llvm-7cee81703de8333d457ec9e560b0537b71df5a48.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.h')
-rw-r--r-- | utils/TableGen/Record.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 3b2141c..32172ef 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -857,11 +857,13 @@ public: /// class DagInit : public Init { Init *Val; + std::string ValName; std::vector<Init*> Args; std::vector<std::string> ArgNames; public: - DagInit(Init *V, const std::vector<std::pair<Init*, std::string> > &args) - : Val(V) { + DagInit(Init *V, std::string VN, + const std::vector<std::pair<Init*, std::string> > &args) + : Val(V), ValName(VN) { Args.reserve(args.size()); ArgNames.reserve(args.size()); for (unsigned i = 0, e = args.size(); i != e; ++i) { @@ -869,9 +871,9 @@ public: ArgNames.push_back(args[i].second); } } - DagInit(Init *V, const std::vector<Init*> &args, + DagInit(Init *V, std::string VN, const std::vector<Init*> &args, const std::vector<std::string> &argNames) - : Val(V), Args(args), ArgNames(argNames) { + : Val(V), ValName(VN), Args(args), ArgNames(argNames) { } virtual Init *convertInitializerTo(RecTy *Ty) { @@ -880,6 +882,8 @@ public: Init *getOperator() const { return Val; } + const std::string &getName() const { return ValName; } + unsigned getNumArgs() const { return Args.size(); } Init *getArg(unsigned Num) const { assert(Num < Args.size() && "Arg number out of range!"); |