diff --git a/llvm/utils/TableGen/Common/CodeGenInstruction.cpp b/llvm/utils/TableGen/Common/CodeGenInstruction.cpp index 0dfcf200d7e4b..2ec3683e116e9 100644 --- a/llvm/utils/TableGen/Common/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/Common/CodeGenInstruction.cpp @@ -435,7 +435,7 @@ void CGIOperandList::ProcessDisableEncoding(StringRef DisableEncoding) { CodeGenInstruction::CodeGenInstruction(const Record *R) : TheDef(R), Operands(R), InferredFrom(nullptr) { Namespace = R->getValueAsString("Namespace"); - AsmString = R->getValueAsString("AsmString").str(); + AsmString = R->getValueAsString("AsmString"); isPreISelOpcode = R->getValueAsBit("isPreISelOpcode"); isReturn = R->getValueAsBit("isReturn"); diff --git a/llvm/utils/TableGen/Common/CodeGenInstruction.h b/llvm/utils/TableGen/Common/CodeGenInstruction.h index 3a5abc55319b1..0db12b551b437 100644 --- a/llvm/utils/TableGen/Common/CodeGenInstruction.h +++ b/llvm/utils/TableGen/Common/CodeGenInstruction.h @@ -226,7 +226,7 @@ class CodeGenInstruction { /// AsmString - The format string used to emit a .s file for the /// instruction. - std::string AsmString; + StringRef AsmString; /// Operands - This is information about the (ins) and (outs) list specified /// to the instruction.