[llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp IA64TargetMachine.h
Jim Laskey
jlaskey at apple.com
Thu Sep 7 15:07:08 PDT 2006
Changes in directory llvm/lib/Target/IA64:
IA64AsmPrinter.cpp updated: 1.34 -> 1.35
IA64TargetMachine.h updated: 1.13 -> 1.14
---
Log message:
Make target asm info a property of the target machine.
---
Diffs of the changes: (+8 -24)
IA64AsmPrinter.cpp | 27 +++------------------------
IA64TargetMachine.h | 5 +++++
2 files changed, 8 insertions(+), 24 deletions(-)
Index: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
diff -u llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.34 llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.35
--- llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.34 Wed Sep 6 13:34:40 2006
+++ llvm/lib/Target/IA64/IA64AsmPrinter.cpp Thu Sep 7 17:06:40 2006
@@ -23,8 +23,8 @@
#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/Statistic.h"
#include <iostream>
@@ -32,31 +32,11 @@
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
-
- struct VISIBILITY_HIDDEN IA64TargetAsmInfo : public TargetAsmInfo {
- IA64TargetAsmInfo() {
- CommentString = "//";
- Data8bitsDirective = "\tdata1\t"; // FIXME: check that we are
- Data16bitsDirective = "\tdata2.ua\t"; // disabling auto-alignment
- Data32bitsDirective = "\tdata4.ua\t"; // properly
- Data64bitsDirective = "\tdata8.ua\t";
- ZeroDirective = "\t.skip\t";
- AsciiDirective = "\tstring\t";
-
- GlobalVarAddrPrefix="";
- GlobalVarAddrSuffix="";
- FunctionAddrPrefix="@fptr(";
- FunctionAddrSuffix=")";
-
- // FIXME: would be nice to have rodata (no 'w') when appropriate?
- ConstantPoolSection = "\n\t.section .data, \"aw\", \"progbits\"\n";
- }
- };
struct IA64AsmPrinter : public AsmPrinter {
std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
- IA64AsmPrinter(std::ostream &O, TargetMachine &TM, TargetAsmInfo *T)
+ IA64AsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
: AsmPrinter(O, TM, T) {
}
@@ -366,8 +346,7 @@
///
FunctionPass *llvm::createIA64CodePrinterPass(std::ostream &o,
IA64TargetMachine &tm) {
- IA64TargetAsmInfo *TAI = new IA64TargetAsmInfo();
- return new IA64AsmPrinter(o, tm, TAI);
+ return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo());
}
Index: llvm/lib/Target/IA64/IA64TargetMachine.h
diff -u llvm/lib/Target/IA64/IA64TargetMachine.h:1.13 llvm/lib/Target/IA64/IA64TargetMachine.h:1.14
--- llvm/lib/Target/IA64/IA64TargetMachine.h:1.13 Sun Sep 3 23:14:57 2006
+++ llvm/lib/Target/IA64/IA64TargetMachine.h Thu Sep 7 17:06:40 2006
@@ -19,6 +19,7 @@
#include "llvm/Target/TargetFrameInfo.h"
#include "IA64InstrInfo.h"
#include "IA64ISelLowering.h"
+#include "IA64TargetAsmInfo.h"
namespace llvm {
@@ -40,6 +41,10 @@
return &InstrInfo.getRegisterInfo();
}
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);
More information about the llvm-commits
mailing list