/// Target Asm Printer information.
///
- TargetAsmInfo *TAI;
+ const TargetAsmInfo *TAI;
/// Name-mangler for global names.
///
std::string CurrentSection;
protected:
- AsmPrinter(std::ostream &o, TargetMachine &TM, TargetAsmInfo *T);
+ AsmPrinter(std::ostream &o, TargetMachine &TM, const TargetAsmInfo *T);
public:
/// SwitchToTextSection - Switch to the specified section of the executable
AsmPrinter *Asm;
/// TAI - Target Asm Printer.
- TargetAsmInfo *TAI;
+ const TargetAsmInfo *TAI;
/// TD - Target data.
const TargetData *TD;
public:
- DwarfWriter(std::ostream &OS, AsmPrinter *A, TargetAsmInfo *T);
+ DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
virtual ~DwarfWriter();
// Accessors.
//
- TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
+ const TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
/// SetDebugInfo - Set DebugInfo when it's known that pass manager has
/// created it. Set by the target AsmPrinter.
namespace llvm {
+ // Forward declaration.
+ class TargetMachine;
+
/// TargetAsmInfo - This class is intended to be used as a base class for asm
/// properties and features specific to the target.
class TargetAsmInfo {
unsigned getAddressSize() const {
return AddressSize;
}
- bool getNeedsSet() const {
+ bool needsSet() const {
return NeedsSet;
}
const char *getCommentString() const {
namespace llvm {
+class TargetAsmInfo;
class TargetData;
class TargetSubtarget;
class TargetInstrInfo;
TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
void operator=(const TargetMachine &); // DO NOT IMPLEMENT
protected: // Can only create subclasses.
- TargetMachine() { }
+ TargetMachine() : AsmInfo(NULL) { }
/// getSubtargetImpl - virtual method implemented by subclasses that returns
/// a reference to that target's TargetSubtarget-derived member variable.
virtual const TargetSubtarget *getSubtargetImpl() const { return 0; }
+
+ /// AsmInfo - Contains target specific asm information.
+ ///
+ mutable const TargetAsmInfo *AsmInfo;
+
public:
virtual ~TargetMachine();
virtual const TargetFrameInfo *getFrameInfo() const { return 0; }
virtual TargetLowering *getTargetLowering() const { return 0; }
virtual const TargetData *getTargetData() const { return 0; }
+
+
+ /// getTargetAsmInfo - Return target specific asm information.
+ ///
+ const TargetAsmInfo *getTargetAsmInfo() const {
+ if (!AsmInfo) AsmInfo = createTargetAsmInfo();
+ 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
#include <cerrno>
using namespace llvm;
-AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm, TargetAsmInfo *T)
+AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
+ const TargetAsmInfo *T)
: FunctionNumber(0), O(o), TM(tm), TAI(T)
{}
}
#ifndef NDEBUG
- void DIEAbbrev::print(std::ostream &O) {
- O << "Abbreviation @"
- << std::hex << (intptr_t)this << std::dec
+void DIEAbbrev::print(std::ostream &O) {
+ O << "Abbreviation @"
+ << std::hex << (intptr_t)this << std::dec
+ << " "
+ << TagString(Tag)
+ << " "
+ << ChildrenString(ChildrenFlag)
+ << "\n";
+
+ for (unsigned i = 0, N = Data.size(); i < N; ++i) {
+ O << " "
+ << AttributeString(Data[i].getAttribute())
<< " "
- << TagString(Tag)
- << " "
- << ChildrenString(ChildrenFlag)
+ << FormEncodingString(Data[i].getForm())
<< "\n";
-
- for (unsigned i = 0, N = Data.size(); i < N; ++i) {
- O << " "
- << AttributeString(Data[i].getAttribute())
- << " "
- << FormEncodingString(Data[i].getForm())
- << "\n";
- }
}
- void DIEAbbrev::dump() { print(std::cerr); }
+}
+void DIEAbbrev::dump() { print(std::cerr); }
#endif
//===----------------------------------------------------------------------===//
/// is an option (needsSet) to use an intermediary 'set' expression.
void DwarfWriter::EmitDifference(const char *TagHi, unsigned NumberHi,
const char *TagLo, unsigned NumberLo) const {
- if (TAI->getNeedsSet()) {
+ if (TAI->needsSet()) {
static unsigned SetCounter = 0;
O << "\t.set\t";
// Main entry points.
//
-DwarfWriter::DwarfWriter(std::ostream &OS, AsmPrinter *A, TargetAsmInfo *T)
+DwarfWriter::DwarfWriter(std::ostream &OS, AsmPrinter *A,
+ const TargetAsmInfo *T)
: O(OS)
, Asm(A)
, TAI(T)
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
- struct VISIBILITY_HIDDEN ARMTargetAsmInfo : public TargetAsmInfo {
- ARMTargetAsmInfo() {
- Data16bitsDirective = "\t.half\t";
- Data32bitsDirective = "\t.word\t";
- Data64bitsDirective = 0;
- ZeroDirective = "\t.skip\t";
- CommentString = "@";
- ConstantPoolSection = "\t.text\n";
- AlignmentIsInBytes = false;
- }
- };
-
struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
- ARMAsmPrinter(std::ostream &O, TargetMachine &TM, TargetAsmInfo *T)
+ ARMAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
: AsmPrinter(O, TM, T) {
}
///
FunctionPass *llvm::createARMCodePrinterPass(std::ostream &o,
TargetMachine &tm) {
- ARMTargetAsmInfo *TAI = new ARMTargetAsmInfo();
- return new ARMAsmPrinter(o, tm, TAI);
+ return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo());
}
/// runOnMachineFunction - This uses the printMachineInstruction()
#include "llvm/Target/TargetFrameInfo.h"
#include "ARMInstrInfo.h"
#include "ARMFrameInfo.h"
+#include "ARMTargetAsmInfo.h"
namespace llvm {
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,
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) {
}
///
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"
: DataLayout("e"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
- Subtarget(M, FS) {
+ Subtarget(M, FS),
+ AsmInfo(NULL) {
}
#include "AlphaInstrInfo.h"
#include "AlphaJITInfo.h"
#include "AlphaSubtarget.h"
+#include "AlphaTargetAsmInfo.h"
namespace llvm {
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; }
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 "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>
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) {
}
///
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());
}
#include "llvm/Target/TargetFrameInfo.h"
#include "IA64InstrInfo.h"
#include "IA64ISelLowering.h"
+#include "IA64TargetAsmInfo.h"
namespace llvm {
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);
struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
std::set<std::string> FnStubs, GVStubs;
- PPCAsmPrinter(std::ostream &O, TargetMachine &TM, TargetAsmInfo *T)
+ PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
: AsmPrinter(O, TM, T) {}
virtual const char *getPassName() const {
};
- struct VISIBILITY_HIDDEN DarwinTargetAsmInfo : public TargetAsmInfo {
- DarwinTargetAsmInfo(PPCTargetMachine &TM) {
- bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
-
- CommentString = ";";
- GlobalPrefix = "_";
- PrivateGlobalPrefix = "L";
- ZeroDirective = "\t.space\t";
- SetDirective = "\t.set";
- Data64bitsDirective = isPPC64 ? ".quad\t" : 0;
- AlignmentIsInBytes = false;
- ConstantPoolSection = "\t.const\t";
- JumpTableDataSection = ".const";
- JumpTableTextSection = "\t.text";
- LCOMMDirective = "\t.lcomm\t";
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
- InlineAsmStart = "# InlineAsm Start";
- InlineAsmEnd = "# InlineAsm End";
-
- NeedsSet = true;
- AddressSize = isPPC64 ? 8 : 4;
- DwarfAbbrevSection = ".section __DWARF,__debug_abbrev";
- DwarfInfoSection = ".section __DWARF,__debug_info";
- DwarfLineSection = ".section __DWARF,__debug_line";
- DwarfFrameSection = ".section __DWARF,__debug_frame";
- DwarfPubNamesSection = ".section __DWARF,__debug_pubnames";
- DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes";
- DwarfStrSection = ".section __DWARF,__debug_str";
- DwarfLocSection = ".section __DWARF,__debug_loc";
- DwarfARangesSection = ".section __DWARF,__debug_aranges";
- DwarfRangesSection = ".section __DWARF,__debug_ranges";
- DwarfMacInfoSection = ".section __DWARF,__debug_macinfo";
- }
- };
-
/// DarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac OS
/// X
struct VISIBILITY_HIDDEN DarwinAsmPrinter : public PPCAsmPrinter {
DwarfWriter DW;
- DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM, TargetAsmInfo *T)
+ DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
+ const TargetAsmInfo *T)
: PPCAsmPrinter(O, TM, T), DW(O, this, T) {
bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
}
///
FunctionPass *llvm::createDarwinCodePrinterPass(std::ostream &o,
PPCTargetMachine &tm) {
- TargetAsmInfo *TAI = new DarwinTargetAsmInfo(tm);
- return new DarwinAsmPrinter(o, tm, TAI);
+ return new DarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
}
// Include the auto-generated portion of the assembly writer
#include "PPCJITInfo.h"
#include "PPCInstrInfo.h"
#include "PPCISelLowering.h"
+#include "PPCTargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetData.h"
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);
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) {
}
///
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()
#include "llvm/Target/TargetFrameInfo.h"
#include "SparcInstrInfo.h"
#include "SparcSubtarget.h"
+#include "SparcTargetAsmInfo.h"
namespace llvm {
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);
//
//===----------------------------------------------------------------------===//
+#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h"
//
TargetMachine::~TargetMachine() {
+ if (AsmInfo) delete AsmInfo;
}
/// getRelocationModel - Returns the code generation relocation model. The
#include "X86ATTAsmPrinter.h"
#include "X86.h"
#include "X86TargetMachine.h"
+#include "X86TargetAsmInfo.h"
#include "llvm/Module.h"
#include "llvm/Support/Mangler.h"
+#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetOptions.h"
#include <iostream>
using namespace llvm;
namespace llvm {
struct X86ATTAsmPrinter : public X86SharedAsmPrinter {
- X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM, TargetAsmInfo *T)
+ X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T)
: X86SharedAsmPrinter(O, TM, T) { }
virtual const char *getPassName() const {
#include "llvm/Type.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/Mangler.h"
+#include "llvm/Target/TargetAsmInfo.h"
using namespace llvm;
Statistic<> llvm::EmittedInsts("asm-printer",
"Number of machine instrs printed");
-X86TargetAsmInfo::X86TargetAsmInfo(X86TargetMachine &TM) {
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
-
- //FIXME - Should to be simplified.
-
- switch (Subtarget->TargetType) {
- case X86Subtarget::isDarwin:
- AlignmentIsInBytes = false;
- GlobalPrefix = "_";
- Data64bitsDirective = 0; // we can't emit a 64-bit unit
- ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
- PrivateGlobalPrefix = "L"; // Marker for constant pool idxs
- ConstantPoolSection = "\t.const\n";
- JumpTableDataSection = "\t.const\n"; // FIXME: depends on PIC mode
- FourByteConstantSection = "\t.literal4\n";
- EightByteConstantSection = "\t.literal8\n";
- LCOMMDirective = "\t.lcomm\t";
- COMMDirectiveTakesAlignment = false;
- HasDotTypeDotSizeDirective = false;
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
- InlineAsmStart = "# InlineAsm Start";
- InlineAsmEnd = "# InlineAsm End";
- SetDirective = "\t.set";
-
- NeedsSet = true;
- DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
- DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
- DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
- DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
- DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
- DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
- DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
- DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
- DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
- DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
- DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
- break;
- case X86Subtarget::isCygwin:
- GlobalPrefix = "_";
- COMMDirectiveTakesAlignment = false;
- HasDotTypeDotSizeDirective = false;
- StaticCtorsSection = "\t.section .ctors,\"aw\"";
- StaticDtorsSection = "\t.section .dtors,\"aw\"";
- break;
- case X86Subtarget::isWindows:
- GlobalPrefix = "_";
- HasDotTypeDotSizeDirective = false;
- break;
- default: break;
- }
-
- if (Subtarget->isFlavorIntel()) {
- GlobalPrefix = "_";
- CommentString = ";";
-
- PrivateGlobalPrefix = "$";
- AlignDirective = "\talign\t";
- ZeroDirective = "\tdb\t";
- ZeroDirectiveSuffix = " dup(0)";
- AsciiDirective = "\tdb\t";
- AscizDirective = 0;
- Data8bitsDirective = "\tdb\t";
- Data16bitsDirective = "\tdw\t";
- Data32bitsDirective = "\tdd\t";
- Data64bitsDirective = "\tdq\t";
- HasDotTypeDotSizeDirective = false;
-
- TextSection = "_text";
- DataSection = "_data";
- SwitchToSectionDirective = "";
- TextSectionStartSuffix = "\tsegment 'CODE'";
- DataSectionStartSuffix = "\tsegment 'DATA'";
- SectionEndDirectiveSuffix = "\tends\n";
- }
-}
-
/// doInitialization
bool X86SharedAsmPrinter::doInitialization(Module &M) {
if (Subtarget->isTargetDarwin()) {
FunctionPass *llvm::createX86CodePrinterPass(std::ostream &o,
X86TargetMachine &tm) {
const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
- TargetAsmInfo *TAI = new X86TargetAsmInfo(tm);
if (Subtarget->isFlavorIntel()) {
- return new X86IntelAsmPrinter(o, tm, TAI);
+ return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo());
} else {
- return new X86ATTAsmPrinter(o, tm, TAI);
+ return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo());
}
}
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineDebugInfo.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/Target/TargetAsmInfo.h"
#include <set>
extern Statistic<> EmittedInsts;
-struct VISIBILITY_HIDDEN X86TargetAsmInfo : public TargetAsmInfo {
- X86TargetAsmInfo(X86TargetMachine &TM);
-};
-
struct VISIBILITY_HIDDEN X86SharedAsmPrinter : public AsmPrinter {
DwarfWriter DW;
X86SharedAsmPrinter(std::ostream &O, X86TargetMachine &TM,
- TargetAsmInfo *T)
+ const TargetAsmInfo *T)
: AsmPrinter(O, TM, T), DW(O, this, T) {
Subtarget = &TM.getSubtarget<X86Subtarget>();
}
//===----------------------------------------------------------------------===//
#include "X86IntelAsmPrinter.h"
+#include "X86TargetAsmInfo.h"
#include "X86.h"
#include "llvm/Constants.h"
#include "llvm/Module.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/Mangler.h"
+#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
namespace llvm {
struct X86IntelAsmPrinter : public X86SharedAsmPrinter {
- X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM, TargetAsmInfo *T)
+ X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM,
+ const TargetAsmInfo *T)
: X86SharedAsmPrinter(O, TM, T) {
}
#include "X86InstrInfo.h"
#include "X86JITInfo.h"
#include "X86Subtarget.h"
+#include "X86TargetAsmInfo.h"
#include "X86ISelLowering.h"
namespace llvm {
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);