@@ -653,24 +653,24 @@ void CompressInstEmitter::emitCompressInstEmitter(raw_ostream &OS,
653653 .str ()
654654 : " " ;
655655
656- for (auto &CompressPat : CompressPatterns) {
656+ for (const auto &CompressPat : CompressPatterns) {
657657 if (EType == EmitterType::Uncompress && CompressPat.IsCompressOnly )
658658 continue ;
659659
660660 std::string CondString;
661661 std::string CodeString;
662662 raw_string_ostream CondStream (CondString);
663663 raw_string_ostream CodeStream (CodeString);
664- CodeGenInstruction &Source =
664+ const CodeGenInstruction &Source =
665665 CompressOrCheck ? CompressPat.Source : CompressPat.Dest ;
666- CodeGenInstruction &Dest =
666+ const CodeGenInstruction &Dest =
667667 CompressOrCheck ? CompressPat.Dest : CompressPat.Source ;
668- IndexedMap<OpData> SourceOperandMap = CompressOrCheck
669- ? CompressPat.SourceOperandMap
670- : CompressPat.DestOperandMap ;
671- IndexedMap<OpData> &DestOperandMap = CompressOrCheck
672- ? CompressPat.DestOperandMap
673- : CompressPat.SourceOperandMap ;
668+ const IndexedMap<OpData> & SourceOperandMap =
669+ CompressOrCheck ? CompressPat.SourceOperandMap
670+ : CompressPat.DestOperandMap ;
671+ const IndexedMap<OpData> &DestOperandMap =
672+ CompressOrCheck ? CompressPat.DestOperandMap
673+ : CompressPat.SourceOperandMap ;
674674
675675 CurOp = Source.TheDef ->getName ();
676676 // Check current and previous opcode to decide to continue or end a case.
0 commit comments