1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Targets should configure themselves based on a Module, not some wierd flags

llvm-svn: 8132
This commit is contained in:
Chris Lattner 2003-08-24 19:49:48 +00:00
parent 90253d18b1
commit f31d84d7c5
3 changed files with 12 additions and 12 deletions

View File

@ -61,7 +61,7 @@ static cl::opt<bool> DumpInput("dump-input",
// that implements the Sparc backend. (the llvm/CodeGen/Sparc.h interface)
//----------------------------------------------------------------------------
TargetMachine *allocateSparcTargetMachine(unsigned Configuration) {
TargetMachine *allocateSparcTargetMachine(const Module &M) {
return new UltraSparc();
}

View File

@ -6,6 +6,7 @@
#include "X86TargetMachine.h"
#include "X86.h"
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetMachineImpls.h"
#include "llvm/CodeGen/MachineFunction.h"
@ -13,7 +14,6 @@
#include "llvm/Transforms/Scalar.h"
#include "Support/CommandLine.h"
#include "Support/Statistic.h"
#include <iostream>
namespace {
cl::opt<bool> NoLocalRA("disable-local-ra",
@ -27,21 +27,21 @@ namespace {
// allocateX86TargetMachine - Allocate and return a subclass of TargetMachine
// that implements the X86 backend.
//
TargetMachine *allocateX86TargetMachine(unsigned Configuration) {
return new X86TargetMachine(Configuration);
TargetMachine *allocateX86TargetMachine(const Module &M) {
return new X86TargetMachine(M);
}
/// X86TargetMachine ctor - Create an ILP32 architecture model
///
X86TargetMachine::X86TargetMachine(unsigned Config)
X86TargetMachine::X86TargetMachine(const Module &M)
: TargetMachine("X86",
(Config & TM::EndianMask) == TM::LittleEndian,
(Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4,
(Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4,
(Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4,
4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) {
M.getEndianness() != Module::BigEndian,
M.getPointerSize() != Module::Pointer64 ? 4 : 8,
M.getPointerSize() != Module::Pointer64 ? 4 : 8,
M.getPointerSize() != Module::Pointer64 ? 4 : 8,
4, M.getPointerSize() != Module::Pointer64 ? 4 : 8),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) {
}

View File

@ -16,7 +16,7 @@ class X86TargetMachine : public TargetMachine {
X86InstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
public:
X86TargetMachine(unsigned Configuration);
X86TargetMachine(const Module &M);
virtual const X86InstrInfo &getInstrInfo() const { return InstrInfo; }
virtual const TargetFrameInfo &getFrameInfo() const { return FrameInfo; }