fix a tblgen bug that Evan ran into, where we would lose the '$src' name

on patterns like "(set R32:$dst, (i32 imm:$src))"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-11-16 23:14:54 +00:00
parent 7a12537843
commit 12cf9090a4

View File

@ -631,9 +631,7 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) {
if (R->isSubClassOf("SDNode") || R->isSubClassOf("PatFrag")) {
Dag->setArg(0, new DagInit(R,
std::vector<std::pair<Init*, std::string> >()));
TreePatternNode *TPN = ParseTreePattern(Dag);
TPN->setName(Dag->getArgName(0));
return TPN;
return ParseTreePattern(Dag);
}
New = new TreePatternNode(DI);
@ -651,6 +649,7 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) {
// Apply the type cast.
New->UpdateNodeType(getValueType(Operator), *this);
New->setName(Dag->getArgName(0));
return New;
}
@ -672,7 +671,8 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) {
Init *Arg = Dag->getArg(i);
if (DagInit *DI = dynamic_cast<DagInit*>(Arg)) {
Children.push_back(ParseTreePattern(DI));
Children.back()->setName(Dag->getArgName(i));
if (Children.back()->getName().empty())
Children.back()->setName(Dag->getArgName(i));
} else if (DefInit *DefI = dynamic_cast<DefInit*>(Arg)) {
Record *R = DefI->getDef();
// Direct reference to a leaf DagNode or PatFrag? Turn it into a