From 0907cdbbd4f0c408da9d36640de639c01dcb0605 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 16 Jun 2025 14:48:36 -0700 Subject: [PATCH] [LLVM][TableGen] Use `StringRef` for CodeGenInstruction::AsmString --- llvm/utils/TableGen/Common/CodeGenInstruction.cpp | 2 +- llvm/utils/TableGen/Common/CodeGenInstruction.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.