[llvm-branch-commits] [llvm] PPC: Use StringRef for subtarget constructor arguments (PR #157409)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 8 02:43:51 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-powerpc
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/157409.diff
2 Files Affected:
- (modified) llvm/lib/Target/PowerPC/PPCSubtarget.cpp (+2-3)
- (modified) llvm/lib/Target/PowerPC/PPCSubtarget.h (+1-2)
``````````diff
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
index 5f80929e86f99..736ba1edcaea6 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -52,9 +52,8 @@ PPCSubtarget &PPCSubtarget::initializeSubtargetDependencies(StringRef CPU,
return *this;
}
-PPCSubtarget::PPCSubtarget(const Triple &TT, const std::string &CPU,
- const std::string &TuneCPU, const std::string &FS,
- const PPCTargetMachine &TM)
+PPCSubtarget::PPCSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU,
+ StringRef FS, const PPCTargetMachine &TM)
: PPCGenSubtargetInfo(TT, CPU, TuneCPU, FS),
IsPPC64(getTargetTriple().getArch() == Triple::ppc64 ||
getTargetTriple().getArch() == Triple::ppc64le),
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.h b/llvm/lib/Target/PowerPC/PPCSubtarget.h
index 17d9d2ab402be..c17fca7f70a3c 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.h
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.h
@@ -116,8 +116,7 @@ class PPCSubtarget : public PPCGenSubtargetInfo {
/// This constructor initializes the data members to match that
/// of the specified triple.
///
- PPCSubtarget(const Triple &TT, const std::string &CPU,
- const std::string &TuneCPU, const std::string &FS,
+ PPCSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS,
const PPCTargetMachine &TM);
~PPCSubtarget() override;
``````````
</details>
https://github.com/llvm/llvm-project/pull/157409
More information about the llvm-branch-commits
mailing list