From f3157be108d680029dcd85953ff38513d471a056 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sat, 9 Aug 2014 04:38:56 +0000 Subject: [PATCH] Remove extraneous 64-bit argument to the PPC TargetMachine constructor and update initialization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215280 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCSubtarget.cpp | 6 ++++-- lib/Target/PowerPC/PPCSubtarget.h | 8 ++++---- lib/Target/PowerPC/PPCTargetMachine.cpp | 8 ++++---- lib/Target/PowerPC/PPCTargetMachine.h | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp index 85b77354de3..1d05fc60d6c 100644 --- a/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/lib/Target/PowerPC/PPCSubtarget.cpp @@ -76,8 +76,10 @@ PPCSubtarget &PPCSubtarget::initializeSubtargetDependencies(StringRef CPU, PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &CPU, const std::string &FS, PPCTargetMachine &TM, - bool is64Bit, CodeGenOpt::Level OptLevel) - : PPCGenSubtargetInfo(TT, CPU, FS), IsPPC64(is64Bit), TargetTriple(TT), + CodeGenOpt::Level OptLevel) + : PPCGenSubtargetInfo(TT, CPU, FS), TargetTriple(TT), + IsPPC64(TargetTriple.getArch() == Triple::ppc64 || + TargetTriple.getArch() == Triple::ppc64le), OptLevel(OptLevel), TargetABI(PPC_ABI_UNKNOWN), FrameLowering(initializeSubtargetDependencies(CPU, FS)), DL(getDataLayoutString(*this)), InstrInfo(*this), JITInfo(*this), diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h index 374962de427..7915e968fa4 100644 --- a/lib/Target/PowerPC/PPCSubtarget.h +++ b/lib/Target/PowerPC/PPCSubtarget.h @@ -66,6 +66,9 @@ class TargetMachine; class PPCSubtarget : public PPCGenSubtargetInfo { protected: + /// TargetTriple - What processor and OS we're targeting. + Triple TargetTriple; + /// stackAlignment - The minimum alignment known to hold of the stack frame on /// entry to the function and which must be maintained by every function. unsigned StackAlignment; @@ -107,9 +110,6 @@ protected: bool IsJITCodeModel; bool IsLittleEndian; - /// TargetTriple - What processor and OS we're targeting. - Triple TargetTriple; - /// OptLevel - What default optimization level we're emitting code for. CodeGenOpt::Level OptLevel; @@ -131,7 +131,7 @@ public: /// of the specified triple. /// PPCSubtarget(const std::string &TT, const std::string &CPU, - const std::string &FS, PPCTargetMachine &TM, bool is64Bit, + const std::string &FS, PPCTargetMachine &TM, CodeGenOpt::Level OptLevel); /// ParseSubtargetFeatures - Parses features string setting specified diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 9563b9045c3..de6dca43a17 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -40,9 +40,9 @@ extern "C" void LLVMInitializePowerPCTarget() { PPCTargetMachine::PPCTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, - CodeGenOpt::Level OL, bool is64Bit) + CodeGenOpt::Level OL) : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), - Subtarget(TT, CPU, FS, *this, is64Bit, OL) { + Subtarget(TT, CPU, FS, *this, OL) { initAsmInfo(); } @@ -53,7 +53,7 @@ PPC32TargetMachine::PPC32TargetMachine(const Target &T, StringRef TT, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL) - : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) { + : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL) { } void PPC64TargetMachine::anchor() { } @@ -63,7 +63,7 @@ PPC64TargetMachine::PPC64TargetMachine(const Target &T, StringRef TT, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL) - : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) { + : PPCTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL) { } diff --git a/lib/Target/PowerPC/PPCTargetMachine.h b/lib/Target/PowerPC/PPCTargetMachine.h index 9bda22a354d..8674efb52e4 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.h +++ b/lib/Target/PowerPC/PPCTargetMachine.h @@ -30,7 +30,7 @@ public: PPCTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, - CodeGenOpt::Level OL, bool is64Bit); + CodeGenOpt::Level OL); const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; } -- 2.34.1