///
mutable const TargetAsmInfo *AsmInfo;
+ /// createTargetAsmInfo - Create a new instance of target specific asm
+ /// information.
+ virtual const TargetAsmInfo *createTargetAsmInfo() const { return NULL; }
+
public:
virtual ~TargetMachine();
return AsmInfo;
}
- /// createTargetAsmInfo - Create a new instance of target specific asm
- /// information.
- virtual const TargetAsmInfo *createTargetAsmInfo() const { return NULL; }
-
/// getSubtarget - This method returns a pointer to the specified type of
/// TargetSubtarget. In debug builds, it verifies that the object being
/// returned is of the correct type.
//
//===----------------------------------------------------------------------===//
+#include "ARMTargetAsmInfo.h"
#include "ARMTargetMachine.h"
#include "ARMFrameInfo.h"
#include "ARM.h"
RegisterTarget<ARMTargetMachine> X("arm", " ARM");
}
+
+const TargetAsmInfo *ARMTargetMachine::createTargetAsmInfo() const {
+ return new ARMTargetAsmInfo(*this);
+}
+
+
/// TargetMachine ctor - Create an ILP32 architecture model
///
ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
#include "llvm/Target/TargetFrameInfo.h"
#include "ARMInstrInfo.h"
#include "ARMFrameInfo.h"
-#include "ARMTargetAsmInfo.h"
namespace llvm {
const TargetData DataLayout; // Calculates type size & alignment
ARMInstrInfo InstrInfo;
ARMFrameInfo FrameInfo;
+
+protected:
+ virtual const TargetAsmInfo *createTargetAsmInfo() const;
+
public:
ARMTargetMachine(const Module &M, const std::string &FS);
virtual const TargetData *getTargetData() const { return &DataLayout; }
static unsigned getModuleMatchQuality(const Module &M);
- virtual const TargetAsmInfo *createTargetAsmInfo() const {
- return static_cast<const TargetAsmInfo *>(new ARMTargetAsmInfo(*this));
- }
-
// Pass Pipeline Configuration
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
#include "Alpha.h"
#include "AlphaJITInfo.h"
+#include "AlphaTargetAsmInfo.h"
#include "AlphaTargetMachine.h"
#include "llvm/Module.h"
#include "llvm/PassManager.h"
RegisterTarget<AlphaTargetMachine> X("alpha", " Alpha (incomplete)");
}
+const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
+ return new AlphaTargetAsmInfo(*this);
+}
+
unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) {
// We strongly match "alpha*".
std::string TT = M.getTargetTriple();
: DataLayout("e"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
- Subtarget(M, FS),
- AsmInfo(NULL) {
+ Subtarget(M, FS) {
}
#include "AlphaInstrInfo.h"
#include "AlphaJITInfo.h"
#include "AlphaSubtarget.h"
-#include "AlphaTargetAsmInfo.h"
namespace llvm {
TargetFrameInfo FrameInfo;
AlphaJITInfo JITInfo;
AlphaSubtarget Subtarget;
- AlphaTargetAsmInfo *AsmInfo;
+
+protected:
+ virtual const TargetAsmInfo *createTargetAsmInfo() const;
public:
AlphaTargetMachine(const Module &M, const std::string &FS);
- ~AlphaTargetMachine() {
- if (AsmInfo) delete AsmInfo;
- }
virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
return &JITInfo;
}
- virtual const TargetAsmInfo *createTargetAsmInfo() const {
- return static_cast<const TargetAsmInfo *>(new AlphaTargetAsmInfo(*this));
- }
-
static unsigned getJITMatchQuality();
static unsigned getModuleMatchQuality(const Module &M);
//
//===----------------------------------------------------------------------===//
+#include "IA64TargetAsmInfo.h"
#include "IA64TargetMachine.h"
#include "IA64.h"
#include "llvm/Module.h"
RegisterTarget<IA64TargetMachine> X("ia64", " IA-64 (Itanium)");
}
+const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
+ return new IA64TargetAsmInfo(*this);
+}
+
unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
// we match [iI][aA]*64
bool seenIA64=false;
#include "llvm/Target/TargetFrameInfo.h"
#include "IA64InstrInfo.h"
#include "IA64ISelLowering.h"
-#include "IA64TargetAsmInfo.h"
namespace llvm {
TargetFrameInfo FrameInfo;
//IA64JITInfo JITInfo;
IA64TargetLowering TLInfo;
+
+protected:
+ virtual const TargetAsmInfo *createTargetAsmInfo() const;
+
public:
IA64TargetMachine(const Module &M, const std::string &FS);
}
virtual const TargetData *getTargetData() const { return &DataLayout; }
- virtual const TargetAsmInfo *createTargetAsmInfo() const {
- return static_cast<const TargetAsmInfo *>(new IA64TargetAsmInfo(*this));
- }
-
static unsigned getModuleMatchQuality(const Module &M);
// Pass Pipeline Configuration
//===----------------------------------------------------------------------===//
#include "PPC.h"
+#include "PPCTargetAsmInfo.h"
#include "PPCTargetMachine.h"
#include "llvm/Module.h"
#include "llvm/PassManager.h"
Y("ppc64", " PowerPC 64");
}
+const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
+ return new DarwinTargetAsmInfo(*this);
+}
+
unsigned PPC32TargetMachine::getJITMatchQuality() {
#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)
if (sizeof(void*) == 4)
#include "PPCJITInfo.h"
#include "PPCInstrInfo.h"
#include "PPCISelLowering.h"
-#include "PPCTargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetData.h"
PPCJITInfo JITInfo;
PPCTargetLowering TLInfo;
InstrItineraryData InstrItins;
+
+protected:
+ virtual const TargetAsmInfo *createTargetAsmInfo() const;
+
public:
PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit);
return InstrItins;
}
- virtual const TargetAsmInfo *createTargetAsmInfo() const {
- return static_cast<const TargetAsmInfo *>(new DarwinTargetAsmInfo(*this));
- }
-
// Pass Pipeline Configuration
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
//
//===----------------------------------------------------------------------===//
+#include "SparcTargetAsmInfo.h"
#include "SparcTargetMachine.h"
#include "Sparc.h"
#include "llvm/Module.h"
RegisterTarget<SparcTargetMachine> X("sparc", " SPARC");
}
+const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
+ return new SparcTargetAsmInfo(*this);
+}
+
/// SparcTargetMachine ctor - Create an ILP32 architecture model
///
SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
#include "llvm/Target/TargetFrameInfo.h"
#include "SparcInstrInfo.h"
#include "SparcSubtarget.h"
-#include "SparcTargetAsmInfo.h"
namespace llvm {
SparcSubtarget Subtarget;
SparcInstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
+
+protected:
+ virtual const TargetAsmInfo *createTargetAsmInfo() const;
+
public:
SparcTargetMachine(const Module &M, const std::string &FS);
virtual const TargetData *getTargetData() const { return &DataLayout; }
static unsigned getModuleMatchQuality(const Module &M);
- virtual const TargetAsmInfo *createTargetAsmInfo() const {
- return static_cast<const TargetAsmInfo *>(new SparcTargetAsmInfo(*this));
- }
-
// Pass Pipeline Configuration
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast);
//
TargetMachine::~TargetMachine() {
- if (AsmInfo) delete AsmInfo;
+ delete AsmInfo;
}
/// getRelocationModel - Returns the code generation relocation model. The
//
//===----------------------------------------------------------------------===//
+#include "X86TargetAsmInfo.h"
#include "X86TargetMachine.h"
#include "X86.h"
#include "llvm/Module.h"
RegisterTarget<X86TargetMachine> X("x86", " IA-32 (Pentium and above)");
}
+const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const {
+ return new X86TargetAsmInfo(*this);
+}
+
unsigned X86TargetMachine::getJITMatchQuality() {
#if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
return 10;
#include "X86InstrInfo.h"
#include "X86JITInfo.h"
#include "X86Subtarget.h"
-#include "X86TargetAsmInfo.h"
#include "X86ISelLowering.h"
namespace llvm {
X86InstrInfo InstrInfo;
X86JITInfo JITInfo;
X86TargetLowering TLInfo;
+
+protected:
+ virtual const TargetAsmInfo *createTargetAsmInfo() const;
+
public:
X86TargetMachine(const Module &M, const std::string &FS);
static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();
- virtual const TargetAsmInfo *createTargetAsmInfo() const {
- return static_cast<const TargetAsmInfo *>(new X86TargetAsmInfo(*this));
- }
-
// Set up the pass pipeline.
virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
virtual bool addPostRegAlloc(FunctionPassManager &PM, bool Fast);