Skip to content

Commit 761b56e

Browse files
authored
PPC: Remove TargetTriple from PPCSubtarget (#157404)
This already exists in the base class.
1 parent a103b9b commit 761b56e

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

llvm/lib/Target/PowerPC/PPCSubtarget.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ PPCSubtarget &PPCSubtarget::initializeSubtargetDependencies(StringRef CPU,
5555
PPCSubtarget::PPCSubtarget(const Triple &TT, const std::string &CPU,
5656
const std::string &TuneCPU, const std::string &FS,
5757
const PPCTargetMachine &TM)
58-
: PPCGenSubtargetInfo(TT, CPU, TuneCPU, FS), TargetTriple(TT),
59-
IsPPC64(TargetTriple.getArch() == Triple::ppc64 ||
60-
TargetTriple.getArch() == Triple::ppc64le),
58+
: PPCGenSubtargetInfo(TT, CPU, TuneCPU, FS),
59+
IsPPC64(getTargetTriple().getArch() == Triple::ppc64 ||
60+
getTargetTriple().getArch() == Triple::ppc64le),
6161
TM(TM), FrameLowering(initializeSubtargetDependencies(CPU, TuneCPU, FS)),
6262
InstrInfo(*this), TLInfo(TM, *this) {
6363
TSInfo = std::make_unique<PPCSelectionDAGInfo>();
@@ -87,10 +87,10 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
8787
// Determine default and user specified characteristics
8888
std::string CPUName = std::string(CPU);
8989
if (CPUName.empty() || CPU == "generic") {
90-
if (TargetTriple.getSubArch() == Triple::PPCSubArch_spe)
90+
if (getTargetTriple().getSubArch() == Triple::PPCSubArch_spe)
9191
CPUName = "e500";
9292
else
93-
CPUName = std::string(PPC::getNormalizedPPCTargetCPU(TargetTriple));
93+
CPUName = std::string(PPC::getNormalizedPPCTargetCPU(getTargetTriple()));
9494
}
9595

9696
// Determine the CPU to schedule for.
@@ -107,7 +107,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
107107
if (IsPPC64 && has64BitSupport())
108108
Use64BitRegs = true;
109109

110-
if (TargetTriple.isPPC32SecurePlt())
110+
if (getTargetTriple().isPPC32SecurePlt())
111111
IsSecurePlt = true;
112112

113113
if (HasSPE && IsPPC64)
@@ -126,7 +126,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
126126
IsLittleEndian = TM.isLittleEndian();
127127

128128
if (HasAIXSmallLocalExecTLS || HasAIXSmallLocalDynamicTLS) {
129-
if (!TargetTriple.isOSAIX() || !IsPPC64)
129+
if (!getTargetTriple().isOSAIX() || !IsPPC64)
130130
report_fatal_error("The aix-small-local-[exec|dynamic]-tls attribute is "
131131
"only supported on AIX in "
132132
"64-bit mode.\n",
@@ -143,7 +143,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
143143
false);
144144
}
145145

146-
if (HasAIXShLibTLSModelOpt && (!TargetTriple.isOSAIX() || !IsPPC64))
146+
if (HasAIXShLibTLSModelOpt && (!getTargetTriple().isOSAIX() || !IsPPC64))
147147
report_fatal_error("The aix-shared-lib-tls-model-opt attribute "
148148
"is only supported on AIX in 64-bit mode.\n",
149149
false);

llvm/lib/Target/PowerPC/PPCSubtarget.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ class PPCSubtarget : public PPCGenSubtargetInfo {
7878
};
7979

8080
protected:
81-
/// TargetTriple - What processor and OS we're targeting.
82-
Triple TargetTriple;
83-
8481
/// stackAlignment - The minimum alignment known to hold of the stack frame on
8582
/// entry to the function and which must be maintained by every function.
8683
Align StackAlignment;
@@ -210,13 +207,11 @@ class PPCSubtarget : public PPCGenSubtargetInfo {
210207

211208
POPCNTDKind hasPOPCNTD() const { return HasPOPCNTD; }
212209

213-
const Triple &getTargetTriple() const { return TargetTriple; }
214-
215-
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
216-
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
217-
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
210+
bool isTargetELF() const { return getTargetTriple().isOSBinFormatELF(); }
211+
bool isTargetMachO() const { return getTargetTriple().isOSBinFormatMachO(); }
212+
bool isTargetLinux() const { return getTargetTriple().isOSLinux(); }
218213

219-
bool isAIXABI() const { return TargetTriple.isOSAIX(); }
214+
bool isAIXABI() const { return getTargetTriple().isOSAIX(); }
220215
bool isSVR4ABI() const { return !isAIXABI(); }
221216
bool isELFv2ABI() const;
222217

0 commit comments

Comments
 (0)