Make target asm info a property of the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30162 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey
2006-09-07 22:06:40 +00:00
parent 8e8de8f776
commit a0f3d17daa
25 changed files with 107 additions and 217 deletions

View File

@@ -37,19 +37,8 @@ using namespace llvm;
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
struct VISIBILITY_HIDDEN SparcTargetAsmInfo : public TargetAsmInfo {
SparcTargetAsmInfo() {
Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t";
Data64bitsDirective = 0; // .xword is only supported by V9.
ZeroDirective = "\t.skip\t";
CommentString = "!";
ConstantPoolSection = "\t.section \".rodata\",#alloc\n";
}
};
struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
SparcAsmPrinter(std::ostream &O, TargetMachine &TM, TargetAsmInfo *T)
SparcAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
: AsmPrinter(O, TM, T) {
}
@@ -85,8 +74,7 @@ namespace {
///
FunctionPass *llvm::createSparcCodePrinterPass(std::ostream &o,
TargetMachine &tm) {
SparcTargetAsmInfo *TAI = new SparcTargetAsmInfo();
return new SparcAsmPrinter(o, tm, TAI);
return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
}
/// runOnMachineFunction - This uses the printMachineInstruction()