[llvm] [PowerPC][AIX] Emit PowerPC version for XCOFF. (PR #95510)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 01:06:57 PDT 2024


================
@@ -135,6 +135,8 @@ class MCAssembler {
   std::vector<std::pair<std::string, size_t>> FileNames;
   // Optional compiler version.
   std::string CompilerVersion;
+  // PPC CPU type.
+  StringRef CPU;
----------------
jh7370 wrote:

I would strongly advise this be a `std::string`, not a `StringRef`. Otherwise, the source of the value must be around in memory for the entire lifetime of this object (or at least as long as the `CPU` member might be referenced). It might come from some constant literal currently, but in the future, that might not be the case.

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


More information about the llvm-commits mailing list