mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Move DataLayout back to the TargetMachine from TargetSubtargetInfo
derived classes. Since global data alignment, layout, and mangling is often based on the DataLayout, move it to the TargetMachine. This ensures that global data is going to be layed out and mangled consistently if the subtarget changes on a per function basis. Prior to this all targets(*) have had subtarget dependent code moved out and onto the TargetMachine. *One target hasn't been migrated as part of this change: R600. The R600 port has, as a subtarget feature, the size of pointers and this affects global data layout. I've currently hacked in a FIXME to enable progress, but the port needs to be updated to either pass the 64-bitness to the TargetMachine, or fix the DataLayout to avoid subtarget dependent features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227113 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -26,32 +26,6 @@ using namespace llvm;
|
||||
|
||||
void SparcSubtarget::anchor() { }
|
||||
|
||||
static std::string computeDataLayout(const SparcSubtarget &ST) {
|
||||
// Sparc is big endian.
|
||||
std::string Ret = "E-m:e";
|
||||
|
||||
// Some ABIs have 32bit pointers.
|
||||
if (!ST.is64Bit())
|
||||
Ret += "-p:32:32";
|
||||
|
||||
// Alignments for 64 bit integers.
|
||||
Ret += "-i64:64";
|
||||
|
||||
// On SparcV9 128 floats are aligned to 128 bits, on others only to 64.
|
||||
// On SparcV9 registers can hold 64 or 32 bits, on others only 32.
|
||||
if (ST.is64Bit())
|
||||
Ret += "-n32:64";
|
||||
else
|
||||
Ret += "-f128:64-n32";
|
||||
|
||||
if (ST.is64Bit())
|
||||
Ret += "-S128";
|
||||
else
|
||||
Ret += "-S64";
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
SparcSubtarget &SparcSubtarget::initializeSubtargetDependencies(StringRef CPU,
|
||||
StringRef FS) {
|
||||
IsV9 = false;
|
||||
@ -79,8 +53,8 @@ SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
|
||||
const std::string &FS, TargetMachine &TM,
|
||||
bool is64Bit)
|
||||
: SparcGenSubtargetInfo(TT, CPU, FS), Is64Bit(is64Bit),
|
||||
DL(computeDataLayout(initializeSubtargetDependencies(CPU, FS))),
|
||||
InstrInfo(*this), TLInfo(TM), TSInfo(DL), FrameLowering(*this) {}
|
||||
InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM),
|
||||
TSInfo(*TM.getDataLayout()), FrameLowering(*this) {}
|
||||
|
||||
int SparcSubtarget::getAdjustedFrameSize(int frameSize) const {
|
||||
|
||||
|
Reference in New Issue
Block a user