@@ -1990,7 +1990,8 @@ static unsigned GetNumNodeResults(const Record *Operator,
19901990 }
19911991
19921992 if (Operator->isSubClassOf (" Instruction" )) {
1993- CodeGenInstruction &InstInfo = CDP.getTargetInfo ().getInstruction (Operator);
1993+ const CodeGenInstruction &InstInfo =
1994+ CDP.getTargetInfo ().getInstruction (Operator);
19941995
19951996 unsigned NumDefsToAdd = InstInfo.Operands .NumDefs ;
19961997
@@ -2657,7 +2658,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
26572658
26582659 if (getOperator ()->isSubClassOf (" Instruction" )) {
26592660 const DAGInstruction &Inst = CDP.getInstruction (getOperator ());
2660- CodeGenInstruction &InstInfo =
2661+ const CodeGenInstruction &InstInfo =
26612662 CDP.getTargetInfo ().getInstruction (getOperator ());
26622663
26632664 bool MadeChange = false ;
@@ -3871,7 +3872,7 @@ static void getInstructionsInTree(TreePatternNode &Tree,
38713872
38723873// / Check the class of a pattern leaf node against the instruction operand it
38733874// / represents.
3874- static bool checkOperandClass (CGIOperandList::OperandInfo &OI,
3875+ static bool checkOperandClass (const CGIOperandList::OperandInfo &OI,
38753876 const Record *Leaf) {
38763877 if (OI.Rec == Leaf)
38773878 return true ;
@@ -3888,7 +3889,7 @@ static bool checkOperandClass(CGIOperandList::OperandInfo &OI,
38883889 return false ;
38893890}
38903891
3891- void CodeGenDAGPatterns::parseInstructionPattern (CodeGenInstruction &CGI,
3892+ void CodeGenDAGPatterns::parseInstructionPattern (const CodeGenInstruction &CGI,
38923893 const ListInit *Pat,
38933894 DAGInstMap &DAGInsts) {
38943895
@@ -3987,7 +3988,7 @@ void CodeGenDAGPatterns::parseInstructionPattern(CodeGenInstruction &CGI,
39873988 std::vector<TreePatternNodePtr> ResultNodeOperands;
39883989 std::vector<const Record *> Operands;
39893990 for (unsigned i = NumResults, e = CGI.Operands .size (); i != e; ++i) {
3990- CGIOperandList::OperandInfo &Op = CGI.Operands [i];
3991+ const CGIOperandList::OperandInfo &Op = CGI.Operands [i];
39913992 StringRef OpName = Op.Name ;
39923993 if (OpName.empty ()) {
39933994 I.error (" Operand #" + Twine (i) + " in operands list has no name!" );
@@ -4093,7 +4094,7 @@ void CodeGenDAGPatterns::ParseInstructions() {
40934094 std::vector<const Record *> Results;
40944095 std::vector<const Record *> Operands;
40954096
4096- CodeGenInstruction &InstInfo = Target.getInstruction (Instr);
4097+ const CodeGenInstruction &InstInfo = Target.getInstruction (Instr);
40974098
40984099 if (InstInfo.Operands .size () != 0 ) {
40994100 for (unsigned j = 0 , e = InstInfo.Operands .NumDefs ; j < e; ++j)
@@ -4112,7 +4113,7 @@ void CodeGenDAGPatterns::ParseInstructions() {
41124113 continue ; // no pattern.
41134114 }
41144115
4115- CodeGenInstruction &CGI = Target.getInstruction (Instr);
4116+ const CodeGenInstruction &CGI = Target.getInstruction (Instr);
41164117 parseInstructionPattern (CGI, LI, Instructions);
41174118 }
41184119
0 commit comments