File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,8 @@ bool CodeEmitterGen::addCodeToMergeInOperand(const Record *R,
142142 }
143143
144144 std::pair<unsigned , unsigned > SO = CGI.Operands .getSubOperandNumber (OpIdx);
145- const std::string EncoderMethodName =
146- CGI.Operands [SO.first ].EncoderMethodNames [SO.second ]. str () ;
145+ StringRef EncoderMethodName =
146+ CGI.Operands [SO.first ].EncoderMethodNames [SO.second ];
147147
148148 if (UseAPInt)
149149 Case += " op.clearAllBits();\n " ;
@@ -152,13 +152,14 @@ bool CodeEmitterGen::addCodeToMergeInOperand(const Record *R,
152152
153153 // If the source operand has a custom encoder, use it.
154154 if (!EncoderMethodName.empty ()) {
155+ raw_string_ostream CaseOS (Case);
156+ CaseOS << indent (6 );
155157 if (UseAPInt) {
156- Case += " " + EncoderMethodName + " (MI, " + utostr (OpIdx);
157- Case += " , op" ;
158+ CaseOS << EncoderMethodName << " (MI, " + utostr (OpIdx) << " , op" ;
158159 } else {
159- Case += " op = " + EncoderMethodName + " (MI, " + utostr (OpIdx);
160+ CaseOS << " op = " << EncoderMethodName << " (MI, " << utostr (OpIdx);
160161 }
161- Case += " , Fixups, STI);\n " ;
162+ CaseOS << " , Fixups, STI);\n " ;
162163 } else {
163164 if (UseAPInt) {
164165 Case +=
You can’t perform that action at this time.
0 commit comments