summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/DAGISelMatcherGen.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-07-29 19:07:05 +0000
committerDavid Greene <greened@obbligato.org>2011-07-29 19:07:05 +0000
commit1aa0e3e1185d80c9767c71253d83e5f23c3a4973 (patch)
treead334e7b81f3d18436329784f8937d82caf8c888 /llvm/utils/TableGen/DAGISelMatcherGen.cpp
parentcdd64328c7a794c3229aba52e4b5a55cb8400adc (diff)
downloadbcm5719-llvm-1aa0e3e1185d80c9767c71253d83e5f23c3a4973.tar.gz
bcm5719-llvm-1aa0e3e1185d80c9767c71253d83e5f23c3a4973.zip
[AVX] Constify Inits
Make references to Inits const everywhere. This is the final step before making them unique. llvm-svn: 136485
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherGen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index c5897c72d36..7e66c05a934 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -203,7 +203,7 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
assert(N->isLeaf() && "Not a leaf?");
// Direct match against an integer constant.
- if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
+ if (const IntInit *II = dynamic_cast<const IntInit*>(N->getLeafValue())) {
// If this is the root of the dag we're matching, we emit a redundant opcode
// check to ensure that this gets folded into the normal top-level
// OpcodeSwitch.
@@ -215,7 +215,7 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
return AddMatcher(new CheckIntegerMatcher(II->getValue()));
}
- DefInit *DI = dynamic_cast<DefInit*>(N->getLeafValue());
+ const DefInit *DI = dynamic_cast<const DefInit*>(N->getLeafValue());
if (DI == 0) {
errs() << "Unknown leaf kind: " << *DI << "\n";
abort();
@@ -283,7 +283,7 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N,
N->getOperator()->getName() == "or") &&
N->getChild(1)->isLeaf() && N->getChild(1)->getPredicateFns().empty() &&
N->getPredicateFns().empty()) {
- if (IntInit *II = dynamic_cast<IntInit*>(N->getChild(1)->getLeafValue())) {
+ if (const IntInit *II = dynamic_cast<const IntInit*>(N->getChild(1)->getLeafValue())) {
if (!isPowerOf2_32(II->getValue())) { // Don't bother with single bits.
// If this is at the root of the pattern, we emit a redundant
// CheckOpcode so that the following checks get factored properly under
@@ -496,7 +496,7 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {
--RecNodeEntry; // Entries in VariableMap are biased.
const ComplexPattern &CP =
- CGP.getComplexPattern(((DefInit*)N->getLeafValue())->getDef());
+ CGP.getComplexPattern(((const DefInit*)N->getLeafValue())->getDef());
// Emit a CheckComplexPat operation, which does the match (aborting if it
// fails) and pushes the matched operands onto the recorded nodes list.
@@ -572,14 +572,14 @@ void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode *N,
SmallVectorImpl<unsigned> &ResultOps) {
assert(N->isLeaf() && "Must be a leaf");
- if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
+ if (const IntInit *II = dynamic_cast<const IntInit*>(N->getLeafValue())) {
AddMatcher(new EmitIntegerMatcher(II->getValue(), N->getType(0)));
ResultOps.push_back(NextRecordedOperandNo++);
return;
}
// If this is an explicit register reference, handle it.
- if (DefInit *DI = dynamic_cast<DefInit*>(N->getLeafValue())) {
+ if (const DefInit *DI = dynamic_cast<const DefInit*>(N->getLeafValue())) {
Record *Def = DI->getDef();
if (Def->isSubClassOf("Register")) {
const CodeGenRegister *Reg =
OpenPOWER on IntegriCloud