mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-24 09:29:42 +00:00
Move to a private function to initialize the subtarget dependencies
so that we can use initializer lists for the X86Subtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210614 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
75408c8f80
commit
0166af890c
@ -335,6 +335,13 @@ static std::string computeDataLayout(const X86Subtarget &ST) {
|
|||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
X86Subtarget &X86Subtarget::initializeSubtargetDependencies(StringRef CPU,
|
||||||
|
StringRef FS) {
|
||||||
|
initializeEnvironment();
|
||||||
|
resetSubtargetFeatures(CPU, FS);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
||||||
const std::string &FS, X86TargetMachine &TM,
|
const std::string &FS, X86TargetMachine &TM,
|
||||||
unsigned StackAlignOverride)
|
unsigned StackAlignOverride)
|
||||||
@ -346,18 +353,11 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
|||||||
TargetTriple.getEnvironment() != Triple::CODE16),
|
TargetTriple.getEnvironment() != Triple::CODE16),
|
||||||
In16BitMode(TargetTriple.getArch() == Triple::x86 &&
|
In16BitMode(TargetTriple.getArch() == Triple::x86 &&
|
||||||
TargetTriple.getEnvironment() == Triple::CODE16),
|
TargetTriple.getEnvironment() == Triple::CODE16),
|
||||||
DL(computeDataLayout(*this)), TSInfo(DL) {
|
DL(computeDataLayout(*this)), TSInfo(DL),
|
||||||
initializeEnvironment();
|
InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM),
|
||||||
resetSubtargetFeatures(CPU, FS);
|
FrameLowering(TargetFrameLowering::StackGrowsDown, getStackAlignment(),
|
||||||
// Ordering here is important. X86InstrInfo initializes X86RegisterInfo which
|
is64Bit() ? -8 : -4),
|
||||||
// X86TargetLowering needs.
|
JITInfo(hasSSE1()) {}
|
||||||
InstrInfo = make_unique<X86InstrInfo>(*this);
|
|
||||||
TLInfo = make_unique<X86TargetLowering>(TM);
|
|
||||||
FrameLowering =
|
|
||||||
make_unique<X86FrameLowering>(TargetFrameLowering::StackGrowsDown,
|
|
||||||
getStackAlignment(), is64Bit() ? -8 : -4);
|
|
||||||
JITInfo = make_unique<X86JITInfo>(hasSSE1());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
X86Subtarget::enablePostRAScheduler(CodeGenOpt::Level OptLevel,
|
X86Subtarget::enablePostRAScheduler(CodeGenOpt::Level OptLevel,
|
||||||
|
@ -229,10 +229,12 @@ private:
|
|||||||
// Calculates type size & alignment
|
// Calculates type size & alignment
|
||||||
const DataLayout DL;
|
const DataLayout DL;
|
||||||
X86SelectionDAGInfo TSInfo;
|
X86SelectionDAGInfo TSInfo;
|
||||||
std::unique_ptr<X86TargetLowering> TLInfo;
|
// Ordering here is important. X86InstrInfo initializes X86RegisterInfo which
|
||||||
std::unique_ptr<X86InstrInfo> InstrInfo;
|
// X86TargetLowering needs.
|
||||||
std::unique_ptr<X86FrameLowering> FrameLowering;
|
X86InstrInfo InstrInfo;
|
||||||
std::unique_ptr<X86JITInfo> JITInfo;
|
X86TargetLowering TLInfo;
|
||||||
|
X86FrameLowering FrameLowering;
|
||||||
|
X86JITInfo JITInfo;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// This constructor initializes the data members to match that
|
/// This constructor initializes the data members to match that
|
||||||
@ -242,14 +244,12 @@ public:
|
|||||||
const std::string &FS, X86TargetMachine &TM,
|
const std::string &FS, X86TargetMachine &TM,
|
||||||
unsigned StackAlignOverride);
|
unsigned StackAlignOverride);
|
||||||
|
|
||||||
const X86TargetLowering *getTargetLowering() const { return TLInfo.get(); }
|
const X86TargetLowering *getTargetLowering() const { return &TLInfo; }
|
||||||
const X86InstrInfo *getInstrInfo() const { return InstrInfo.get(); }
|
const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
|
||||||
const DataLayout *getDataLayout() const { return &DL; }
|
const DataLayout *getDataLayout() const { return &DL; }
|
||||||
const X86FrameLowering *getFrameLowering() const {
|
const X86FrameLowering *getFrameLowering() const { return &FrameLowering; }
|
||||||
return FrameLowering.get();
|
|
||||||
}
|
|
||||||
const X86SelectionDAGInfo *getSelectionDAGInfo() const { return &TSInfo; }
|
const X86SelectionDAGInfo *getSelectionDAGInfo() const { return &TSInfo; }
|
||||||
X86JITInfo *getJITInfo() { return JITInfo.get(); }
|
X86JITInfo *getJITInfo() { return &JITInfo; }
|
||||||
|
|
||||||
/// getStackAlignment - Returns the minimum alignment known to hold of the
|
/// getStackAlignment - Returns the minimum alignment known to hold of the
|
||||||
/// stack frame on entry to the function and which must be maintained by every
|
/// stack frame on entry to the function and which must be maintained by every
|
||||||
@ -267,6 +267,9 @@ public:
|
|||||||
/// \brief Reset the features for the X86 target.
|
/// \brief Reset the features for the X86 target.
|
||||||
void resetSubtargetFeatures(const MachineFunction *MF) override;
|
void resetSubtargetFeatures(const MachineFunction *MF) override;
|
||||||
private:
|
private:
|
||||||
|
/// \brief Initialize the full set of dependencies so we can use an initializer
|
||||||
|
/// list for X86Subtarget.
|
||||||
|
X86Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
|
||||||
void initializeEnvironment();
|
void initializeEnvironment();
|
||||||
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
void resetSubtargetFeatures(StringRef CPU, StringRef FS);
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user