[llvm-commits] [llvm] r77927 - in /llvm/trunk: include/llvm/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/Blackfin/ lib/Target/CBackend/ lib/Target/CellSPU/ lib/Target/CppBackend/ lib/Target/MSIL/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/
Daniel Dunbar
daniel at zuster.org
Sun Aug 2 16:37:14 PDT 2009
Author: ddunbar
Date: Sun Aug 2 18:37:13 2009
New Revision: 77927
URL: http://llvm.org/viewvc/llvm-project?rev=77927&view=rev
Log:
Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module.
Modified:
llvm/trunk/include/llvm/Target/TargetRegistry.h
llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp
llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h
llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.cpp
llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h
llvm/trunk/lib/Target/CBackend/CBackend.cpp
llvm/trunk/lib/Target/CBackend/CTargetMachine.h
llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h
llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
llvm/trunk/lib/Target/CppBackend/CPPTargetMachine.h
llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp
llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.h
llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
llvm/trunk/lib/Target/Mips/MipsTargetMachine.h
llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp
llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h
llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h
llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h
llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.cpp
llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.h
llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
llvm/trunk/lib/Target/X86/X86TargetMachine.h
llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp
llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h
Modified: llvm/trunk/include/llvm/Target/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegistry.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRegistry.h Sun Aug 2 18:37:13 2009
@@ -23,6 +23,9 @@
// FIXME: We shouldn't need this header, but we need it until there is a
// different interface to get the TargetAsmInfo.
#include "llvm/Target/TargetMachine.h"
+// FIXME: We shouldn't need this header, but we need it until there is a
+// different interface to the target machines.
+#include "llvm/Module.h"
#include <string>
#include <cassert>
@@ -323,6 +326,19 @@
private:
static TargetMachine *Allocator(const Target &T, const Module &M,
const std::string &FS) {
+ return new TargetMachineImpl(T, M.getTargetTriple(), FS);
+ }
+ };
+
+ template<class TargetMachineImpl>
+ struct RegisterTargetMachineDeprecated {
+ RegisterTargetMachineDeprecated(Target &T) {
+ TargetRegistry::RegisterTargetMachine(T, &Allocator);
+ }
+
+ private:
+ static TargetMachine *Allocator(const Target &T, const Module &M,
+ const std::string &FS) {
return new TargetMachineImpl(T, M, FS);
}
};
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,7 +14,6 @@
#include "ARMTargetAsmInfo.h"
#include "ARMFrameInfo.h"
#include "ARM.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/CommandLine.h"
@@ -37,29 +36,29 @@
/// TargetMachine ctor - Create an ARM architecture model.
///
ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T,
- const Module &M,
+ const std::string &TT,
const std::string &FS,
bool isThumb)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS, isThumb),
+ Subtarget(TT, FS, isThumb),
FrameInfo(Subtarget),
JITInfo(),
InstrItins(Subtarget.getInstrItineraryData()) {
DefRelocModel = getRelocationModel();
}
-ARMTargetMachine::ARMTargetMachine(const Target &T, const Module &M,
+ARMTargetMachine::ARMTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : ARMBaseTargetMachine(T, M, FS, false), InstrInfo(Subtarget),
+ : ARMBaseTargetMachine(T, TT, FS, false), InstrInfo(Subtarget),
DataLayout(Subtarget.isAPCS_ABI() ?
std::string("e-p:32:32-f64:32:32-i64:32:32") :
std::string("e-p:32:32-f64:64:64-i64:64:64")),
TLInfo(*this) {
}
-ThumbTargetMachine::ThumbTargetMachine(const Target &T, const Module &M,
+ThumbTargetMachine::ThumbTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : ARMBaseTargetMachine(T, M, FS, true),
+ : ARMBaseTargetMachine(T, TT, FS, true),
DataLayout(Subtarget.isAPCS_ABI() ?
std::string("e-p:32:32-f64:32:32-i64:32:32-"
"i16:16:32-i8:8:32-i1:8:32-a:0:32") :
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -26,8 +26,6 @@
namespace llvm {
-class Module;
-
class ARMBaseTargetMachine : public LLVMTargetMachine {
protected:
ARMSubtarget Subtarget;
@@ -39,8 +37,8 @@
Reloc::Model DefRelocModel; // Reloc model before it's overridden.
public:
- ARMBaseTargetMachine(const Target &T, const Module &M, const std::string &FS,
- bool isThumb);
+ ARMBaseTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS, bool isThumb);
virtual const ARMFrameInfo *getFrameInfo() const { return &FrameInfo; }
virtual ARMJITInfo *getJITInfo() { return &JITInfo; }
@@ -79,7 +77,8 @@
const TargetData DataLayout; // Calculates type size & alignment
ARMTargetLowering TLInfo;
public:
- ARMTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ ARMTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
virtual const ARMRegisterInfo *getRegisterInfo() const {
return &InstrInfo.getRegisterInfo();
@@ -91,9 +90,6 @@
virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetData *getTargetData() const { return &DataLayout; }
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
};
/// ThumbTargetMachine - Thumb target machine.
@@ -105,7 +101,8 @@
const TargetData DataLayout; // Calculates type size & alignment
ARMTargetLowering TLInfo;
public:
- ThumbTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ ThumbTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
/// returns either Thumb1RegisterInfo of Thumb2RegisterInfo
virtual const ARMBaseRegisterInfo *getRegisterInfo() const {
@@ -119,9 +116,6 @@
/// returns either Thumb1InstrInfo or Thumb2InstrInfo
virtual const ARMBaseInstrInfo *getInstrInfo() const { return InstrInfo; }
virtual const TargetData *getTargetData() const { return &DataLayout; }
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,7 +14,6 @@
#include "AlphaJITInfo.h"
#include "AlphaTargetAsmInfo.h"
#include "AlphaTargetMachine.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Target/TargetRegistry.h"
@@ -30,13 +29,13 @@
return new AlphaTargetAsmInfo();
}
-AlphaTargetMachine::AlphaTargetMachine(const Target &T, const Module &M,
+AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T),
DataLayout("e-f128:128:128"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
- Subtarget(M.getTargetTriple(), FS),
+ Subtarget(TT, FS),
TLInfo(*this) {
setRelocationModel(Reloc::PIC_);
}
Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -38,7 +38,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- AlphaTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ AlphaTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Modified: llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -13,7 +13,6 @@
#include "BlackfinTargetMachine.h"
#include "Blackfin.h"
#include "BlackfinTargetAsmInfo.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetRegistry.h"
@@ -28,25 +27,16 @@
}
BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
- const Module &M,
+ const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T),
DataLayout("e-p:32:32-i64:32-f64:32"),
- Subtarget(M.getTargetTriple(), FS),
+ Subtarget(TT, FS),
TLInfo(*this),
InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 4, 0) {
}
-unsigned BlackfinTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
- if (TT.size() >= 5 && std::string(TT.begin(), TT.begin()+5) == "bfin-")
- return 20;
-
- // Otherwise we don't match.
- return 0;
-}
-
bool BlackfinTargetMachine::addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
PM.add(createBlackfinISelDag(*this, OptLevel));
Modified: llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -23,8 +23,6 @@
namespace llvm {
- class Module;
-
class BlackfinTargetMachine : public LLVMTargetMachine {
const TargetData DataLayout;
BlackfinSubtarget Subtarget;
@@ -36,7 +34,7 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- BlackfinTargetMachine(const Target &T, const Module &M,
+ BlackfinTargetMachine(const Target &T, const std::string &TT,
const std::string &FS);
virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; }
@@ -51,7 +49,6 @@
return const_cast<BlackfinTargetLowering*>(&TLInfo);
}
virtual const TargetData *getTargetData() const { return &DataLayout; }
- static unsigned getModuleMatchQuality(const Module &M);
virtual bool addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
};
Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Sun Aug 2 18:37:13 2009
@@ -51,7 +51,7 @@
extern "C" void LLVMInitializeCBackendTarget() {
// Register the target.
- RegisterTargetMachine<CTargetMachine> X(TheCBackendTarget);
+ RegisterTargetMachineDeprecated<CTargetMachine> X(TheCBackendTarget);
}
namespace {
Modified: llvm/trunk/lib/Target/CBackend/CTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CTargetMachine.h (original)
+++ llvm/trunk/lib/Target/CBackend/CTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -22,7 +22,8 @@
struct CTargetMachine : public TargetMachine {
const TargetData DataLayout; // Calculates type size & alignment
- CTargetMachine(const Target &T, const Module &M, const std::string &FS)
+ CTargetMachine(const Target &T, const Module &M,
+ const std::string &FS)
: TargetMachine(T), DataLayout(&M) {}
virtual bool WantsWholeFile() const { return true; }
Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -15,7 +15,6 @@
#include "SPURegisterNames.h"
#include "SPUTargetAsmInfo.h"
#include "SPUTargetMachine.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/RegAllocRegistry.h"
#include "llvm/CodeGen/SchedulerRegistry.h"
@@ -38,10 +37,10 @@
return new SPULinuxTargetAsmInfo();
}
-SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M,
+SPUTargetMachine::SPUTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS),
+ Subtarget(TT, FS),
DataLayout(Subtarget.getTargetDataString()),
InstrInfo(*this),
FrameInfo(*this),
Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -40,7 +40,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- SPUTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ SPUTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
/// Return the subtarget implementation object
virtual const SPUSubtarget *getSubtargetImpl() const {
Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Sun Aug 2 18:37:13 2009
@@ -74,7 +74,7 @@
extern "C" void LLVMInitializeCppBackendTarget() {
// Register the target.
- RegisterTargetMachine<CPPTargetMachine> X(TheCppBackendTarget);
+ RegisterTargetMachineDeprecated<CPPTargetMachine> X(TheCppBackendTarget);
}
namespace {
Modified: llvm/trunk/lib/Target/CppBackend/CPPTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPTargetMachine.h (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -24,7 +24,8 @@
struct CPPTargetMachine : public TargetMachine {
const TargetData DataLayout; // Calculates type size & alignment
- CPPTargetMachine(const Target &T, const Module &M, const std::string &FS)
+ CPPTargetMachine(const Target &T, const Module &M,
+ const std::string &FS)
: TargetMachine(T), DataLayout(&M) {}
virtual bool WantsWholeFile() const { return true; }
Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original)
+++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Sun Aug 2 18:37:13 2009
@@ -42,16 +42,13 @@
CodeGenFileType FileType,
CodeGenOpt::Level OptLevel);
- // This class always works, but shouldn't be the default in most cases.
- static unsigned getModuleMatchQuality(const Module &M) { return 1; }
-
virtual const TargetData *getTargetData() const { return &DataLayout; }
};
}
extern "C" void LLVMInitializeMSILTarget() {
// Register the target.
- RegisterTargetMachine<MSILTarget> X(TheMSILTarget);
+ RegisterTargetMachineDeprecated<MSILTarget> X(TheMSILTarget);
}
bool MSILModule::runOnModule(Module &M) {
Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,17 +14,16 @@
#include "MSP430.h"
#include "MSP430TargetAsmInfo.h"
#include "MSP430TargetMachine.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetAsmInfo.h"
using namespace llvm;
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
- const Module &M,
+ const std::string &TT,
const std::string &FS) :
LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS),
+ Subtarget(TT, FS),
// FIXME: Check TargetData string.
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
InstrInfo(*this), TLInfo(*this),
Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.h (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.h Sun Aug 2 18:37:13 2009
@@ -41,7 +41,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- MSP430TargetMachine(const Target &T, const Module &M, const std::string &FS);
+ MSP430TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
virtual const MSP430InstrInfo *getInstrInfo() const { return &InstrInfo; }
Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,15 +14,14 @@
#include "Mips.h"
#include "MipsTargetAsmInfo.h"
#include "MipsTargetMachine.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
extern "C" void LLVMInitializeMipsTarget() {
// Register the target.
- RegisterTargetMachine<MipsTargetMachine> X(TheMipsTarget);
- RegisterTargetMachine<MipselTargetMachine> Y(TheMipselTarget);
+ RegisterTargetMachineDeprecated<MipsTargetMachine> X(TheMipsTarget);
+ RegisterTargetMachineDeprecated<MipselTargetMachine> Y(TheMipselTarget);
}
const TargetAsmInfo *MipsTargetMachine::
@@ -39,7 +38,7 @@
// an easier handling.
// Using CodeModel::Large enables different CALL behavior.
MipsTargetMachine::
-MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
+MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
bool isLittle=false):
LLVMTargetMachine(T),
Subtarget(*this, M.getTargetTriple(), FS, isLittle),
Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -35,8 +35,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
- bool isLittle);
+ MipsTargetMachine(const Target &T, const Module &M,
+ const std::string &FS, bool isLittle);
virtual const MipsInstrInfo *getInstrInfo() const
{ return &InstrInfo; }
@@ -67,8 +67,6 @@
class MipselTargetMachine : public MipsTargetMachine {
public:
MipselTargetMachine(const Target &T, const Module &M, const std::string &FS);
-
- static unsigned getModuleMatchQuality(const Module &M);
};
} // End llvm namespace
Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,7 +14,6 @@
#include "PIC16.h"
#include "PIC16TargetAsmInfo.h"
#include "PIC16TargetMachine.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetAsmInfo.h"
@@ -22,19 +21,19 @@
using namespace llvm;
// PIC16TargetMachine - Traditional PIC16 Machine.
-PIC16TargetMachine::PIC16TargetMachine(const Target &T, const Module &M,
+PIC16TargetMachine::PIC16TargetMachine(const Target &T, const std::string &TT,
const std::string &FS, bool Cooper)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS, Cooper),
+ Subtarget(TT, FS, Cooper),
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
InstrInfo(*this), TLInfo(*this),
FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { }
// CooperTargetMachine - Uses the same PIC16TargetMachine, but makes IsCooper
// as true.
-CooperTargetMachine::CooperTargetMachine(const Target &T, const Module &M,
+CooperTargetMachine::CooperTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : PIC16TargetMachine(T, M, FS, true) {}
+ : PIC16TargetMachine(T, TT, FS, true) {}
const TargetAsmInfo *PIC16TargetMachine::createTargetAsmInfo() const {
Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Sun Aug 2 18:37:13 2009
@@ -41,8 +41,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- PIC16TargetMachine(const Target &T, const Module &M, const std::string &FS,
- bool Cooper = false);
+ PIC16TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS, bool Cooper = false);
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
virtual const PIC16InstrInfo *getInstrInfo() const { return &InstrInfo; }
@@ -65,7 +65,8 @@
/// CooperTargetMachine
class CooperTargetMachine : public PIC16TargetMachine {
public:
- CooperTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ CooperTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
}; // CooperTargetMachine.
} // end namespace llvm
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,7 +14,6 @@
#include "PPC.h"
#include "PPCTargetAsmInfo.h"
#include "PPCTargetMachine.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
@@ -34,10 +33,10 @@
return new PPCLinuxTargetAsmInfo(*this);
}
-PPCTargetMachine::PPCTargetMachine(const Target&T, const Module &M,
+PPCTargetMachine::PPCTargetMachine(const Target&T, const std::string &TT,
const std::string &FS, bool is64Bit)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS, is64Bit),
+ Subtarget(TT, FS, is64Bit),
DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
InstrItins(Subtarget.getInstrItineraryData()), MachOWriterInfo(*this) {
@@ -54,15 +53,15 @@
/// groups, which typically degrades performance.
bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; }
-PPC32TargetMachine::PPC32TargetMachine(const Target &T, const Module &M,
+PPC32TargetMachine::PPC32TargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : PPCTargetMachine(T, M, FS, false) {
+ : PPCTargetMachine(T, TT, FS, false) {
}
-PPC64TargetMachine::PPC64TargetMachine(const Target &T, const Module &M,
+PPC64TargetMachine::PPC64TargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : PPCTargetMachine(T, M, FS, true) {
+ : PPCTargetMachine(T, TT, FS, true) {
}
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -43,8 +43,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- PPCTargetMachine(const Target &T, const Module &M, const std::string &FS,
- bool is64Bit);
+ PPCTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS, bool is64Bit);
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const PPCFrameInfo *getFrameInfo() const { return &FrameInfo; }
@@ -90,14 +90,16 @@
///
class PPC32TargetMachine : public PPCTargetMachine {
public:
- PPC32TargetMachine(const Target &T, const Module &M, const std::string &FS);
+ PPC32TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
};
/// PPC64TargetMachine - PowerPC 64-bit target machine.
///
class PPC64TargetMachine : public PPCTargetMachine {
public:
- PPC64TargetMachine(const Target &T, const Module &M, const std::string &FS);
+ PPC64TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -13,7 +13,6 @@
#include "SparcTargetAsmInfo.h"
#include "SparcTargetMachine.h"
#include "Sparc.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
@@ -30,11 +29,11 @@
/// SparcTargetMachine ctor - Create an ILP32 architecture model
///
-SparcTargetMachine::SparcTargetMachine(const Target &T, const Module &M,
+SparcTargetMachine::SparcTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T),
DataLayout("E-p:32:32-f128:128:128"),
- Subtarget(M.getTargetTriple(), FS), TLInfo(*this), InstrInfo(Subtarget),
+ Subtarget(TT, FS), TLInfo(*this), InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -23,8 +23,6 @@
namespace llvm {
-class Module;
-
class SparcTargetMachine : public LLVMTargetMachine {
const TargetData DataLayout; // Calculates type size & alignment
SparcSubtarget Subtarget;
@@ -36,7 +34,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- SparcTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ SparcTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Modified: llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -13,7 +13,6 @@
#include "SystemZTargetAsmInfo.h"
#include "SystemZTargetMachine.h"
#include "SystemZ.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
@@ -30,10 +29,10 @@
/// SystemZTargetMachine ctor - Create an ILP64 architecture model
///
SystemZTargetMachine::SystemZTargetMachine(const Target &T,
- const Module &M,
+ const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS),
+ Subtarget(TT, FS),
DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
"-f64:64:64-f128:128:128-a0:16:16"),
InstrInfo(*this), TLInfo(*this),
@@ -49,14 +48,3 @@
PM.add(createSystemZISelDag(*this, OptLevel));
return false;
}
-
-unsigned SystemZTargetMachine::getModuleMatchQuality(const Module &M) {
- std::string TT = M.getTargetTriple();
-
- // We strongly match s390x
- if (TT.size() >= 5 && TT[0] == 's' && TT[1] == '3' && TT[2] == '9' &&
- TT[3] == '0' && TT[4] == 'x')
- return 20;
-
- return 0;
-}
Modified: llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.h (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -41,7 +41,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- SystemZTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ SystemZTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
virtual const SystemZInstrInfo *getInstrInfo() const { return &InstrInfo; }
@@ -57,7 +58,6 @@
}
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
- static unsigned getModuleMatchQuality(const Module &M);
}; // SystemZTargetMachine.
} // end namespace llvm
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -14,7 +14,6 @@
#include "X86TargetAsmInfo.h"
#include "X86TargetMachine.h"
#include "X86.h"
-#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
@@ -46,23 +45,23 @@
}
}
-X86_32TargetMachine::X86_32TargetMachine(const Target &T, const Module &M,
+X86_32TargetMachine::X86_32TargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : X86TargetMachine(T, M, FS, false) {
+ : X86TargetMachine(T, TT, FS, false) {
}
-X86_64TargetMachine::X86_64TargetMachine(const Target &T, const Module &M,
+X86_64TargetMachine::X86_64TargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
- : X86TargetMachine(T, M, FS, true) {
+ : X86TargetMachine(T, TT, FS, true) {
}
/// X86TargetMachine ctor - Create an X86 target.
///
-X86TargetMachine::X86TargetMachine(const Target &T, const Module &M,
+X86TargetMachine::X86TargetMachine(const Target &T, const std::string &TT,
const std::string &FS, bool is64Bit)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS, is64Bit),
+ Subtarget(TT, FS, is64Bit),
DataLayout(Subtarget.getDataLayout()),
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4),
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Sun Aug 2 18:37:13 2009
@@ -42,8 +42,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- X86TargetMachine(const Target &T, const Module &M, const std::string &FS,
- bool is64Bit);
+ X86TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS, bool is64Bit);
virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
@@ -85,20 +85,16 @@
///
class X86_32TargetMachine : public X86TargetMachine {
public:
- X86_32TargetMachine(const Target &T, const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
+ X86_32TargetMachine(const Target &T, const std::string &M,
+ const std::string &FS);
};
/// X86_64TargetMachine - X86 64-bit target machine.
///
class X86_64TargetMachine : public X86TargetMachine {
public:
- X86_64TargetMachine(const Target &T, const Module &M, const std::string &FS);
-
- static unsigned getJITMatchQuality();
- static unsigned getModuleMatchQuality(const Module &M);
+ X86_64TargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
};
} // End llvm namespace
Modified: llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp Sun Aug 2 18:37:13 2009
@@ -23,10 +23,10 @@
/// XCoreTargetMachine ctor - Create an ILP32 architecture model
///
-XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Module &M,
+XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T),
- Subtarget(M.getTargetTriple(), FS),
+ Subtarget(TT, FS),
DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
"i16:16:32-i32:32:32-i64:32:32"),
InstrInfo(),
Modified: llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h?rev=77927&r1=77926&r2=77927&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h Sun Aug 2 18:37:13 2009
@@ -23,8 +23,6 @@
namespace llvm {
-class Module;
-
class XCoreTargetMachine : public LLVMTargetMachine {
XCoreSubtarget Subtarget;
const TargetData DataLayout; // Calculates type size & alignment
@@ -36,7 +34,8 @@
virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
- XCoreTargetMachine(const Target &T, const Module &M, const std::string &FS);
+ XCoreTargetMachine(const Target &T, const std::string &TT,
+ const std::string &FS);
virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const XCoreFrameInfo *getFrameInfo() const { return &FrameInfo; }
More information about the llvm-commits
mailing list