diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-10 22:14:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-10 22:14:13 +0000 |
commit | 91290d7e9a743de363049e705a8303ae1f3a6e68 (patch) | |
tree | d012eb1b18e0fb6cbebba8c6960b33fc5f8b5ee5 /utils/TableGen/InstrSelectorEmitter.cpp | |
parent | fb9ea58eb1ad43b9a82f658230b91b9e5767cba1 (diff) | |
download | external_llvm-91290d7e9a743de363049e705a8303ae1f3a6e68.zip external_llvm-91290d7e9a743de363049e705a8303ae1f3a6e68.tar.gz external_llvm-91290d7e9a743de363049e705a8303ae1f3a6e68.tar.bz2 |
Implement correct parsing, representation, and printing of DAG argument names
Implements testcase TableGen/TreeNames.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/InstrSelectorEmitter.cpp')
-rw-r--r-- | utils/TableGen/InstrSelectorEmitter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/utils/TableGen/InstrSelectorEmitter.cpp b/utils/TableGen/InstrSelectorEmitter.cpp index f0b3ca1..9eb3be7 100644 --- a/utils/TableGen/InstrSelectorEmitter.cpp +++ b/utils/TableGen/InstrSelectorEmitter.cpp @@ -172,15 +172,14 @@ MVT::ValueType Pattern::getIntrinsicType(Record *R) const { TreePatternNode *Pattern::ParseTreePattern(DagInit *DI) { Record *Operator = DI->getNodeType(); - const std::vector<Init*> &Args = DI->getArgs(); if (Operator->isSubClassOf("ValueType")) { // If the operator is a ValueType, then this must be "type cast" of a leaf // node. - if (Args.size() != 1) + if (DI->getNumArgs() != 1) error("Type cast only valid for a leaf node!"); - Init *Arg = Args[0]; + Init *Arg = DI->getArg(0); TreePatternNode *New; if (DefInit *DI = dynamic_cast<DefInit*>(Arg)) { New = new TreePatternNode(DI); @@ -201,8 +200,8 @@ TreePatternNode *Pattern::ParseTreePattern(DagInit *DI) { std::vector<TreePatternNode*> Children; - for (unsigned i = 0, e = Args.size(); i != e; ++i) { - Init *Arg = Args[i]; + for (unsigned i = 0, e = DI->getNumArgs(); i != e; ++i) { + Init *Arg = DI->getArg(i); if (DagInit *DI = dynamic_cast<DagInit*>(Arg)) { Children.push_back(ParseTreePattern(DI)); } else if (DefInit *DI = dynamic_cast<DefInit*>(Arg)) { |