[llvm] [LLVM][TableGen] Use `StringRef` for CodeGenInstruction::AsmString (PR #144440)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 16 14:50:19 PDT 2025
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/144440
None
>From 0907cdbbd4f0c408da9d36640de639c01dcb0605 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
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.
More information about the llvm-commits
mailing list