[llvm] [AMDGPU] Support SIProgramInfo MCExpr for comments and remarks (PR #94350)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 05:59:50 PDT 2024


================
@@ -400,28 +400,27 @@ void AMDGPUAsmPrinter::emitCommonFunctionComments(
                               false);
 }
 
-std::string AMDGPUAsmPrinter::getMCExprStr(const MCExpr *Value) {
-  std::string Str;
-  raw_string_ostream OSS(Str);
+StringRef AMDGPUAsmPrinter::getMCExprStr(const MCExpr *Value) {
----------------
arsenm wrote:

You can't return this StringRef references to the local SmallString. You have to return the SmallString 

https://github.com/llvm/llvm-project/pull/94350


More information about the llvm-commits mailing list