mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add basic support for integer constants in pattern results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23817 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2ac8510d68
commit
5d5a056092
@ -665,8 +665,15 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) {
|
||||
Args.push_back(Dag->getArgName(i));
|
||||
}
|
||||
}
|
||||
} else if (IntInit *II = dynamic_cast<IntInit*>(Arg)) {
|
||||
TreePatternNode *Node = new TreePatternNode(II);
|
||||
if (!Dag->getArgName(i).empty())
|
||||
error("Constant int argument should not have a name!");
|
||||
Children.push_back(Node);
|
||||
} else {
|
||||
std::cerr << '"';
|
||||
Arg->dump();
|
||||
std::cerr << "\": ";
|
||||
error("Unknown leaf value for tree pattern!");
|
||||
}
|
||||
}
|
||||
@ -1627,6 +1634,13 @@ CodeGenPatternResult(TreePatternNode *N, unsigned &Ctr,
|
||||
<< ");\n";
|
||||
return ResNo;
|
||||
}
|
||||
} else if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
|
||||
unsigned ResNo = Ctr++;
|
||||
OS << " SDOperand Tmp" << ResNo << " = CurDAG->getTargetConstant("
|
||||
<< II->getValue() << ", MVT::"
|
||||
<< getEnumName(N->getType())
|
||||
<< ");\n";
|
||||
return ResNo;
|
||||
}
|
||||
|
||||
N->dump();
|
||||
|
Loading…
Reference in New Issue
Block a user