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

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

llvm-svn: 24383
This commit is contained in:
Chris Lattner 2005-11-16 23:14:54 +00:00
parent 5930d3df3d
commit b22950df6c
1 changed files with 4 additions and 4 deletions

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