aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Alpha
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Alpha')
-rw-r--r--lib/Target/Alpha/AlphaAsmPrinter.cpp12
-rw-r--r--lib/Target/Alpha/AlphaTargetMachine.cpp3
-rw-r--r--lib/Target/Alpha/AlphaTargetMachine.h9
3 files changed, 13 insertions, 11 deletions
diff --git a/lib/Target/Alpha/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AlphaAsmPrinter.cpp
index d709ed7342..2ce4865404 100644
--- a/lib/Target/Alpha/AlphaAsmPrinter.cpp
+++ b/lib/Target/Alpha/AlphaAsmPrinter.cpp
@@ -29,20 +29,13 @@ using namespace llvm;
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
- struct VISIBILITY_HIDDEN AlphaTargetAsmInfo : public TargetAsmInfo {
- AlphaTargetAsmInfo() {
- AlignmentIsInBytes = false;
- PrivateGlobalPrefix = "$";
- }
- };
-
struct VISIBILITY_HIDDEN AlphaAsmPrinter : public AsmPrinter {
/// Unique incrementer for label values for referencing Global values.
///
unsigned LabelNumber;
- AlphaAsmPrinter(std::ostream &o, TargetMachine &tm, TargetAsmInfo *T)
+ AlphaAsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T)
: AsmPrinter(o, tm, T), LabelNumber(0) {
}
@@ -82,8 +75,7 @@ namespace {
///
FunctionPass *llvm::createAlphaCodePrinterPass (std::ostream &o,
TargetMachine &tm) {
- AlphaTargetAsmInfo *TAI = new AlphaTargetAsmInfo();
- return new AlphaAsmPrinter(o, tm, TAI);
+ return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo());
}
#include "AlphaGenAsmWriter.inc"
diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp
index 9c9f52dcf1..cbe0cdbf4d 100644
--- a/lib/Target/Alpha/AlphaTargetMachine.cpp
+++ b/lib/Target/Alpha/AlphaTargetMachine.cpp
@@ -53,7 +53,8 @@ AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
: DataLayout("e"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
- Subtarget(M, FS) {
+ Subtarget(M, FS),
+ AsmInfo(NULL) {
}
diff --git a/lib/Target/Alpha/AlphaTargetMachine.h b/lib/Target/Alpha/AlphaTargetMachine.h
index d71c7cec72..d47ca8215c 100644
--- a/lib/Target/Alpha/AlphaTargetMachine.h
+++ b/lib/Target/Alpha/AlphaTargetMachine.h
@@ -20,6 +20,7 @@
#include "AlphaInstrInfo.h"
#include "AlphaJITInfo.h"
#include "AlphaSubtarget.h"
+#include "AlphaTargetAsmInfo.h"
namespace llvm {
@@ -31,9 +32,13 @@ class AlphaTargetMachine : public LLVMTargetMachine {
TargetFrameInfo FrameInfo;
AlphaJITInfo JITInfo;
AlphaSubtarget Subtarget;
+ AlphaTargetAsmInfo *AsmInfo;
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; }
@@ -46,6 +51,10 @@ public:
return &JITInfo;
}
+ virtual const TargetAsmInfo *createTargetAsmInfo() const {
+ return static_cast<const TargetAsmInfo *>(new AlphaTargetAsmInfo(*this));
+ }
+
static unsigned getJITMatchQuality();
static unsigned getModuleMatchQuality(const Module &M);