Skip to content

Commit 2f2a98b

Browse files
authored
Sparc: Remove TargetTriple member from SparcSubtarget (llvm#157397)
1 parent 8cc77e7 commit 2f2a98b

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

llvm/lib/Target/Sparc/SparcISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3510,7 +3510,7 @@ void SparcTargetLowering::ReplaceNodeResults(SDNode *N,
35103510

35113511
// Override to enable LOAD_STACK_GUARD lowering on Linux.
35123512
bool SparcTargetLowering::useLoadStackGuardNode(const Module &M) const {
3513-
if (!Subtarget->isTargetLinux())
3513+
if (!Subtarget->getTargetTriple().isOSLinux())
35143514
return TargetLowering::useLoadStackGuardNode(M);
35153515
return true;
35163516
}

llvm/lib/Target/Sparc/SparcInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ unsigned SparcInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
643643
bool SparcInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
644644
switch (MI.getOpcode()) {
645645
case TargetOpcode::LOAD_STACK_GUARD: {
646-
assert(Subtarget.isTargetLinux() &&
646+
assert(Subtarget.getTargetTriple().isOSLinux() &&
647647
"Only Linux target is expected to contain LOAD_STACK_GUARD");
648648
// offsetof(tcbhead_t, stack_guard) from sysdeps/sparc/nptl/tls.h in glibc.
649649
const int64_t Offset = Subtarget.is64Bit() ? 0x28 : 0x14;

llvm/lib/Target/Sparc/SparcSubtarget.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ SparcSubtarget::SparcSubtarget(const StringRef &CPU, const StringRef &TuneCPU,
5050
const StringRef &FS, const TargetMachine &TM,
5151
bool is64Bit)
5252
: SparcGenSubtargetInfo(TM.getTargetTriple(), CPU, TuneCPU, FS),
53-
ReserveRegister(TM.getMCRegisterInfo()->getNumRegs()),
54-
TargetTriple(TM.getTargetTriple()), Is64Bit(is64Bit),
53+
ReserveRegister(TM.getMCRegisterInfo()->getNumRegs()), Is64Bit(is64Bit),
5554
InstrInfo(initializeSubtargetDependencies(CPU, TuneCPU, FS)),
5655
TLInfo(TM, *this), FrameLowering(*this) {
5756
TSInfo = std::make_unique<SparcSelectionDAGInfo>();

llvm/lib/Target/Sparc/SparcSubtarget.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class SparcSubtarget : public SparcGenSubtargetInfo {
3434
// register.
3535
BitVector ReserveRegister;
3636

37-
Triple TargetTriple;
3837
virtual void anchor();
3938

4039
bool Is64Bit;
@@ -96,8 +95,6 @@ class SparcSubtarget : public SparcGenSubtargetInfo {
9695
/// returns adjusted framesize which includes space for register window
9796
/// spills and arguments.
9897
int getAdjustedFrameSize(int stackSize) const;
99-
100-
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
10198
};
10299

103100
} // end namespace llvm

0 commit comments

Comments
 (0)