@@ -272,7 +272,7 @@ struct OperandsSignature {
272
272
DefInit *OpDI = dyn_cast<DefInit>(Op.getLeafValue ());
273
273
if (!OpDI)
274
274
return false ;
275
- Record *OpLeafRec = OpDI->getDef ();
275
+ const Record *OpLeafRec = OpDI->getDef ();
276
276
277
277
// For now, the only other thing we accept is register operands.
278
278
const CodeGenRegisterClass *RC = nullptr ;
@@ -407,7 +407,7 @@ class FastISelMap {
407
407
public:
408
408
explicit FastISelMap (StringRef InstNS);
409
409
410
- void collectPatterns (CodeGenDAGPatterns &CGP);
410
+ void collectPatterns (const CodeGenDAGPatterns &CGP);
411
411
void printImmediatePredicates (raw_ostream &OS);
412
412
void printFunctionDefinitions (raw_ostream &OS);
413
413
@@ -417,7 +417,8 @@ class FastISelMap {
417
417
};
418
418
} // End anonymous namespace
419
419
420
- static std::string getOpcodeName (const Record *Op, CodeGenDAGPatterns &CGP) {
420
+ static std::string getOpcodeName (const Record *Op,
421
+ const CodeGenDAGPatterns &CGP) {
421
422
return std::string (CGP.getSDNodeInfo (Op).getEnumName ());
422
423
}
423
424
@@ -437,7 +438,7 @@ static std::string PhyRegForNode(TreePatternNode &Op,
437
438
if (!Op.isLeaf ())
438
439
return PhysReg;
439
440
440
- Record *OpLeafRec = cast<DefInit>(Op.getLeafValue ())->getDef ();
441
+ const Record *OpLeafRec = cast<DefInit>(Op.getLeafValue ())->getDef ();
441
442
if (!OpLeafRec->isSubClassOf (" Register" ))
442
443
return PhysReg;
443
444
@@ -448,7 +449,7 @@ static std::string PhyRegForNode(TreePatternNode &Op,
448
449
return PhysReg;
449
450
}
450
451
451
- void FastISelMap::collectPatterns (CodeGenDAGPatterns &CGP) {
452
+ void FastISelMap::collectPatterns (const CodeGenDAGPatterns &CGP) {
452
453
const CodeGenTarget &Target = CGP.getTargetInfo ();
453
454
454
455
// Scan through all the patterns and record the simple ones.
@@ -864,8 +865,8 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) {
864
865
// TODO: SignaturesWithConstantForms should be empty here.
865
866
}
866
867
867
- static void EmitFastISel (RecordKeeper &RK, raw_ostream &OS) {
868
- CodeGenDAGPatterns CGP (RK);
868
+ static void EmitFastISel (const RecordKeeper &RK, raw_ostream &OS) {
869
+ const CodeGenDAGPatterns CGP (RK);
869
870
const CodeGenTarget &Target = CGP.getTargetInfo ();
870
871
emitSourceFileHeader (" \" Fast\" Instruction Selector for the " +
871
872
Target.getName ().str () + " target" ,
0 commit comments