Move the target machine variable so that it's initialized early
authorEric Christopher <echristo@gmail.com>
Fri, 13 Feb 2015 22:48:51 +0000 (22:48 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 13 Feb 2015 22:48:51 +0000 (22:48 +0000)
enough we can use it to initialize frame lowering.

llvm-svn: 229168

llvm/lib/Target/PowerPC/PPCSubtarget.cpp
llvm/lib/Target/PowerPC/PPCSubtarget.h

index 0bda665..6f70218 100644 (file)
@@ -49,9 +49,9 @@ PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &CPU,
     : PPCGenSubtargetInfo(TT, CPU, FS), TargetTriple(TT),
       IsPPC64(TargetTriple.getArch() == Triple::ppc64 ||
               TargetTriple.getArch() == Triple::ppc64le),
-      TargetABI(PPC_ABI_UNKNOWN),
+      TargetABI(PPC_ABI_UNKNOWN), TM(TM),
       FrameLowering(initializeSubtargetDependencies(CPU, FS)), InstrInfo(*this),
-      TLInfo(TM, *this), TSInfo(TM.getDataLayout()), TM(TM) {}
+      TLInfo(TM, *this), TSInfo(TM.getDataLayout()) {}
 
 void PPCSubtarget::initializeEnvironment() {
   StackAlignment = 16;
index ed1e9ac..ce17c1e 100644 (file)
@@ -119,12 +119,11 @@ protected:
     PPC_ABI_ELFv1,
     PPC_ABI_ELFv2
   } TargetABI;
-
+  const PPCTargetMachine &TM;
   PPCFrameLowering FrameLowering;
   PPCInstrInfo InstrInfo;
   PPCTargetLowering TLInfo;
   PPCSelectionDAGInfo TSInfo;
-  const PPCTargetMachine &TM;
 
 public:
   /// This constructor initializes the data members to match that