From af76e592c7f9deff0e55c13dbb4a34f07f1c7f64 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 22 Aug 2009 20:48:53 +0000 Subject: Rename TargetAsmInfo (and its subclasses) to MCAsmInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 6 +- lib/CodeGen/AsmPrinter/DIE.cpp | 8 +- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 +- lib/CodeGen/AsmPrinter/DwarfDebug.h | 4 +- lib/CodeGen/AsmPrinter/DwarfException.cpp | 24 ++-- lib/CodeGen/AsmPrinter/DwarfException.h | 4 +- lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 4 +- lib/CodeGen/AsmPrinter/DwarfPrinter.h | 8 +- lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 2 +- lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | 12 +- lib/CodeGen/ELFCodeEmitter.cpp | 2 +- lib/CodeGen/ELFWriter.cpp | 4 +- lib/CodeGen/ELFWriter.h | 4 +- lib/CodeGen/GCMetadataPrinter.cpp | 4 +- lib/CodeGen/LLVMTargetMachine.cpp | 6 +- lib/CodeGen/MachO.h | 4 +- lib/CodeGen/MachOCodeEmitter.cpp | 4 +- lib/CodeGen/MachOCodeEmitter.h | 2 +- lib/CodeGen/MachOWriter.cpp | 6 +- lib/CodeGen/MachOWriter.h | 4 +- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 +- lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp | 82 ++++++------- lib/MC/MCAsmStreamer.cpp | 8 +- lib/MC/MCSection.cpp | 4 +- lib/MC/MCSectionELF.cpp | 6 +- lib/MC/MCSectionMachO.cpp | 2 +- lib/Target/ARM/ARMBaseInstrInfo.cpp | 4 +- lib/Target/ARM/ARMInstrInfo.cpp | 2 +- lib/Target/ARM/ARMMCAsmInfo.cpp | 72 +++++++++++ lib/Target/ARM/ARMMCAsmInfo.h | 31 +++++ lib/Target/ARM/ARMTargetAsmInfo.cpp | 72 ----------- lib/Target/ARM/ARMTargetAsmInfo.h | 31 ----- lib/Target/ARM/ARMTargetMachine.cpp | 12 +- lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 6 +- lib/Target/Alpha/AlphaBranchSelector.cpp | 2 +- lib/Target/Alpha/AlphaMCAsmInfo.cpp | 22 ++++ lib/Target/Alpha/AlphaMCAsmInfo.h | 29 +++++ lib/Target/Alpha/AlphaTargetAsmInfo.cpp | 22 ---- lib/Target/Alpha/AlphaTargetAsmInfo.h | 29 ----- lib/Target/Alpha/AlphaTargetMachine.cpp | 4 +- lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp | 4 +- .../Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp | 4 +- lib/Target/Blackfin/BlackfinMCAsmInfo.cpp | 21 ++++ lib/Target/Blackfin/BlackfinMCAsmInfo.h | 29 +++++ lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp | 22 ---- lib/Target/Blackfin/BlackfinTargetAsmInfo.h | 29 ----- lib/Target/Blackfin/BlackfinTargetMachine.cpp | 4 +- lib/Target/CBackend/CBackend.cpp | 6 +- lib/Target/COFFTargetAsmInfo.cpp | 6 +- lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp | 6 +- lib/Target/CellSPU/SPUMCAsmInfo.cpp | 40 +++++++ lib/Target/CellSPU/SPUMCAsmInfo.h | 28 +++++ lib/Target/CellSPU/SPUTargetAsmInfo.cpp | 40 ------- lib/Target/CellSPU/SPUTargetAsmInfo.h | 28 ----- lib/Target/CellSPU/SPUTargetMachine.cpp | 4 +- lib/Target/DarwinTargetAsmInfo.cpp | 6 +- lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp | 4 +- lib/Target/MSP430/MSP430MCAsmInfo.cpp | 19 +++ lib/Target/MSP430/MSP430MCAsmInfo.h | 28 +++++ lib/Target/MSP430/MSP430TargetAsmInfo.cpp | 19 --- lib/Target/MSP430/MSP430TargetAsmInfo.h | 28 ----- lib/Target/MSP430/MSP430TargetMachine.cpp | 6 +- lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 4 +- lib/Target/Mips/MipsMCAsmInfo.cpp | 27 +++++ lib/Target/Mips/MipsMCAsmInfo.h | 30 +++++ lib/Target/Mips/MipsTargetAsmInfo.cpp | 27 ----- lib/Target/Mips/MipsTargetAsmInfo.h | 30 ----- lib/Target/Mips/MipsTargetMachine.cpp | 6 +- lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp | 6 +- lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h | 7 +- lib/Target/PIC16/MCSectionPIC16.h | 2 +- lib/Target/PIC16/PIC16DebugInfo.h | 6 +- lib/Target/PIC16/PIC16MCAsmInfo.cpp | 58 +++++++++ lib/Target/PIC16/PIC16MCAsmInfo.h | 35 ++++++ lib/Target/PIC16/PIC16MemSelOpt.cpp | 2 +- lib/Target/PIC16/PIC16TargetAsmInfo.cpp | 58 --------- lib/Target/PIC16/PIC16TargetAsmInfo.h | 35 ------ lib/Target/PIC16/PIC16TargetMachine.cpp | 4 +- lib/Target/PIC16/PIC16TargetObjectFile.cpp | 2 +- lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 10 +- lib/Target/PowerPC/PPCInstrInfo.cpp | 4 +- lib/Target/PowerPC/PPCMCAsmInfo.cpp | 58 +++++++++ lib/Target/PowerPC/PPCMCAsmInfo.h | 31 +++++ lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 58 --------- lib/Target/PowerPC/PPCTargetAsmInfo.h | 32 ----- lib/Target/PowerPC/PPCTargetMachine.cpp | 12 +- lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 4 +- lib/Target/Sparc/SparcMCAsmInfo.cpp | 29 +++++ lib/Target/Sparc/SparcMCAsmInfo.h | 28 +++++ lib/Target/Sparc/SparcTargetAsmInfo.cpp | 30 ----- lib/Target/Sparc/SparcTargetAsmInfo.h | 28 ----- lib/Target/Sparc/SparcTargetMachine.cpp | 4 +- .../SystemZ/AsmPrinter/SystemZAsmPrinter.cpp | 4 +- lib/Target/SystemZ/SystemZMCAsmInfo.cpp | 26 ++++ lib/Target/SystemZ/SystemZMCAsmInfo.h | 29 +++++ lib/Target/SystemZ/SystemZTargetAsmInfo.cpp | 27 ----- lib/Target/SystemZ/SystemZTargetAsmInfo.h | 29 ----- lib/Target/SystemZ/SystemZTargetMachine.cpp | 4 +- lib/Target/TargetAsmInfo.cpp | 12 +- lib/Target/TargetInstrInfo.cpp | 4 +- lib/Target/TargetMachine.cpp | 2 +- lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 4 +- lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h | 2 +- lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp | 2 +- lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 6 +- lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp | 4 +- lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h | 2 +- lib/Target/X86/X86InstrInfo.cpp | 4 +- lib/Target/X86/X86MCAsmInfo.cpp | 131 +++++++++++++++++++++ lib/Target/X86/X86MCAsmInfo.h | 42 +++++++ lib/Target/X86/X86RegisterInfo.cpp | 2 +- lib/Target/X86/X86TargetAsmInfo.cpp | 131 --------------------- lib/Target/X86/X86TargetAsmInfo.h | 42 ------- lib/Target/X86/X86TargetMachine.cpp | 16 +-- lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp | 4 +- lib/Target/XCore/MCSectionXCore.cpp | 2 +- lib/Target/XCore/MCSectionXCore.h | 2 +- lib/Target/XCore/XCoreMCAsmInfo.cpp | 31 +++++ lib/Target/XCore/XCoreMCAsmInfo.h | 29 +++++ lib/Target/XCore/XCoreTargetAsmInfo.cpp | 31 ----- lib/Target/XCore/XCoreTargetAsmInfo.h | 29 ----- lib/Target/XCore/XCoreTargetMachine.cpp | 4 +- 122 files changed, 1131 insertions(+), 1136 deletions(-) create mode 100644 lib/Target/ARM/ARMMCAsmInfo.cpp create mode 100644 lib/Target/ARM/ARMMCAsmInfo.h delete mode 100644 lib/Target/ARM/ARMTargetAsmInfo.cpp delete mode 100644 lib/Target/ARM/ARMTargetAsmInfo.h create mode 100644 lib/Target/Alpha/AlphaMCAsmInfo.cpp create mode 100644 lib/Target/Alpha/AlphaMCAsmInfo.h delete mode 100644 lib/Target/Alpha/AlphaTargetAsmInfo.cpp delete mode 100644 lib/Target/Alpha/AlphaTargetAsmInfo.h create mode 100644 lib/Target/Blackfin/BlackfinMCAsmInfo.cpp create mode 100644 lib/Target/Blackfin/BlackfinMCAsmInfo.h delete mode 100644 lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp delete mode 100644 lib/Target/Blackfin/BlackfinTargetAsmInfo.h create mode 100644 lib/Target/CellSPU/SPUMCAsmInfo.cpp create mode 100644 lib/Target/CellSPU/SPUMCAsmInfo.h delete mode 100644 lib/Target/CellSPU/SPUTargetAsmInfo.cpp delete mode 100644 lib/Target/CellSPU/SPUTargetAsmInfo.h create mode 100644 lib/Target/MSP430/MSP430MCAsmInfo.cpp create mode 100644 lib/Target/MSP430/MSP430MCAsmInfo.h delete mode 100644 lib/Target/MSP430/MSP430TargetAsmInfo.cpp delete mode 100644 lib/Target/MSP430/MSP430TargetAsmInfo.h create mode 100644 lib/Target/Mips/MipsMCAsmInfo.cpp create mode 100644 lib/Target/Mips/MipsMCAsmInfo.h delete mode 100644 lib/Target/Mips/MipsTargetAsmInfo.cpp delete mode 100644 lib/Target/Mips/MipsTargetAsmInfo.h create mode 100644 lib/Target/PIC16/PIC16MCAsmInfo.cpp create mode 100644 lib/Target/PIC16/PIC16MCAsmInfo.h delete mode 100644 lib/Target/PIC16/PIC16TargetAsmInfo.cpp delete mode 100644 lib/Target/PIC16/PIC16TargetAsmInfo.h create mode 100644 lib/Target/PowerPC/PPCMCAsmInfo.cpp create mode 100644 lib/Target/PowerPC/PPCMCAsmInfo.h delete mode 100644 lib/Target/PowerPC/PPCTargetAsmInfo.cpp delete mode 100644 lib/Target/PowerPC/PPCTargetAsmInfo.h create mode 100644 lib/Target/Sparc/SparcMCAsmInfo.cpp create mode 100644 lib/Target/Sparc/SparcMCAsmInfo.h delete mode 100644 lib/Target/Sparc/SparcTargetAsmInfo.cpp delete mode 100644 lib/Target/Sparc/SparcTargetAsmInfo.h create mode 100644 lib/Target/SystemZ/SystemZMCAsmInfo.cpp create mode 100644 lib/Target/SystemZ/SystemZMCAsmInfo.h delete mode 100644 lib/Target/SystemZ/SystemZTargetAsmInfo.cpp delete mode 100644 lib/Target/SystemZ/SystemZTargetAsmInfo.h create mode 100644 lib/Target/X86/X86MCAsmInfo.cpp create mode 100644 lib/Target/X86/X86MCAsmInfo.h delete mode 100644 lib/Target/X86/X86TargetAsmInfo.cpp delete mode 100644 lib/Target/X86/X86TargetAsmInfo.h create mode 100644 lib/Target/XCore/XCoreMCAsmInfo.cpp create mode 100644 lib/Target/XCore/XCoreMCAsmInfo.h delete mode 100644 lib/Target/XCore/XCoreTargetAsmInfo.cpp delete mode 100644 lib/Target/XCore/XCoreTargetAsmInfo.h (limited to 'lib') diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 8c2800ae2a..e71af5c754 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -32,7 +32,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" #include "llvm/Support/Mangler.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -50,7 +50,7 @@ AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *T, bool VDef) + const MCAsmInfo *T, bool VDef) : MachineFunctionPass(&ID), FunctionNumber(0), O(o), TM(tm), TAI(T), TRI(tm.getRegisterInfo()), @@ -1792,7 +1792,7 @@ Indent(formatted_raw_ostream &out, int level, int scale = 2) { /// static void PrintChildLoopComment(formatted_raw_ostream &O, const MachineLoop *loop, - const TargetAsmInfo *TAI, + const MCAsmInfo *TAI, int FunctionNumber) { // Add child loop information for(MachineLoop::iterator cl = loop->begin(), diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index a35ee285b3..3dbeef5ea6 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -14,7 +14,7 @@ #include "DIE.h" #include "DwarfPrinter.h" #include "llvm/CodeGen/AsmPrinter.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/ErrorHandling.h" #include @@ -224,8 +224,8 @@ unsigned DIEInteger::SizeOf(const TargetData *TD, unsigned Form) const { case dwarf::DW_FORM_data4: return sizeof(int32_t); case dwarf::DW_FORM_ref8: // Fall thru case dwarf::DW_FORM_data8: return sizeof(int64_t); - case dwarf::DW_FORM_udata: return TargetAsmInfo::getULEB128Size(Integer); - case dwarf::DW_FORM_sdata: return TargetAsmInfo::getSLEB128Size(Integer); + case dwarf::DW_FORM_udata: return MCAsmInfo::getULEB128Size(Integer); + case dwarf::DW_FORM_sdata: return MCAsmInfo::getSLEB128Size(Integer); default: llvm_unreachable("DIE Value form not supported yet"); break; } return 0; @@ -499,7 +499,7 @@ unsigned DIEBlock::SizeOf(const TargetData *TD, unsigned Form) const { case dwarf::DW_FORM_block1: return Size + sizeof(int8_t); case dwarf::DW_FORM_block2: return Size + sizeof(int16_t); case dwarf::DW_FORM_block4: return Size + sizeof(int32_t); - case dwarf::DW_FORM_block: return Size + TargetAsmInfo::getULEB128Size(Size); + case dwarf::DW_FORM_block: return Size + MCAsmInfo::getULEB128Size(Size); default: llvm_unreachable("Improper form for block"); break; } return 0; diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 66b340821c..ca7ea6bc95 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -17,7 +17,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/MC/MCSection.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -224,7 +224,7 @@ DbgScope::~DbgScope() { } // end llvm namespace -DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) +DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T) : Dwarf(OS, A, T, "dbg"), ModuleCU(0), AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(), ValuesSet(InitValuesSetSize), Values(), StringPool(), @@ -1794,7 +1794,7 @@ unsigned DwarfDebug::SizeAndOffsetDie(DIE *Die, unsigned Offset, bool Last) { Die->setOffset(Offset); // Start the size with the size of abbreviation code. - Offset += TargetAsmInfo::getULEB128Size(AbbrevNumber); + Offset += MCAsmInfo::getULEB128Size(AbbrevNumber); const SmallVector &Values = Die->getValues(); const SmallVector &AbbrevData = Abbrev->getData(); diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 0844f60911..bd7cdf70b5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -35,7 +35,7 @@ class DbgScope; class DbgConcreteScope; class MachineFrameInfo; class MachineModuleInfo; -class TargetAsmInfo; +class MCAsmInfo; class Timer; //===----------------------------------------------------------------------===// @@ -458,7 +458,7 @@ public: //===--------------------------------------------------------------------===// // Main entry points. // - DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T); + DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T); virtual ~DwarfDebug(); /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 81536894e0..cc575f5aff 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -18,7 +18,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineLocation.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -36,7 +36,7 @@ static TimerGroup &getDwarfTimerGroup() { } DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A, - const TargetAsmInfo *T) + const MCAsmInfo *T) : Dwarf(OS, A, T, "eh"), shouldEmitTable(false), shouldEmitMoves(false), shouldEmitTableModule(false), shouldEmitMovesModule(false), ExceptionTimer(0) { @@ -304,7 +304,7 @@ ComputeActionsTable(const SmallVectorImpl &LandingPads, for (std::vector::const_iterator I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) { FilterOffsets.push_back(Offset); - Offset -= TargetAsmInfo::getULEB128Size(*I); + Offset -= MCAsmInfo::getULEB128Size(*I); } FirstActions.reserve(LandingPads.size()); @@ -328,12 +328,12 @@ ComputeActionsTable(const SmallVectorImpl &LandingPads, const unsigned SizePrevIds = PrevLPI->TypeIds.size(); assert(Actions.size()); PrevAction = &Actions.back(); - SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) + - TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); + SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) + + MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); for (unsigned j = NumShared; j != SizePrevIds; ++j) { SizeAction -= - TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); + MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); SizeAction += -PrevAction->NextAction; PrevAction = PrevAction->Previous; } @@ -344,10 +344,10 @@ ComputeActionsTable(const SmallVectorImpl &LandingPads, int TypeID = TypeIds[J]; assert(-1 - TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; - unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID); + unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID); int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; - SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction); + SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction); SizeSiteActions += SizeAction; ActionEntry Action = { ValueForTypeID, NextAction, PrevAction }; @@ -556,22 +556,22 @@ void DwarfException::EmitExceptionTable() { SizeSites = CallSites.size() * (SiteStartSize + SiteLengthSize + LandingPadSize); for (unsigned i = 0, e = CallSites.size(); i < e; ++i) { - SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action); + SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action); if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj) - SizeSites += TargetAsmInfo::getULEB128Size(i); + SizeSites += MCAsmInfo::getULEB128Size(i); } // Type infos. const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr unsigned SizeTypes = TypeInfos.size() * TypeInfoSize; unsigned TypeOffset = sizeof(int8_t) + // Call site format - TargetAsmInfo::getULEB128Size(SizeSites) + // Call-site table length + MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length SizeSites + SizeActions + SizeTypes; unsigned TotalSize = sizeof(int8_t) + // LPStart format sizeof(int8_t) + // TType format (HaveTTData ? - TargetAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset + MCAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset TypeOffset; unsigned SizeAlign = (4 - TotalSize) & 3; diff --git a/lib/CodeGen/AsmPrinter/DwarfException.h b/lib/CodeGen/AsmPrinter/DwarfException.h index e165df4693..5f4fda7502 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.h +++ b/lib/CodeGen/AsmPrinter/DwarfException.h @@ -24,7 +24,7 @@ namespace llvm { struct LandingPadInfo; class MachineModuleInfo; -class TargetAsmInfo; +class MCAsmInfo; class Timer; class raw_ostream; @@ -164,7 +164,7 @@ public: //===--------------------------------------------------------------------===// // Main entry points. // - DwarfException(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T); + DwarfException(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T); virtual ~DwarfException(); /// BeginModule - Emit all exception information that should come prior to the diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index cc05b53626..1c72f5ae68 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -19,14 +19,14 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetRegisterInfo.h" using namespace llvm; -Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T, +Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T, const char *flavor) : O(OS), Asm(A), TAI(T), TD(Asm->TM.getTargetData()), RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL), diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/lib/CodeGen/AsmPrinter/DwarfPrinter.h index 6e75992cb0..490544b340 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.h +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.h @@ -25,7 +25,7 @@ namespace llvm { class MachineFunction; class MachineModuleInfo; class Module; - class TargetAsmInfo; + class MCAsmInfo; class TargetData; class TargetRegisterInfo; @@ -45,7 +45,7 @@ namespace llvm { /// TAI - Target asm information. /// - const TargetAsmInfo *TAI; + const MCAsmInfo *TAI; /// TD - Target data. /// @@ -80,7 +80,7 @@ namespace llvm { /// unsigned SetCounter; - Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T, + Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T, const char *flavor); public: //===------------------------------------------------------------------===// @@ -88,7 +88,7 @@ namespace llvm { // const AsmPrinter *getAsm() const { return Asm; } MachineModuleInfo *getMMI() const { return MMI; } - const TargetAsmInfo *getTargetAsmInfo() const { return TAI; } + const MCAsmInfo *getMCAsmInfo() const { return TAI; } const TargetData *getTargetData() const { return TD; } void PrintRelDirective(bool Force32Bit = false, diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index fac1081eec..440b91c89e 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -39,7 +39,7 @@ DwarfWriter::~DwarfWriter() { void DwarfWriter::BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS, AsmPrinter *A, - const TargetAsmInfo *T) { + const MCAsmInfo *T) { DE = new DwarfException(OS, A, T); DD = new DwarfDebug(OS, A, T); DE->BeginModule(M, MMI); diff --git a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp index af3bbc96e5..fac3db2a46 100644 --- a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp @@ -16,7 +16,7 @@ #include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/Module.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -30,10 +30,10 @@ namespace { class VISIBILITY_HIDDEN OcamlGCMetadataPrinter : public GCMetadataPrinter { public: void beginAssembly(raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI); + const MCAsmInfo &TAI); void finishAssembly(raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI); + const MCAsmInfo &TAI); }; } @@ -44,7 +44,7 @@ Y("ocaml", "ocaml 3.10-compatible collector"); void llvm::linkOcamlGCPrinter() { } static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI, const char *Id) { + const MCAsmInfo &TAI, const char *Id) { const std::string &MId = M.getModuleIdentifier(); std::string Mangled; @@ -64,7 +64,7 @@ static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, } void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI) { + const MCAsmInfo &TAI) { AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin"); @@ -89,7 +89,7 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, /// either condition is detected in a function which uses the GC. /// void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI) { + const MCAsmInfo &TAI) { const char *AddressDirective; int AddressAlignLog; if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) { diff --git a/lib/CodeGen/ELFCodeEmitter.cpp b/lib/CodeGen/ELFCodeEmitter.cpp index b769e70ed2..a6429f7000 100644 --- a/lib/CodeGen/ELFCodeEmitter.cpp +++ b/lib/CodeGen/ELFCodeEmitter.cpp @@ -23,7 +23,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetELFWriterInfo.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp index 55c35a46bf..f2b45cd7c6 100644 --- a/lib/CodeGen/ELFWriter.cpp +++ b/lib/CodeGen/ELFWriter.cpp @@ -44,7 +44,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCSectionELF.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetELFWriterInfo.h" #include "llvm/Target/TargetLowering.h" @@ -80,7 +80,7 @@ ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) isLittleEndian(TM.getTargetData()->isLittleEndian()), ElfHdr(isLittleEndian, is64Bit) { - TAI = TM.getTargetAsmInfo(); + TAI = TM.getMCAsmInfo(); TEW = TM.getELFWriterInfo(); // Create the object code emitter object for this target. diff --git a/lib/CodeGen/ELFWriter.h b/lib/CodeGen/ELFWriter.h index 2f8f625d96..1e438929c0 100644 --- a/lib/CodeGen/ELFWriter.h +++ b/lib/CodeGen/ELFWriter.h @@ -32,7 +32,7 @@ namespace llvm { class MachineCodeEmitter; class MachineConstantPoolEntry; class ObjectCodeEmitter; - class TargetAsmInfo; + class MCAsmInfo; class TargetELFWriterInfo; class TargetLoweringObjectFile; class raw_ostream; @@ -88,7 +88,7 @@ namespace llvm { /// TAI - Target Asm Info, provide information about section names for /// globals and other target specific stuff. - const TargetAsmInfo *TAI; + const MCAsmInfo *TAI; //===------------------------------------------------------------------===// // Properties inferred automatically from the target machine. diff --git a/lib/CodeGen/GCMetadataPrinter.cpp b/lib/CodeGen/GCMetadataPrinter.cpp index 5a5ef84fa4..d1e43d8e92 100644 --- a/lib/CodeGen/GCMetadataPrinter.cpp +++ b/lib/CodeGen/GCMetadataPrinter.cpp @@ -20,11 +20,11 @@ GCMetadataPrinter::GCMetadataPrinter() { } GCMetadataPrinter::~GCMetadataPrinter() { } void GCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI) { + const MCAsmInfo &TAI) { // Default is no action. } void GCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, - const TargetAsmInfo &TAI) { + const MCAsmInfo &TAI) { // Default is no action. } diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 911e9a13ef..adce1f30b3 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -20,7 +20,7 @@ #include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/MachineFunctionAnalysis.h" #include "llvm/Target/TargetOptions.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Support/CommandLine.h" @@ -108,7 +108,7 @@ bool LLVMTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Verbose, formatted_raw_ostream &Out) { FunctionPass *Printer = - getTarget().createAsmPrinter(Out, *this, getTargetAsmInfo(), Verbose); + getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(), Verbose); if (!Printer) return true; @@ -239,7 +239,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, // Turn exception handling constructs into something the code generators can // handle. - switch (getTargetAsmInfo()->getExceptionHandlingType()) + switch (getMCAsmInfo()->getExceptionHandlingType()) { case ExceptionHandling::SjLj: // SjLj piggy-backs on dwarf for this bit. The cleanups done apply to both diff --git a/lib/CodeGen/MachO.h b/lib/CodeGen/MachO.h index 247b4a6c0c..cf8bbbf8fa 100644 --- a/lib/CodeGen/MachO.h +++ b/lib/CodeGen/MachO.h @@ -21,7 +21,7 @@ namespace llvm { class GlobalValue; -class TargetAsmInfo; +class MCAsmInfo; /// MachOSym - This struct contains information about each symbol that is /// added to logical symbol table for the module. This is eventually @@ -68,7 +68,7 @@ struct MachOSym { }; MachOSym(const GlobalValue *gv, std::string name, uint8_t sect, - const TargetAsmInfo *TAI); + const MCAsmInfo *TAI); struct SymCmp { // FIXME: this does not appear to be sorting 'f' after 'F' diff --git a/lib/CodeGen/MachOCodeEmitter.cpp b/lib/CodeGen/MachOCodeEmitter.cpp index f8852dc451..f87d1eb8a2 100644 --- a/lib/CodeGen/MachOCodeEmitter.cpp +++ b/lib/CodeGen/MachOCodeEmitter.cpp @@ -17,7 +17,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineRelocation.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/ErrorHandling.h" @@ -35,7 +35,7 @@ MachOCodeEmitter::MachOCodeEmitter(MachOWriter &mow, MachOSection &mos) : ObjectCodeEmitter(&mos), MOW(mow), TM(MOW.TM) { is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; isLittleEndian = TM.getTargetData()->isLittleEndian(); - TAI = TM.getTargetAsmInfo(); + TAI = TM.getMCAsmInfo(); } /// startFunction - This callback is invoked when a new machine function is diff --git a/lib/CodeGen/MachOCodeEmitter.h b/lib/CodeGen/MachOCodeEmitter.h index 96ba68f1db..0e1a0ec19b 100644 --- a/lib/CodeGen/MachOCodeEmitter.h +++ b/lib/CodeGen/MachOCodeEmitter.h @@ -30,7 +30,7 @@ class MachOCodeEmitter : public ObjectCodeEmitter { /// machine directly, indicating what header values and flags to set. bool is64Bit, isLittleEndian; - const TargetAsmInfo *TAI; + const MCAsmInfo *TAI; /// Relocations - These are the relocations that the function needs, as /// emitted. diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp index 0ce9044e85..6b7441e165 100644 --- a/lib/CodeGen/MachOWriter.cpp +++ b/lib/CodeGen/MachOWriter.cpp @@ -29,7 +29,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachOWriterInfo.h" @@ -61,7 +61,7 @@ MachOWriter::MachOWriter(raw_ostream &o, TargetMachine &tm) is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; isLittleEndian = TM.getTargetData()->isLittleEndian(); - TAI = TM.getTargetAsmInfo(); + TAI = TM.getMCAsmInfo(); // Create the machine code emitter object for this target. MachOCE = new MachOCodeEmitter(*this, *getTextSection(true)); @@ -743,7 +743,7 @@ void MachOWriter::InitMem(const Constant *C, uintptr_t Offset, //===----------------------------------------------------------------------===// MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect, - const TargetAsmInfo *TAI) : + const MCAsmInfo *TAI) : GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect), n_desc(0), n_value(0) { diff --git a/lib/CodeGen/MachOWriter.h b/lib/CodeGen/MachOWriter.h index 9d8e9d450b..0d6f1328f4 100644 --- a/lib/CodeGen/MachOWriter.h +++ b/lib/CodeGen/MachOWriter.h @@ -31,7 +31,7 @@ namespace llvm { struct MachOSym; class TargetData; class TargetMachine; - class TargetAsmInfo; + class MCAsmInfo; class ObjectCodeEmitter; class OutputBuffer; class raw_ostream; @@ -78,7 +78,7 @@ namespace llvm { bool is64Bit, isLittleEndian; // Target Asm Info - const TargetAsmInfo *TAI; + const MCAsmInfo *TAI; /// Header - An instance of MachOHeader that we will update while we build /// the file, and then emit during finalization. diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 6fcc3fdcd0..e60a945580 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Target/TargetLowering.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -530,7 +530,7 @@ TargetLowering::TargetLowering(TargetMachine &tm,TargetLoweringObjectFile *tlof) InitLibcallCallingConvs(LibcallCallingConvs); // Tell Legalize whether the assembler supports DEBUG_LOC. - const TargetAsmInfo *TASM = TM.getTargetAsmInfo(); + const MCAsmInfo *TASM = TM.getMCAsmInfo(); if (!TASM || !TASM->hasDotLocAndDotFile()) setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); } diff --git a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp index a3a050635f..f7fb983e1a 100644 --- a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp @@ -22,7 +22,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/ExecutionEngine/JITMemoryManager.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetFrameInfo.h" @@ -40,7 +40,7 @@ unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F, unsigned char* EndFunction) { const TargetMachine& TM = F.getTarget(); TD = TM.getTargetData(); - needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding(); + needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding(); stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); RI = TM.getRegisterInfo(); JCE = &jce; @@ -242,7 +242,7 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF, for(std::vector::const_iterator I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) { FilterOffsets.push_back(Offset); - Offset -= TargetAsmInfo::getULEB128Size(*I); + Offset -= MCAsmInfo::getULEB128Size(*I); } // Compute the actions table and gather the first action index for each @@ -267,10 +267,10 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF, const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size(); assert(Actions.size()); PrevAction = &Actions.back(); - SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) + - TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); + SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) + + MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); for (unsigned j = NumShared; j != SizePrevIds; ++j) { - SizeAction -= TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); + SizeAction -= MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); SizeAction += -PrevAction->NextAction; PrevAction = PrevAction->Previous; } @@ -281,10 +281,10 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF, int TypeID = TypeIds[I]; assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; - unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID); + unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID); int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; - SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction); + SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction); SizeSiteActions += SizeAction; ActionEntry Action = {ValueForTypeID, NextAction, PrevAction}; @@ -387,13 +387,13 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF, sizeof(int32_t) + // Site length. sizeof(int32_t)); // Landing pad. for (unsigned i = 0, e = CallSites.size(); i < e; ++i) - SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action); + SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action); unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize(); unsigned TypeOffset = sizeof(int8_t) + // Call site format // Call-site table length - TargetAsmInfo::getULEB128Size(SizeSites) + + MCAsmInfo::getULEB128Size(SizeSites) + SizeSites + SizeActions + SizeTypes; // Begin the exception table. @@ -607,7 +607,7 @@ unsigned JITDwarfEmitter::GetDwarfTableSizeInBytes(MachineFunction& F, unsigned char* EndFunction) { const TargetMachine& TM = F.getTarget(); TD = TM.getTargetData(); - needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding(); + needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding(); stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); RI = TM.getRegisterInfo(); JCE = &jce; @@ -645,10 +645,10 @@ JITDwarfEmitter::GetEHFrameSizeInBytes(const Function* Personality, // If there is a personality and landing pads then point to the language // specific data area in the exception table. if (MMI->getPersonalityIndex()) { - FinalSize += TargetAsmInfo::getULEB128Size(4); + FinalSize += MCAsmInfo::getULEB128Size(4); FinalSize += PointerSize; } else { - FinalSize += TargetAsmInfo::getULEB128Size(0); + FinalSize += MCAsmInfo::getULEB128Size(0); } // Indicate locations of function specific callee saved registers in @@ -676,24 +676,24 @@ unsigned JITDwarfEmitter::GetCommonEHFrameSizeInBytes(const Function* Personalit FinalSize += 4; FinalSize += 1; FinalSize += Personality ? 5 : 3; // "zPLR" or "zR" - FinalSize += TargetAsmInfo::getULEB128Size(1); - FinalSize += TargetAsmInfo::getSLEB128Size(stackGrowth); + FinalSize += MCAsmInfo::getULEB128Size(1); + FinalSize += MCAsmInfo::getSLEB128Size(stackGrowth); FinalSize += 1; if (Personality) { - FinalSize += TargetAsmInfo::getULEB128Size(7); + FinalSize += MCAsmInfo::getULEB128Size(7); // Encoding FinalSize+= 1; //Personality FinalSize += PointerSize; - FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); - FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); + FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); + FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); } else { - FinalSize += TargetAsmInfo::getULEB128Size(1); - FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); + FinalSize += MCAsmInfo::getULEB128Size(1); + FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); } std::vector Moves; @@ -745,12 +745,12 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr, } else { ++FinalSize; unsigned RegNum = RI->getDwarfRegNum(Src.getReg(), true); - FinalSize += TargetAsmInfo::getULEB128Size(RegNum); + FinalSize += MCAsmInfo::getULEB128Size(RegNum); } int Offset = -Src.getOffset(); - FinalSize += TargetAsmInfo::getULEB128Size(Offset); + FinalSize += MCAsmInfo::getULEB128Size(Offset); } else { llvm_unreachable("Machine move no supported yet."); } @@ -759,7 +759,7 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr, if (Dst.isReg()) { ++FinalSize; unsigned RegNum = RI->getDwarfRegNum(Dst.getReg(), true); - FinalSize += TargetAsmInfo::getULEB128Size(RegNum); + FinalSize += MCAsmInfo::getULEB128Size(RegNum); } else { llvm_unreachable("Machine move no supported yet."); } @@ -769,15 +769,15 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr, if (Offset < 0) { ++FinalSize; - FinalSize += TargetAsmInfo::getULEB128Size(Reg); - FinalSize += TargetAsmInfo::getSLEB128Size(Offset); + FinalSize += MCAsmInfo::getULEB128Size(Reg); + FinalSize += MCAsmInfo::getSLEB128Size(Offset); } else if (Reg < 64) { ++FinalSize; - FinalSize += TargetAsmInfo::getULEB128Size(Offset); + FinalSize += MCAsmInfo::getULEB128Size(Offset); } else { ++FinalSize; - FinalSize += TargetAsmInfo::getULEB128Size(Reg); - FinalSize += TargetAsmInfo::getULEB128Size(Offset); + FinalSize += MCAsmInfo::getULEB128Size(Reg); + FinalSize += MCAsmInfo::getULEB128Size(Offset); } } } @@ -820,7 +820,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { for(std::vector::const_iterator I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) { FilterOffsets.push_back(Offset); - Offset -= TargetAsmInfo::getULEB128Size(*I); + Offset -= MCAsmInfo::getULEB128Size(*I); } // Compute the actions table and gather the first action index for each @@ -845,10 +845,10 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size(); assert(Actions.size()); PrevAction = &Actions.back(); - SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) + - TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); + SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) + + MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); for (unsigned j = NumShared; j != SizePrevIds; ++j) { - SizeAction -= TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); + SizeAction -= MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); SizeAction += -PrevAction->NextAction; PrevAction = PrevAction->Previous; } @@ -859,10 +859,10 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { int TypeID = TypeIds[I]; assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; - unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID); + unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID); int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; - SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction); + SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction); SizeSiteActions += SizeAction; ActionEntry Action = {ValueForTypeID, NextAction, PrevAction}; @@ -965,18 +965,18 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { sizeof(int32_t) + // Site length. sizeof(int32_t)); // Landing pad. for (unsigned i = 0, e = CallSites.size(); i < e; ++i) - SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action); + SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action); unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize(); unsigned TypeOffset = sizeof(int8_t) + // Call site format // Call-site table length - TargetAsmInfo::getULEB128Size(SizeSites) + + MCAsmInfo::getULEB128Size(SizeSites) + SizeSites + SizeActions + SizeTypes; unsigned TotalSize = sizeof(int8_t) + // LPStart format sizeof(int8_t) + // TType format - TargetAsmInfo::getULEB128Size(TypeOffset) + // TType base offset + MCAsmInfo::getULEB128Size(TypeOffset) + // TType base offset TypeOffset; unsigned SizeAlign = (4 - TotalSize) & 3; @@ -1014,7 +1014,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { // Asm->EOL("Landing pad"); FinalSize += PointerSize; - FinalSize += TargetAsmInfo::getULEB128Size(S.Action); + FinalSize += MCAsmInfo::getULEB128Size(S.Action); // Asm->EOL("Action"); } @@ -1023,9 +1023,9 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { ActionEntry &Action = Actions[I]; //Asm->EOL("TypeInfo index"); - FinalSize += TargetAsmInfo::getSLEB128Size(Action.ValueForTypeID); + FinalSize += MCAsmInfo::getSLEB128Size(Action.ValueForTypeID); //Asm->EOL("Next action"); - FinalSize += TargetAsmInfo::getSLEB128Size(Action.NextAction); + FinalSize += MCAsmInfo::getSLEB128Size(Action.NextAction); } // Emit the type ids. @@ -1037,7 +1037,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const { // Emit the filter typeids. for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) { unsigned TypeID = FilterIds[j]; - FinalSize += TargetAsmInfo::getULEB128Size(TypeID); + FinalSize += MCAsmInfo::getULEB128Size(TypeID); //Asm->EOL("Filter TypeInfo index"); } diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 655137d580..32460c2b85 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -14,7 +14,7 @@ #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCValue.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" @@ -24,10 +24,10 @@ namespace { class MCAsmStreamer : public MCStreamer { raw_ostream &OS; - const TargetAsmInfo &TAI; + const MCAsmInfo &TAI; AsmPrinter *Printer; public: - MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const TargetAsmInfo &tai, + MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const MCAsmInfo &tai, AsmPrinter *_AsmPrinter) : MCStreamer(Context), OS(_OS), TAI(tai), Printer(_AsmPrinter) {} ~MCAsmStreamer() {} @@ -314,6 +314,6 @@ void MCAsmStreamer::Finish() { } MCStreamer *llvm::createAsmStreamer(MCContext &Context, raw_ostream &OS, - const TargetAsmInfo &TAI, AsmPrinter *AP) { + const MCAsmInfo &TAI, AsmPrinter *AP) { return new MCAsmStreamer(Context, OS, TAI, AP); } diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index 3e837635f2..1f2896b7cc 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -9,7 +9,7 @@ #include "llvm/MC/MCSection.h" #include "llvm/MC/MCContext.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -29,7 +29,7 @@ Create(const StringRef &Name, bool IsDirective, SectionKind K, MCContext &Ctx) { return new (Ctx) MCSectionCOFF(Name, IsDirective, K); } -void MCSectionCOFF::PrintSwitchToSection(const TargetAsmInfo &TAI, +void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &TAI, raw_ostream &OS) const { if (isDirective()) { diff --git a/lib/MC/MCSectionELF.cpp b/lib/MC/MCSectionELF.cpp index fe0fcb3a06..96f8429ad9 100644 --- a/lib/MC/MCSectionELF.cpp +++ b/lib/MC/MCSectionELF.cpp @@ -10,7 +10,7 @@ #include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCContext.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" using namespace llvm; @@ -23,7 +23,7 @@ Create(const StringRef &Section, unsigned Type, unsigned Flags, // ShouldOmitSectionDirective - Decides whether a '.section' directive // should be printed before the section name bool MCSectionELF::ShouldOmitSectionDirective(const char *Name, - const TargetAsmInfo &TAI) const { + const MCAsmInfo &TAI) const { // FIXME: Does .section .bss/.data/.text work everywhere?? if (strcmp(Name, ".text") == 0 || @@ -44,7 +44,7 @@ bool MCSectionELF::ShouldPrintSectionType(unsigned Ty) const { return true; } -void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI, +void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &TAI, raw_ostream &OS) const { if (ShouldOmitSectionDirective(SectionName.c_str(), TAI)) { diff --git a/lib/MC/MCSectionMachO.cpp b/lib/MC/MCSectionMachO.cpp index 0cdffc85e8..5615398737 100644 --- a/lib/MC/MCSectionMachO.cpp +++ b/lib/MC/MCSectionMachO.cpp @@ -72,7 +72,7 @@ Create(const StringRef &Segment, const StringRef &Section, Reserved2, K); } -void MCSectionMachO::PrintSwitchToSection(const TargetAsmInfo &TAI, +void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &TAI, raw_ostream &OS) const { OS << "\t.section\t" << getSegmentName() << ',' << getSectionName(); diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index 44e5c687b2..2362e77621 100644 --- a/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -21,7 +21,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" using namespace llvm; @@ -405,7 +405,7 @@ static unsigned getNumJTEntries(const std::vector &JT, unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { const MachineBasicBlock &MBB = *MI->getParent(); const MachineFunction *MF = MBB.getParent(); - const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo(); + const MCAsmInfo *TAI = MF->getTarget().getMCAsmInfo(); // Basic size info comes from the TSFlags field. const TargetInstrDesc &TID = MI->getDesc(); diff --git a/lib/Target/ARM/ARMInstrInfo.cpp b/lib/Target/ARM/ARMInstrInfo.cpp index 71fce8c6ed..4c92891c82 100644 --- a/lib/Target/ARM/ARMInstrInfo.cpp +++ b/lib/Target/ARM/ARMInstrInfo.cpp @@ -21,7 +21,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/CommandLine.h" using namespace llvm; diff --git a/lib/Target/ARM/ARMMCAsmInfo.cpp b/lib/Target/ARM/ARMMCAsmInfo.cpp new file mode 100644 index 0000000000..ed6f6b2b39 --- /dev/null +++ b/lib/Target/ARM/ARMMCAsmInfo.cpp @@ -0,0 +1,72 @@ +//===-- ARMMCAsmInfo.cpp - ARM asm properties -------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the ARMMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "ARMMCAsmInfo.h" +using namespace llvm; + +static const char *const arm_asm_table[] = { + "{r0}", "r0", + "{r1}", "r1", + "{r2}", "r2", + "{r3}", "r3", + "{r4}", "r4", + "{r5}", "r5", + "{r6}", "r6", + "{r7}", "r7", + "{r8}", "r8", + "{r9}", "r9", + "{r10}", "r10", + "{r11}", "r11", + "{r12}", "r12", + "{r13}", "r13", + "{r14}", "r14", + "{lr}", "lr", + "{sp}", "sp", + "{ip}", "ip", + "{fp}", "fp", + "{sl}", "sl", + "{memory}", "memory", + "{cc}", "cc", + 0,0 +}; + +ARMDarwinMCAsmInfo::ARMDarwinMCAsmInfo() { + AsmTransCBE = arm_asm_table; + Data64bitsDirective = 0; + CommentString = "@"; + COMMDirectiveTakesAlignment = false; + SupportsDebugInformation = true; + + // Exceptions handling + ExceptionsType = ExceptionHandling::SjLj; + AbsoluteEHSectionOffsets = false; +} + +ARMELFMCAsmInfo::ARMELFMCAsmInfo() { + AlignmentIsInBytes = false; + Data64bitsDirective = 0; + CommentString = "@"; + COMMDirectiveTakesAlignment = false; + + NeedsSet = false; + HasLEB128 = true; + AbsoluteDebugSectionOffsets = true; + PrivateGlobalPrefix = ".L"; + WeakRefDirective = "\t.weak\t"; + SetDirective = "\t.set\t"; + LCOMMDirective = "\t.lcomm\t"; + + DwarfRequiresFrameSection = false; + + SupportsDebugInformation = true; +} diff --git a/lib/Target/ARM/ARMMCAsmInfo.h b/lib/Target/ARM/ARMMCAsmInfo.h new file mode 100644 index 0000000000..e263ece1ac --- /dev/null +++ b/lib/Target/ARM/ARMMCAsmInfo.h @@ -0,0 +1,31 @@ +//=====-- ARMMCAsmInfo.h - ARM asm properties -------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the ARMMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ARMTARGETASMINFO_H +#define LLVM_ARMTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfoDarwin.h" + +namespace llvm { + + struct ARMDarwinMCAsmInfo : public DarwinMCAsmInfo { + explicit ARMDarwinMCAsmInfo(); + }; + + struct ARMELFMCAsmInfo : public MCAsmInfo { + explicit ARMELFMCAsmInfo(); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp deleted file mode 100644 index 0c3df82bfe..0000000000 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the ARMTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "ARMTargetAsmInfo.h" -using namespace llvm; - -static const char *const arm_asm_table[] = { - "{r0}", "r0", - "{r1}", "r1", - "{r2}", "r2", - "{r3}", "r3", - "{r4}", "r4", - "{r5}", "r5", - "{r6}", "r6", - "{r7}", "r7", - "{r8}", "r8", - "{r9}", "r9", - "{r10}", "r10", - "{r11}", "r11", - "{r12}", "r12", - "{r13}", "r13", - "{r14}", "r14", - "{lr}", "lr", - "{sp}", "sp", - "{ip}", "ip", - "{fp}", "fp", - "{sl}", "sl", - "{memory}", "memory", - "{cc}", "cc", - 0,0 -}; - -ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() { - AsmTransCBE = arm_asm_table; - Data64bitsDirective = 0; - CommentString = "@"; - COMMDirectiveTakesAlignment = false; - SupportsDebugInformation = true; - - // Exceptions handling - ExceptionsType = ExceptionHandling::SjLj; - AbsoluteEHSectionOffsets = false; -} - -ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() { - AlignmentIsInBytes = false; - Data64bitsDirective = 0; - CommentString = "@"; - COMMDirectiveTakesAlignment = false; - - NeedsSet = false; - HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; - PrivateGlobalPrefix = ".L"; - WeakRefDirective = "\t.weak\t"; - SetDirective = "\t.set\t"; - LCOMMDirective = "\t.lcomm\t"; - - DwarfRequiresFrameSection = false; - - SupportsDebugInformation = true; -} diff --git a/lib/Target/ARM/ARMTargetAsmInfo.h b/lib/Target/ARM/ARMTargetAsmInfo.h deleted file mode 100644 index 3fde8ba630..0000000000 --- a/lib/Target/ARM/ARMTargetAsmInfo.h +++ /dev/null @@ -1,31 +0,0 @@ -//=====-- ARMTargetAsmInfo.h - ARM asm properties -------------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the ARMTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ARMTARGETASMINFO_H -#define LLVM_ARMTARGETASMINFO_H - -#include "llvm/Target/DarwinTargetAsmInfo.h" - -namespace llvm { - - struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo { - explicit ARMDarwinTargetAsmInfo(); - }; - - struct ARMELFTargetAsmInfo : public TargetAsmInfo { - explicit ARMELFTargetAsmInfo(); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index fdfa3a32e5..ae5107aff2 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "ARMTargetMachine.h" -#include "ARMTargetAsmInfo.h" +#include "ARMMCAsmInfo.h" #include "ARMFrameInfo.h" #include "ARM.h" #include "llvm/PassManager.h" @@ -27,14 +27,14 @@ static cl::opt DisableLdStOpti("disable-arm-loadstore-opti", cl::Hidden, static cl::opt DisableIfConversion("disable-arm-if-conversion",cl::Hidden, cl::desc("Disable if-conversion pass")); -static const TargetAsmInfo *createTargetAsmInfo(const Target &T, +static const MCAsmInfo *createMCAsmInfo(const Target &T, const StringRef &TT) { Triple TheTriple(TT); switch (TheTriple.getOS()) { case Triple::Darwin: - return new ARMDarwinTargetAsmInfo(); + return new ARMDarwinMCAsmInfo(); default: - return new ARMELFTargetAsmInfo(); + return new ARMELFMCAsmInfo(); } } @@ -45,8 +45,8 @@ extern "C" void LLVMInitializeARMTarget() { RegisterTargetMachine Y(TheThumbTarget); // Register the target asm info. - RegisterAsmInfoFn A(TheARMTarget, createTargetAsmInfo); - RegisterAsmInfoFn B(TheThumbTarget, createTargetAsmInfo); + RegisterAsmInfoFn A(TheARMTarget, createMCAsmInfo); + RegisterAsmInfoFn B(TheThumbTarget, createMCAsmInfo); } /// TargetMachine ctor - Create an ARM architecture model. diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 4b0f92f6ce..1b36b21643 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -29,7 +29,7 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -111,7 +111,7 @@ namespace { bool InCPMode; public: explicit ARMAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL), InCPMode(false) { Subtarget = &TM.getSubtarget(); @@ -423,7 +423,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum, } static void printSOImm(formatted_raw_ostream &O, int64_t V, bool VerboseAsm, - const TargetAsmInfo *TAI) { + const MCAsmInfo *TAI) { // Break it up into two parts that make up a shifter immediate. V = ARM_AM::getSOImmVal(V); assert(V != -1 && "Not a valid so_imm value!"); diff --git a/lib/Target/Alpha/AlphaBranchSelector.cpp b/lib/Target/Alpha/AlphaBranchSelector.cpp index aca8ca7348..719ffaec3e 100644 --- a/lib/Target/Alpha/AlphaBranchSelector.cpp +++ b/lib/Target/Alpha/AlphaBranchSelector.cpp @@ -17,7 +17,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Support/Compiler.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" using namespace llvm; namespace { diff --git a/lib/Target/Alpha/AlphaMCAsmInfo.cpp b/lib/Target/Alpha/AlphaMCAsmInfo.cpp new file mode 100644 index 0000000000..b652a5305a --- /dev/null +++ b/lib/Target/Alpha/AlphaMCAsmInfo.cpp @@ -0,0 +1,22 @@ +//===-- AlphaMCAsmInfo.cpp - Alpha asm properties ---------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the AlphaMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "AlphaMCAsmInfo.h" +using namespace llvm; + +AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) { + AlignmentIsInBytes = false; + PrivateGlobalPrefix = "$"; + PICJumpTableDirective = ".gprel32"; + WeakRefDirective = "\t.weak\t"; +} diff --git a/lib/Target/Alpha/AlphaMCAsmInfo.h b/lib/Target/Alpha/AlphaMCAsmInfo.h new file mode 100644 index 0000000000..c27065d284 --- /dev/null +++ b/lib/Target/Alpha/AlphaMCAsmInfo.h @@ -0,0 +1,29 @@ +//=====-- AlphaMCAsmInfo.h - Alpha asm properties -------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the AlphaMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef ALPHATARGETASMINFO_H +#define ALPHATARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + + struct AlphaMCAsmInfo : public MCAsmInfo { + explicit AlphaMCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/Alpha/AlphaTargetAsmInfo.cpp b/lib/Target/Alpha/AlphaTargetAsmInfo.cpp deleted file mode 100644 index ebb89ecf52..0000000000 --- a/lib/Target/Alpha/AlphaTargetAsmInfo.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===-- AlphaTargetAsmInfo.cpp - Alpha asm properties -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the AlphaTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "AlphaTargetAsmInfo.h" -using namespace llvm; - -AlphaTargetAsmInfo::AlphaTargetAsmInfo(const Target &T, const StringRef &TT) { - AlignmentIsInBytes = false; - PrivateGlobalPrefix = "$"; - PICJumpTableDirective = ".gprel32"; - WeakRefDirective = "\t.weak\t"; -} diff --git a/lib/Target/Alpha/AlphaTargetAsmInfo.h b/lib/Target/Alpha/AlphaTargetAsmInfo.h deleted file mode 100644 index 20903c730f..0000000000 --- a/lib/Target/Alpha/AlphaTargetAsmInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -//=====-- AlphaTargetAsmInfo.h - Alpha asm properties ---------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the AlphaTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef ALPHATARGETASMINFO_H -#define ALPHATARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - - struct AlphaTargetAsmInfo : public TargetAsmInfo { - explicit AlphaTargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp index 19218704a6..b8bc13b630 100644 --- a/lib/Target/Alpha/AlphaTargetMachine.cpp +++ b/lib/Target/Alpha/AlphaTargetMachine.cpp @@ -12,7 +12,7 @@ #include "Alpha.h" #include "AlphaJITInfo.h" -#include "AlphaTargetAsmInfo.h" +#include "AlphaMCAsmInfo.h" #include "AlphaTargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Support/FormattedStream.h" @@ -22,7 +22,7 @@ using namespace llvm; extern "C" void LLVMInitializeAlphaTarget() { // Register the target. RegisterTargetMachine X(TheAlphaTarget); - RegisterAsmInfo Y(TheAlphaTarget); + RegisterAsmInfo Y(TheAlphaTarget); } AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT, diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index a19661d08d..47701d1f0c 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -22,7 +22,7 @@ #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/DwarfWriter.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetRegistry.h" @@ -41,7 +41,7 @@ namespace { /// explicit AlphaAsmPrinter(formatted_raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(o, tm, T, V) {} virtual const char *getPassName() const { diff --git a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp index fd00ea5add..1286e01d95 100644 --- a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp +++ b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp @@ -24,7 +24,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" @@ -40,7 +40,7 @@ namespace { class VISIBILITY_HIDDEN BlackfinAsmPrinter : public AsmPrinter { public: BlackfinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *TAI, bool V) + const MCAsmInfo *TAI, bool V) : AsmPrinter(O, TM, TAI, V) {} virtual const char *getPassName() const { diff --git a/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp b/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp new file mode 100644 index 0000000000..6d0f66cd7a --- /dev/null +++ b/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp @@ -0,0 +1,21 @@ +//===-- BlackfinMCAsmInfo.cpp - Blackfin asm properties -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the BlackfinMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "BlackfinMCAsmInfo.h" + +using namespace llvm; + +BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) { + GlobalPrefix = "_"; + CommentString = "//"; +} diff --git a/lib/Target/Blackfin/BlackfinMCAsmInfo.h b/lib/Target/Blackfin/BlackfinMCAsmInfo.h new file mode 100644 index 0000000000..0efc295230 --- /dev/null +++ b/lib/Target/Blackfin/BlackfinMCAsmInfo.h @@ -0,0 +1,29 @@ +//===-- BlackfinMCAsmInfo.h - Blackfin asm properties ---------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the BlackfinMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef BLACKFINTARGETASMINFO_H +#define BLACKFINTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + + struct BlackfinMCAsmInfo : public MCAsmInfo { + explicit BlackfinMCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp b/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp deleted file mode 100644 index 21087453ef..0000000000 --- a/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===-- BlackfinTargetAsmInfo.cpp - Blackfin asm properties -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the BlackfinTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "BlackfinTargetAsmInfo.h" - -using namespace llvm; - -BlackfinTargetAsmInfo::BlackfinTargetAsmInfo(const Target &T, - const StringRef &TT) { - GlobalPrefix = "_"; - CommentString = "//"; -} diff --git a/lib/Target/Blackfin/BlackfinTargetAsmInfo.h b/lib/Target/Blackfin/BlackfinTargetAsmInfo.h deleted file mode 100644 index 8040f0fb21..0000000000 --- a/lib/Target/Blackfin/BlackfinTargetAsmInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -//===-- BlackfinTargetAsmInfo.h - Blackfin asm properties -----*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the BlackfinTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef BLACKFINTARGETASMINFO_H -#define BLACKFINTARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - - struct BlackfinTargetAsmInfo : public TargetAsmInfo { - explicit BlackfinTargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/Blackfin/BlackfinTargetMachine.cpp b/lib/Target/Blackfin/BlackfinTargetMachine.cpp index 4309a9be4d..47ba2fe28f 100644 --- a/lib/Target/Blackfin/BlackfinTargetMachine.cpp +++ b/lib/Target/Blackfin/BlackfinTargetMachine.cpp @@ -12,7 +12,7 @@ #include "BlackfinTargetMachine.h" #include "Blackfin.h" -#include "BlackfinTargetAsmInfo.h" +#include "BlackfinMCAsmInfo.h" #include "llvm/PassManager.h" #include "llvm/Target/TargetRegistry.h" @@ -20,7 +20,7 @@ using namespace llvm; extern "C" void LLVMInitializeBlackfinTarget() { RegisterTargetMachine X(TheBlackfinTarget); - RegisterAsmInfo Y(TheBlackfinTarget); + RegisterAsmInfo Y(TheBlackfinTarget); } diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index f4418040e1..8099bb3e3b 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -33,7 +33,7 @@ #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Transforms/Scalar.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/Support/CallSite.h" @@ -86,7 +86,7 @@ namespace { Mangler *Mang; LoopInfo *LI; const Module *TheModule; - const TargetAsmInfo* TAsm; + const MCAsmInfo* TAsm; const TargetData* TD; std::map TypeNames; std::map FPConstantMap; @@ -3239,7 +3239,7 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) { const char *const *table = 0; - // Grab the translation table from TargetAsmInfo if it exists. + // Grab the translation table from MCAsmInfo if it exists. if (!TAsm) { std::string Triple = TheModule->getTargetTriple(); if (Triple.empty()) diff --git a/lib/Target/COFFTargetAsmInfo.cpp b/lib/Target/COFFTargetAsmInfo.cpp index 87e85adcb4..7586eaceb6 100644 --- a/lib/Target/COFFTargetAsmInfo.cpp +++ b/lib/Target/COFFTargetAsmInfo.cpp @@ -1,4 +1,4 @@ -//===-- COFFTargetAsmInfo.cpp - COFF asm properties -------------*- C++ -*-===// +//===-- COFFMCAsmInfo.cpp - COFF asm properties -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Target/COFFTargetAsmInfo.h" +#include "llvm/MC/MCAsmInfoCOFF.h" #include "llvm/ADT/SmallVector.h" using namespace llvm; -COFFTargetAsmInfo::COFFTargetAsmInfo() { +COFFMCAsmInfo::COFFMCAsmInfo() { GlobalPrefix = "_"; LCOMMDirective = "\t.lcomm\t"; COMMDirectiveTakesAlignment = false; diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index 399d430730..82c0c2bc60 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -26,7 +26,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetOptions.h" @@ -53,7 +53,7 @@ namespace { std::set FnStubs, GVStubs; public: explicit SPUAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) : + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V) {} virtual const char *getPassName() const { @@ -290,7 +290,7 @@ namespace { DwarfWriter *DW; public: explicit LinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : SPUAsmPrinter(O, TM, T, V), DW(0) {} virtual const char *getPassName() const { diff --git a/lib/Target/CellSPU/SPUMCAsmInfo.cpp b/lib/Target/CellSPU/SPUMCAsmInfo.cpp new file mode 100644 index 0000000000..1c921ab87f --- /dev/null +++ b/lib/Target/CellSPU/SPUMCAsmInfo.cpp @@ -0,0 +1,40 @@ +//===-- SPUMCAsmInfo.cpp - Cell SPU asm properties ------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the SPUMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "SPUMCAsmInfo.h" +using namespace llvm; + +SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) { + ZeroDirective = "\t.space\t"; + SetDirective = "\t.set"; + Data64bitsDirective = "\t.quad\t"; + AlignmentIsInBytes = false; + LCOMMDirective = "\t.lcomm\t"; + + PCSymbol = "."; + CommentString = "#"; + GlobalPrefix = ""; + PrivateGlobalPrefix = ".L"; + + // Has leb128, .loc and .file + HasLEB128 = true; + HasDotLocAndDotFile = true; + + SupportsDebugInformation = true; + NeedsSet = true; + + // Exception handling is not supported on CellSPU (think about it: you only + // have 256K for code+data. Would you support exception handling?) + ExceptionsType = ExceptionHandling::None; +} + diff --git a/lib/Target/CellSPU/SPUMCAsmInfo.h b/lib/Target/CellSPU/SPUMCAsmInfo.h new file mode 100644 index 0000000000..8d75ea8411 --- /dev/null +++ b/lib/Target/CellSPU/SPUMCAsmInfo.h @@ -0,0 +1,28 @@ +//===-- SPUMCAsmInfo.h - Cell SPU asm properties ---------------*- C++ -*--===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the SPUMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef SPUTARGETASMINFO_H +#define SPUTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + + struct SPULinuxMCAsmInfo : public MCAsmInfo { + explicit SPULinuxMCAsmInfo(const Target &T, const StringRef &TT); + }; +} // namespace llvm + +#endif /* SPUTARGETASMINFO_H */ diff --git a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp deleted file mode 100644 index 4ae852df99..0000000000 --- a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===-- SPUTargetAsmInfo.cpp - Cell SPU asm properties ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the SPUTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "SPUTargetAsmInfo.h" -using namespace llvm; - -SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const Target &T, const StringRef &TT) { - ZeroDirective = "\t.space\t"; - SetDirective = "\t.set"; - Data64bitsDirective = "\t.quad\t"; - AlignmentIsInBytes = false; - LCOMMDirective = "\t.lcomm\t"; - - PCSymbol = "."; - CommentString = "#"; - GlobalPrefix = ""; - PrivateGlobalPrefix = ".L"; - - // Has leb128, .loc and .file - HasLEB128 = true; - HasDotLocAndDotFile = true; - - SupportsDebugInformation = true; - NeedsSet = true; - - // Exception handling is not supported on CellSPU (think about it: you only - // have 256K for code+data. Would you support exception handling?) - ExceptionsType = ExceptionHandling::None; -} - diff --git a/lib/Target/CellSPU/SPUTargetAsmInfo.h b/lib/Target/CellSPU/SPUTargetAsmInfo.h deleted file mode 100644 index b3c6bdaefd..0000000000 --- a/lib/Target/CellSPU/SPUTargetAsmInfo.h +++ /dev/null @@ -1,28 +0,0 @@ -//===-- SPUTargetAsmInfo.h - Cell SPU asm properties -----------*- C++ -*--===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the SPUTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef SPUTARGETASMINFO_H -#define SPUTARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - - struct SPULinuxTargetAsmInfo : public TargetAsmInfo { - explicit SPULinuxTargetAsmInfo(const Target &T, const StringRef &TT); - }; -} // namespace llvm - -#endif /* SPUTARGETASMINFO_H */ diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp index b904b9559d..6500067849 100644 --- a/lib/Target/CellSPU/SPUTargetMachine.cpp +++ b/lib/Target/CellSPU/SPUTargetMachine.cpp @@ -13,7 +13,7 @@ #include "SPU.h" #include "SPURegisterNames.h" -#include "SPUTargetAsmInfo.h" +#include "SPUMCAsmInfo.h" #include "SPUTargetMachine.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/RegAllocRegistry.h" @@ -25,7 +25,7 @@ using namespace llvm; extern "C" void LLVMInitializeCellSPUTarget() { // Register the target. RegisterTargetMachine X(TheCellSPUTarget); - RegisterAsmInfo Y(TheCellSPUTarget); + RegisterAsmInfo Y(TheCellSPUTarget); } const std::pair * diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp index c37b41b700..8e8c6f838e 100644 --- a/lib/Target/DarwinTargetAsmInfo.cpp +++ b/lib/Target/DarwinTargetAsmInfo.cpp @@ -1,4 +1,4 @@ -//===-- DarwinTargetAsmInfo.cpp - Darwin asm properties ---------*- C++ -*-===// +//===-- MCAsmInfoDarwin.cpp - Darwin asm properties -------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Target/DarwinTargetAsmInfo.h" +#include "llvm/MC/MCAsmInfoDarwin.h" using namespace llvm; -DarwinTargetAsmInfo::DarwinTargetAsmInfo() { +DarwinMCAsmInfo::DarwinMCAsmInfo() { // Common settings for all Darwin targets. // Syntax: GlobalPrefix = "_"; diff --git a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp index 73c24eabaa..a17b2b4ff5 100644 --- a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp @@ -15,7 +15,7 @@ #define DEBUG_TYPE "asm-printer" #include "MSP430.h" #include "MSP430InstrInfo.h" -#include "MSP430TargetAsmInfo.h" +#include "MSP430MCAsmInfo.h" #include "MSP430TargetMachine.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" @@ -44,7 +44,7 @@ namespace { class VISIBILITY_HIDDEN MSP430AsmPrinter : public AsmPrinter { public: MSP430AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *TAI, bool V) + const MCAsmInfo *TAI, bool V) : AsmPrinter(O, TM, TAI, V) {} virtual const char *getPassName() const { diff --git a/lib/Target/MSP430/MSP430MCAsmInfo.cpp b/lib/Target/MSP430/MSP430MCAsmInfo.cpp new file mode 100644 index 0000000000..2309a5f63e --- /dev/null +++ b/lib/Target/MSP430/MSP430MCAsmInfo.cpp @@ -0,0 +1,19 @@ +//===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the MSP430MCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "MSP430MCAsmInfo.h" +using namespace llvm; + +MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) { + AlignmentIsInBytes = false; +} diff --git a/lib/Target/MSP430/MSP430MCAsmInfo.h b/lib/Target/MSP430/MSP430MCAsmInfo.h new file mode 100644 index 0000000000..8318029ae7 --- /dev/null +++ b/lib/Target/MSP430/MSP430MCAsmInfo.h @@ -0,0 +1,28 @@ +//=====-- MSP430MCAsmInfo.h - MSP430 asm properties -----------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the MSP430MCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef MSP430TARGETASMINFO_H +#define MSP430TARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + struct MSP430MCAsmInfo : public MCAsmInfo { + explicit MSP430MCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/MSP430/MSP430TargetAsmInfo.cpp b/lib/Target/MSP430/MSP430TargetAsmInfo.cpp deleted file mode 100644 index 56560d6c1e..0000000000 --- a/lib/Target/MSP430/MSP430TargetAsmInfo.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===-- MSP430TargetAsmInfo.cpp - MSP430 asm properties -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the MSP430TargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "MSP430TargetAsmInfo.h" -using namespace llvm; - -MSP430TargetAsmInfo::MSP430TargetAsmInfo(const Target &T, const StringRef &TT) { - AlignmentIsInBytes = false; -} diff --git a/lib/Target/MSP430/MSP430TargetAsmInfo.h b/lib/Target/MSP430/MSP430TargetAsmInfo.h deleted file mode 100644 index 510e2390f8..0000000000 --- a/lib/Target/MSP430/MSP430TargetAsmInfo.h +++ /dev/null @@ -1,28 +0,0 @@ -//=====-- MSP430TargetAsmInfo.h - MSP430 asm properties -------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the MSP430TargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef MSP430TARGETASMINFO_H -#define MSP430TARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - struct MSP430TargetAsmInfo : public TargetAsmInfo { - explicit MSP430TargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 08190aa7cc..5e21f8ea29 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -12,18 +12,18 @@ //===----------------------------------------------------------------------===// #include "MSP430.h" -#include "MSP430TargetAsmInfo.h" +#include "MSP430MCAsmInfo.h" #include "MSP430TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/Passes.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; extern "C" void LLVMInitializeMSP430Target() { // Register the target. RegisterTargetMachine X(TheMSP430Target); - RegisterAsmInfo Z(TheMSP430Target); + RegisterAsmInfo Z(TheMSP430Target); } MSP430TargetMachine::MSP430TargetMachine(const Target &T, diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index 9df23bcbb2..e942989f13 100644 --- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -29,7 +29,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -54,7 +54,7 @@ namespace { const MipsSubtarget *Subtarget; public: explicit MipsAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V) { Subtarget = &TM.getSubtarget(); } diff --git a/lib/Target/Mips/MipsMCAsmInfo.cpp b/lib/Target/Mips/MipsMCAsmInfo.cpp new file mode 100644 index 0000000000..d0bd87c21f --- /dev/null +++ b/lib/Target/Mips/MipsMCAsmInfo.cpp @@ -0,0 +1,27 @@ +//===-- MipsMCAsmInfo.cpp - Mips asm properties ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the MipsMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "MipsMCAsmInfo.h" +using namespace llvm; + +MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT) { + AlignmentIsInBytes = false; + COMMDirectiveTakesAlignment = true; + Data16bitsDirective = "\t.half\t"; + Data32bitsDirective = "\t.word\t"; + Data64bitsDirective = NULL; + PrivateGlobalPrefix = "$"; + CommentString = "#"; + ZeroDirective = "\t.space\t"; + PICJumpTableDirective = "\t.gpword\t"; +} diff --git a/lib/Target/Mips/MipsMCAsmInfo.h b/lib/Target/Mips/MipsMCAsmInfo.h new file mode 100644 index 0000000000..33a4b5edb2 --- /dev/null +++ b/lib/Target/Mips/MipsMCAsmInfo.h @@ -0,0 +1,30 @@ +//=====-- MipsMCAsmInfo.h - Mips asm properties ---------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the MipsMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef MIPSTARGETASMINFO_H +#define MIPSTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + + class MipsMCAsmInfo : public MCAsmInfo { + public: + explicit MipsMCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/Mips/MipsTargetAsmInfo.cpp b/lib/Target/Mips/MipsTargetAsmInfo.cpp deleted file mode 100644 index 3046f33ac0..0000000000 --- a/lib/Target/Mips/MipsTargetAsmInfo.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the MipsTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "MipsTargetAsmInfo.h" -using namespace llvm; - -MipsTargetAsmInfo::MipsTargetAsmInfo(const Target &T, const StringRef &TT) { - AlignmentIsInBytes = false; - COMMDirectiveTakesAlignment = true; - Data16bitsDirective = "\t.half\t"; - Data32bitsDirective = "\t.word\t"; - Data64bitsDirective = NULL; - PrivateGlobalPrefix = "$"; - CommentString = "#"; - ZeroDirective = "\t.space\t"; - PICJumpTableDirective = "\t.gpword\t"; -} diff --git a/lib/Target/Mips/MipsTargetAsmInfo.h b/lib/Target/Mips/MipsTargetAsmInfo.h deleted file mode 100644 index fbb0236289..0000000000 --- a/lib/Target/Mips/MipsTargetAsmInfo.h +++ /dev/null @@ -1,30 +0,0 @@ -//=====-- MipsTargetAsmInfo.h - Mips asm properties -----------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the MipsTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef MIPSTARGETASMINFO_H -#define MIPSTARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - - class MipsTargetAsmInfo : public TargetAsmInfo { - public: - explicit MipsTargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index c09b6064c3..4fa5450df1 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "Mips.h" -#include "MipsTargetAsmInfo.h" +#include "MipsMCAsmInfo.h" #include "MipsTargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Target/TargetRegistry.h" @@ -22,8 +22,8 @@ extern "C" void LLVMInitializeMipsTarget() { // Register the target. RegisterTargetMachine X(TheMipsTarget); RegisterTargetMachine Y(TheMipselTarget); - RegisterAsmInfo A(TheMipsTarget); - RegisterAsmInfo B(TheMipselTarget); + RegisterAsmInfo A(TheMipsTarget); + RegisterAsmInfo B(TheMipselTarget); } // DataLayout --> Big-endian, 32-bit pointer/ABI/alignment diff --git a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp index 1522e4ca2e..d6e95561a2 100644 --- a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp +++ b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp @@ -14,7 +14,7 @@ #include "PIC16AsmPrinter.h" #include "MCSectionPIC16.h" -#include "PIC16TargetAsmInfo.h" +#include "PIC16MCAsmInfo.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Module.h" @@ -34,10 +34,10 @@ using namespace llvm; #include "PIC16GenAsmWriter.inc" PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), DbgInfo(O, T) { PTLI = static_cast(TM.getTargetLowering()); - PTAI = static_cast(T); + PTAI = static_cast(T); PTOF = (PIC16TargetObjectFile*)&PTLI->getObjFileLowering(); } diff --git a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h index 3eea880a20..35a87e0ed6 100644 --- a/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h +++ b/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.h @@ -18,12 +18,11 @@ #include "PIC16.h" #include "PIC16TargetMachine.h" #include "PIC16DebugInfo.h" +#include "PIC16MCAsmInfo.h" #include "PIC16TargetObjectFile.h" #include "llvm/Analysis/DebugInfo.h" -#include "PIC16TargetAsmInfo.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetMachine.h" #include #include @@ -32,7 +31,7 @@ namespace llvm { class VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { public: explicit PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V); + const MCAsmInfo *T, bool V); private: virtual const char *getPassName() const { return "PIC16 Assembly Printer"; @@ -71,7 +70,7 @@ namespace llvm { PIC16TargetObjectFile *PTOF; PIC16TargetLowering *PTLI; PIC16DbgInfo DbgInfo; - const PIC16TargetAsmInfo *PTAI; + const PIC16MCAsmInfo *PTAI; std::list LibcallDecls; // List of extern decls. }; } // end of namespace diff --git a/lib/Target/PIC16/MCSectionPIC16.h b/lib/Target/PIC16/MCSectionPIC16.h index 66607c813f..048f2771b6 100644 --- a/lib/Target/PIC16/MCSectionPIC16.h +++ b/lib/Target/PIC16/MCSectionPIC16.h @@ -32,7 +32,7 @@ namespace llvm { static MCSectionPIC16 *Create(const StringRef &Name, SectionKind K, MCContext &Ctx); - virtual void PrintSwitchToSection(const TargetAsmInfo &TAI, + virtual void PrintSwitchToSection(const MCAsmInfo &TAI, raw_ostream &OS) const; }; diff --git a/lib/Target/PIC16/PIC16DebugInfo.h b/lib/Target/PIC16/PIC16DebugInfo.h index a46c06c1ea..1491716fc2 100644 --- a/lib/Target/PIC16/PIC16DebugInfo.h +++ b/lib/Target/PIC16/PIC16DebugInfo.h @@ -16,7 +16,7 @@ #include "llvm/Analysis/DebugInfo.h" #include "llvm/Module.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include namespace llvm { @@ -94,7 +94,7 @@ namespace llvm { class PIC16DbgInfo { formatted_raw_ostream &O; - const TargetAsmInfo *TAI; + const MCAsmInfo *TAI; std::string CurFile; unsigned CurLine; @@ -103,7 +103,7 @@ namespace llvm { bool EmitDebugDirectives; public: - PIC16DbgInfo(formatted_raw_ostream &o, const TargetAsmInfo *T) + PIC16DbgInfo(formatted_raw_ostream &o, const MCAsmInfo *T) : O(o), TAI(T) { CurFile = ""; CurLine = 0; diff --git a/lib/Target/PIC16/PIC16MCAsmInfo.cpp b/lib/Target/PIC16/PIC16MCAsmInfo.cpp new file mode 100644 index 0000000000..a17d1a8b1c --- /dev/null +++ b/lib/Target/PIC16/PIC16MCAsmInfo.cpp @@ -0,0 +1,58 @@ +//===-- PIC16MCAsmInfo.cpp - PIC16 asm properties -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the PIC16MCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "PIC16MCAsmInfo.h" + +// FIXME: Layering violation to get enums and static function, should be moved +// to separate headers. +#include "PIC16.h" +#include "PIC16ISelLowering.h" +using namespace llvm; + +PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) { + CommentString = ";"; + GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL); + GlobalDirective = "\tglobal\t"; + ExternDirective = "\textern\t"; + + Data8bitsDirective = " db "; + Data16bitsDirective = " dw "; + Data32bitsDirective = " dl "; + Data64bitsDirective = NULL; + ZeroDirective = NULL; + AsciiDirective = " dt "; + AscizDirective = NULL; + + RomData8bitsDirective = " dw "; + RomData16bitsDirective = " rom_di "; + RomData32bitsDirective = " rom_dl "; + + + // Set it to false because we weed to generate c file name and not bc file + // name. + HasSingleParameterDotFile = false; +} + +const char *PIC16MCAsmInfo::getDataASDirective(unsigned Size, + unsigned AS) const { + if (AS != PIC16ISD::ROM_SPACE) + return 0; + + switch (Size) { + case 8: return RomData8bitsDirective; + case 16: return RomData16bitsDirective; + case 32: return RomData32bitsDirective; + default: return NULL; + } +} + diff --git a/lib/Target/PIC16/PIC16MCAsmInfo.h b/lib/Target/PIC16/PIC16MCAsmInfo.h new file mode 100644 index 0000000000..e84db8532a --- /dev/null +++ b/lib/Target/PIC16/PIC16MCAsmInfo.h @@ -0,0 +1,35 @@ +//=====-- PIC16MCAsmInfo.h - PIC16 asm properties -------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the PIC16MCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef PIC16TARGETASMINFO_H +#define PIC16TARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + + class PIC16MCAsmInfo : public MCAsmInfo { + const char *RomData8bitsDirective; + const char *RomData16bitsDirective; + const char *RomData32bitsDirective; + public: + PIC16MCAsmInfo(const Target &T, const StringRef &TT); + + virtual const char *getDataASDirective(unsigned size, unsigned AS) const; + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/PIC16/PIC16MemSelOpt.cpp b/lib/Target/PIC16/PIC16MemSelOpt.cpp index 43d47ae529..c9ebb5756c 100644 --- a/lib/Target/PIC16/PIC16MemSelOpt.cpp +++ b/lib/Target/PIC16/PIC16MemSelOpt.cpp @@ -22,7 +22,7 @@ #define DEBUG_TYPE "pic16-codegen" #include "PIC16.h" #include "PIC16InstrInfo.h" -#include "PIC16TargetAsmInfo.h" +#include "PIC16MCAsmInfo.h" #include "PIC16TargetMachine.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" diff --git a/lib/Target/PIC16/PIC16TargetAsmInfo.cpp b/lib/Target/PIC16/PIC16TargetAsmInfo.cpp deleted file mode 100644 index 8b30291675..0000000000 --- a/lib/Target/PIC16/PIC16TargetAsmInfo.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the PIC16TargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "PIC16TargetAsmInfo.h" - -// FIXME: Layering violation to get enums and static function, should be moved -// to separate headers. -#include "PIC16.h" -#include "PIC16ISelLowering.h" -using namespace llvm; - -PIC16TargetAsmInfo::PIC16TargetAsmInfo(const Target &T, const StringRef &TT) { - CommentString = ";"; - GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL); - GlobalDirective = "\tglobal\t"; - ExternDirective = "\textern\t"; - - Data8bitsDirective = " db "; - Data16bitsDirective = " dw "; - Data32bitsDirective = " dl "; - Data64bitsDirective = NULL; - ZeroDirective = NULL; - AsciiDirective = " dt "; - AscizDirective = NULL; - - RomData8bitsDirective = " dw "; - RomData16bitsDirective = " rom_di "; - RomData32bitsDirective = " rom_dl "; - - - // Set it to false because we weed to generate c file name and not bc file - // name. - HasSingleParameterDotFile = false; -} - -const char *PIC16TargetAsmInfo:: -getDataASDirective(unsigned Size, unsigned AS) const { - if (AS != PIC16ISD::ROM_SPACE) - return 0; - - switch (Size) { - case 8: return RomData8bitsDirective; - case 16: return RomData16bitsDirective; - case 32: return RomData32bitsDirective; - default: return NULL; - } -} - diff --git a/lib/Target/PIC16/PIC16TargetAsmInfo.h b/lib/Target/PIC16/PIC16TargetAsmInfo.h deleted file mode 100644 index 23c5ebced6..0000000000 --- a/lib/Target/PIC16/PIC16TargetAsmInfo.h +++ /dev/null @@ -1,35 +0,0 @@ -//=====-- PIC16TargetAsmInfo.h - PIC16 asm properties ---------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the PIC16TargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef PIC16TARGETASMINFO_H -#define PIC16TARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - - class PIC16TargetAsmInfo : public TargetAsmInfo { - const char *RomData8bitsDirective; - const char *RomData16bitsDirective; - const char *RomData32bitsDirective; - public: - PIC16TargetAsmInfo(const Target &T, const StringRef &TT); - - virtual const char *getDataASDirective(unsigned size, unsigned AS) const; - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/PIC16/PIC16TargetMachine.cpp b/lib/Target/PIC16/PIC16TargetMachine.cpp index 2cdaff344f..08307e7cef 100644 --- a/lib/Target/PIC16/PIC16TargetMachine.cpp +++ b/lib/Target/PIC16/PIC16TargetMachine.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "PIC16.h" -#include "PIC16TargetAsmInfo.h" +#include "PIC16MCAsmInfo.h" #include "PIC16TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/Passes.h" @@ -24,7 +24,7 @@ extern "C" void LLVMInitializePIC16Target() { // Register the target. Curretnly the codegen works for // enhanced pic16 mid-range. RegisterTargetMachine X(ThePIC16Target); - RegisterAsmInfo A(ThePIC16Target); + RegisterAsmInfo A(ThePIC16Target); } diff --git a/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/lib/Target/PIC16/PIC16TargetObjectFile.cpp index 07d8381800..e6dfa67426 100644 --- a/lib/Target/PIC16/PIC16TargetObjectFile.cpp +++ b/lib/Target/PIC16/PIC16TargetObjectFile.cpp @@ -25,7 +25,7 @@ MCSectionPIC16 *MCSectionPIC16::Create(const StringRef &Name, } -void MCSectionPIC16::PrintSwitchToSection(const TargetAsmInfo &TAI, +void MCSectionPIC16::PrintSwitchToSection(const MCAsmInfo &TAI, raw_ostream &OS) const { OS << getName() << '\n'; } diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index b56905ca13..3bcb1450da 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -33,7 +33,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" @@ -87,7 +87,7 @@ namespace { uint64_t LabelID; public: explicit PPCAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), Subtarget(TM.getSubtarget()), LabelID(0) {} @@ -346,7 +346,7 @@ namespace { class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter { public: explicit PPCLinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : PPCAsmPrinter(O, TM, T, V){} virtual const char *getPassName() const { @@ -372,7 +372,7 @@ namespace { formatted_raw_ostream &OS; public: explicit PPCDarwinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : PPCAsmPrinter(O, TM, T, V), OS(O) {} virtual const char *getPassName() const { @@ -1151,7 +1151,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { /// static AsmPrinter *createPPCAsmPrinterPass(formatted_raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *tai, + const MCAsmInfo *tai, bool verbose) { const PPCSubtarget *Subtarget = &tm.getSubtarget(); diff --git a/lib/Target/PowerPC/PPCInstrInfo.cpp b/lib/Target/PowerPC/PPCInstrInfo.cpp index 27a5450432..0083598cf1 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -22,7 +22,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" using namespace llvm; extern cl::opt EnablePPC32RS; // FIXME (64-bit): See PPCRegisterInfo.cpp. @@ -768,7 +768,7 @@ unsigned PPCInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { case PPC::INLINEASM: { // Inline Asm: Variable size. const MachineFunction *MF = MI->getParent()->getParent(); const char *AsmStr = MI->getOperand(0).getSymbolName(); - return getInlineAsmLength(AsmStr, *MF->getTarget().getTargetAsmInfo()); + return getInlineAsmLength(AsmStr, *MF->getTarget().getMCAsmInfo()); } case PPC::DBG_LABEL: case PPC::EH_LABEL: diff --git a/lib/Target/PowerPC/PPCMCAsmInfo.cpp b/lib/Target/PowerPC/PPCMCAsmInfo.cpp new file mode 100644 index 0000000000..c9ff842e9f --- /dev/null +++ b/lib/Target/PowerPC/PPCMCAsmInfo.cpp @@ -0,0 +1,58 @@ +//===-- PPCMCAsmInfo.cpp - PPC asm properties -------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the DarwinMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "PPCMCAsmInfo.h" +using namespace llvm; + +PPCDarwinMCAsmInfo::PPCDarwinMCAsmInfo(bool is64Bit) { + PCSymbol = "."; + CommentString = ";"; + ExceptionsType = ExceptionHandling::Dwarf; + + if (!is64Bit) + Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. + AssemblerDialect = 1; // New-Style mnemonics. +} + +PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { + CommentString = "#"; + GlobalPrefix = ""; + PrivateGlobalPrefix = ".L"; + UsedDirective = "\t# .no_dead_strip\t"; + WeakRefDirective = "\t.weak\t"; + + // Uses '.section' before '.bss' directive + UsesELFSectionDirectiveForBSS = true; + + // Debug Information + AbsoluteDebugSectionOffsets = true; + SupportsDebugInformation = true; + + PCSymbol = "."; + + // Set up DWARF directives + HasLEB128 = true; // Target asm supports leb128 directives (little-endian) + + // Exceptions handling + if (!is64Bit) + ExceptionsType = ExceptionHandling::Dwarf; + AbsoluteEHSectionOffsets = false; + + ZeroDirective = "\t.space\t"; + SetDirective = "\t.set"; + Data64bitsDirective = is64Bit ? "\t.quad\t" : 0; + AlignmentIsInBytes = false; + LCOMMDirective = "\t.lcomm\t"; + AssemblerDialect = 0; // Old-Style mnemonics. +} + diff --git a/lib/Target/PowerPC/PPCMCAsmInfo.h b/lib/Target/PowerPC/PPCMCAsmInfo.h new file mode 100644 index 0000000000..3f5118b8db --- /dev/null +++ b/lib/Target/PowerPC/PPCMCAsmInfo.h @@ -0,0 +1,31 @@ +//=====-- PPCMCAsmInfo.h - PPC asm properties -----------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the DarwinMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef PPCTARGETASMINFO_H +#define PPCTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfoDarwin.h" + +namespace llvm { + + struct PPCDarwinMCAsmInfo : public DarwinMCAsmInfo { + explicit PPCDarwinMCAsmInfo(bool is64Bit); + }; + + struct PPCLinuxMCAsmInfo : public MCAsmInfo { + explicit PPCLinuxMCAsmInfo(bool is64Bit); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp deleted file mode 100644 index 864475b30a..0000000000 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the DarwinTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "PPCTargetAsmInfo.h" -using namespace llvm; - -PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) { - PCSymbol = "."; - CommentString = ";"; - ExceptionsType = ExceptionHandling::Dwarf; - - if (!is64Bit) - Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. - AssemblerDialect = 1; // New-Style mnemonics. -} - -PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) { - CommentString = "#"; - GlobalPrefix = ""; - PrivateGlobalPrefix = ".L"; - UsedDirective = "\t# .no_dead_strip\t"; - WeakRefDirective = "\t.weak\t"; - - // Uses '.section' before '.bss' directive - UsesELFSectionDirectiveForBSS = true; - - // Debug Information - AbsoluteDebugSectionOffsets = true; - SupportsDebugInformation = true; - - PCSymbol = "."; - - // Set up DWARF directives - HasLEB128 = true; // Target asm supports leb128 directives (little-endian) - - // Exceptions handling - if (!is64Bit) - ExceptionsType = ExceptionHandling::Dwarf; - AbsoluteEHSectionOffsets = false; - - ZeroDirective = "\t.space\t"; - SetDirective = "\t.set"; - Data64bitsDirective = is64Bit ? "\t.quad\t" : 0; - AlignmentIsInBytes = false; - LCOMMDirective = "\t.lcomm\t"; - AssemblerDialect = 0; // Old-Style mnemonics. -} - diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h deleted file mode 100644 index c7f8862e7f..0000000000 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.h +++ /dev/null @@ -1,32 +0,0 @@ -//=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the DarwinTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef PPCTARGETASMINFO_H -#define PPCTARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" -#include "llvm/Target/DarwinTargetAsmInfo.h" - -namespace llvm { - - struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo { - explicit PPCDarwinTargetAsmInfo(bool is64Bit); - }; - - struct PPCLinuxTargetAsmInfo : public TargetAsmInfo { - explicit PPCLinuxTargetAsmInfo(bool is64Bit); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 41f4699fc0..de3a3d0b70 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "PPC.h" -#include "PPCTargetAsmInfo.h" +#include "PPCMCAsmInfo.h" #include "PPCTargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Target/TargetOptions.h" @@ -20,13 +20,13 @@ #include "llvm/Support/FormattedStream.h" using namespace llvm; -static const TargetAsmInfo *createTargetAsmInfo(const Target &T, +static const MCAsmInfo *createMCAsmInfo(const Target &T, const StringRef &TT) { Triple TheTriple(TT); bool isPPC64 = TheTriple.getArch() == Triple::ppc64; if (TheTriple.getOS() == Triple::Darwin) - return new PPCDarwinTargetAsmInfo(isPPC64); - return new PPCLinuxTargetAsmInfo(isPPC64); + return new PPCDarwinMCAsmInfo(isPPC64); + return new PPCLinuxMCAsmInfo(isPPC64); } @@ -35,8 +35,8 @@ extern "C" void LLVMInitializePowerPCTarget() { RegisterTargetMachine A(ThePPC32Target); RegisterTargetMachine B(ThePPC64Target); - RegisterAsmInfoFn C(ThePPC32Target, createTargetAsmInfo); - RegisterAsmInfoFn D(ThePPC64Target, createTargetAsmInfo); + RegisterAsmInfoFn C(ThePPC32Target, createMCAsmInfo); + RegisterAsmInfoFn D(ThePPC64Target, createMCAsmInfo); } diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index d39b6efa3e..663315e2eb 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -25,7 +25,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/ADT/Statistic.h" @@ -53,7 +53,7 @@ namespace { unsigned BBNumber; public: explicit SparcAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), BBNumber(0) {} virtual const char *getPassName() const { diff --git a/lib/Target/Sparc/SparcMCAsmInfo.cpp b/lib/Target/Sparc/SparcMCAsmInfo.cpp new file mode 100644 index 0000000000..e9d1c38f82 --- /dev/null +++ b/lib/Target/Sparc/SparcMCAsmInfo.cpp @@ -0,0 +1,29 @@ +//===-- SparcMCAsmInfo.cpp - Sparc asm properties -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the SparcMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "SparcMCAsmInfo.h" +#include "llvm/ADT/SmallVector.h" +using namespace llvm; + +SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) { + Data16bitsDirective = "\t.half\t"; + Data32bitsDirective = "\t.word\t"; + Data64bitsDirective = 0; // .xword is only supported by V9. + ZeroDirective = "\t.skip\t"; + CommentString = "!"; + COMMDirectiveTakesAlignment = true; + + SunStyleELFSectionSwitchSyntax = true; +} + + diff --git a/lib/Target/Sparc/SparcMCAsmInfo.h b/lib/Target/Sparc/SparcMCAsmInfo.h new file mode 100644 index 0000000000..12d6ef4a6f --- /dev/null +++ b/lib/Target/Sparc/SparcMCAsmInfo.h @@ -0,0 +1,28 @@ +//=====-- SparcMCAsmInfo.h - Sparc asm properties -------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the SparcMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef SPARCTARGETASMINFO_H +#define SPARCTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + struct SparcELFMCAsmInfo : public MCAsmInfo { + explicit SparcELFMCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/Sparc/SparcTargetAsmInfo.cpp b/lib/Target/Sparc/SparcTargetAsmInfo.cpp deleted file mode 100644 index 1794ebc587..0000000000 --- a/lib/Target/Sparc/SparcTargetAsmInfo.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===-- SparcTargetAsmInfo.cpp - Sparc asm properties ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the SparcTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "SparcTargetAsmInfo.h" -#include "llvm/ADT/SmallVector.h" -using namespace llvm; - -SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const Target &T, - const StringRef &TT) { - Data16bitsDirective = "\t.half\t"; - Data32bitsDirective = "\t.word\t"; - Data64bitsDirective = 0; // .xword is only supported by V9. - ZeroDirective = "\t.skip\t"; - CommentString = "!"; - COMMDirectiveTakesAlignment = true; - - SunStyleELFSectionSwitchSyntax = true; -} - - diff --git a/lib/Target/Sparc/SparcTargetAsmInfo.h b/lib/Target/Sparc/SparcTargetAsmInfo.h deleted file mode 100644 index edf8146242..0000000000 --- a/lib/Target/Sparc/SparcTargetAsmInfo.h +++ /dev/null @@ -1,28 +0,0 @@ -//=====-- SparcTargetAsmInfo.h - Sparc asm properties ---------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the SparcTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef SPARCTARGETASMINFO_H -#define SPARCTARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - struct SparcELFTargetAsmInfo : public TargetAsmInfo { - explicit SparcELFTargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp index 505e2b11d5..3a381151f9 100644 --- a/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/lib/Target/Sparc/SparcTargetMachine.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "SparcTargetAsmInfo.h" +#include "SparcMCAsmInfo.h" #include "SparcTargetMachine.h" #include "Sparc.h" #include "llvm/PassManager.h" @@ -20,7 +20,7 @@ using namespace llvm; extern "C" void LLVMInitializeSparcTarget() { // Register the target. RegisterTargetMachine X(TheSparcTarget); - RegisterAsmInfo Y(TheSparcTarget); + RegisterAsmInfo Y(TheSparcTarget); } diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp index ae0dce0d67..ecfc5bd54a 100644 --- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp @@ -27,7 +27,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" @@ -44,7 +44,7 @@ namespace { class VISIBILITY_HIDDEN SystemZAsmPrinter : public AsmPrinter { public: SystemZAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *TAI, bool V) + const MCAsmInfo *TAI, bool V) : AsmPrinter(O, TM, TAI, V) {} virtual const char *getPassName() const { diff --git a/lib/Target/SystemZ/SystemZMCAsmInfo.cpp b/lib/Target/SystemZ/SystemZMCAsmInfo.cpp new file mode 100644 index 0000000000..8ea11c95b2 --- /dev/null +++ b/lib/Target/SystemZ/SystemZMCAsmInfo.cpp @@ -0,0 +1,26 @@ +//===-- SystemZMCAsmInfo.cpp - SystemZ asm properties ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the SystemZMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "SystemZMCAsmInfo.h" +using namespace llvm; + +SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) { + AlignmentIsInBytes = true; + + PrivateGlobalPrefix = ".L"; + WeakRefDirective = "\t.weak\t"; + SetDirective = "\t.set\t"; + PCSymbol = "."; + + NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; +} diff --git a/lib/Target/SystemZ/SystemZMCAsmInfo.h b/lib/Target/SystemZ/SystemZMCAsmInfo.h new file mode 100644 index 0000000000..3bebcb74e3 --- /dev/null +++ b/lib/Target/SystemZ/SystemZMCAsmInfo.h @@ -0,0 +1,29 @@ +//====-- SystemZMCAsmInfo.h - SystemZ asm properties -----------*- C++ -*--===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the SystemZMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef SystemZTARGETASMINFO_H +#define SystemZTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + + struct SystemZMCAsmInfo : public MCAsmInfo { + explicit SystemZMCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp b/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp deleted file mode 100644 index fc102124ba..0000000000 --- a/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===-- SystemZTargetAsmInfo.cpp - SystemZ asm properties -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the SystemZTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "SystemZTargetAsmInfo.h" -using namespace llvm; - -SystemZTargetAsmInfo::SystemZTargetAsmInfo(const Target &T, - const StringRef &TT) { - AlignmentIsInBytes = true; - - PrivateGlobalPrefix = ".L"; - WeakRefDirective = "\t.weak\t"; - SetDirective = "\t.set\t"; - PCSymbol = "."; - - NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; -} diff --git a/lib/Target/SystemZ/SystemZTargetAsmInfo.h b/lib/Target/SystemZ/SystemZTargetAsmInfo.h deleted file mode 100644 index 72345c8795..0000000000 --- a/lib/Target/SystemZ/SystemZTargetAsmInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -//====-- SystemZTargetAsmInfo.h - SystemZ asm properties -------*- C++ -*--===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the SystemZTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef SystemZTARGETASMINFO_H -#define SystemZTARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - - struct SystemZTargetAsmInfo : public TargetAsmInfo { - explicit SystemZTargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/SystemZ/SystemZTargetMachine.cpp b/lib/Target/SystemZ/SystemZTargetMachine.cpp index 48ea5f5ebd..990e0031c5 100644 --- a/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "SystemZTargetAsmInfo.h" +#include "SystemZMCAsmInfo.h" #include "SystemZTargetMachine.h" #include "SystemZ.h" #include "llvm/PassManager.h" @@ -17,7 +17,7 @@ using namespace llvm; extern "C" void LLVMInitializeSystemZTarget() { // Register the target. RegisterTargetMachine X(TheSystemZTarget); - RegisterAsmInfo Y(TheSystemZTarget); + RegisterAsmInfo Y(TheSystemZTarget); } /// SystemZTargetMachine ctor - Create an ILP64 architecture model diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 20a584916f..c38bf703ec 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -1,4 +1,4 @@ -//===-- TargetAsmInfo.cpp - Asm Info ---------------------------------------==// +//===-- MCAsmInfo.cpp - Asm Info -------------------------------------------==// // // The LLVM Compiler Infrastructure // @@ -12,12 +12,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include #include using namespace llvm; -TargetAsmInfo::TargetAsmInfo() { +MCAsmInfo::MCAsmInfo() { ZeroFillDirective = 0; NonexecutableStackDirective = 0; NeedsSet = false; @@ -85,11 +85,11 @@ TargetAsmInfo::TargetAsmInfo() { AsmTransCBE = 0; } -TargetAsmInfo::~TargetAsmInfo() { +MCAsmInfo::~MCAsmInfo() { } -unsigned TargetAsmInfo::getULEB128Size(unsigned Value) { +unsigned MCAsmInfo::getULEB128Size(unsigned Value) { unsigned Size = 0; do { Value >>= 7; @@ -98,7 +98,7 @@ unsigned TargetAsmInfo::getULEB128Size(unsigned Value) { return Size; } -unsigned TargetAsmInfo::getSLEB128Size(int Value) { +unsigned MCAsmInfo::getSLEB128Size(int Value) { unsigned Size = 0; int Sign = Value >> (8 * sizeof(Value) - 1); bool IsMore; diff --git a/lib/Target/TargetInstrInfo.cpp b/lib/Target/TargetInstrInfo.cpp index c3e6f4326e..af8ef6ec1f 100644 --- a/lib/Target/TargetInstrInfo.cpp +++ b/lib/Target/TargetInstrInfo.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Target/TargetInstrInfo.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Support/ErrorHandling.h" using namespace llvm; @@ -73,7 +73,7 @@ bool TargetInstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const { /// Variable-length instructions are not handled here; this function /// may be overloaded in the target code to do that. unsigned TargetInstrInfo::getInlineAsmLength(const char *Str, - const TargetAsmInfo &TAI) const { + const MCAsmInfo &TAI) const { // Count the number of instructions in the asm. diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index b94fa68be9..fdf157a1e6 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/CommandLine.h" diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 5701c7cfef..ca3d528424 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -19,7 +19,7 @@ #include "X86COFF.h" #include "X86MachineFunctionInfo.h" #include "X86TargetMachine.h" -#include "X86TargetAsmInfo.h" +#include "X86MCAsmInfo.h" #include "llvm/CallingConv.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" @@ -37,7 +37,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" #include "llvm/Support/Mangler.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetOptions.h" using namespace llvm; diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h index a4c8f13958..ef8ba6c14d 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h @@ -37,7 +37,7 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter { const X86Subtarget *Subtarget; public: explicit X86ATTAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V) { Subtarget = &TM.getSubtarget(); } diff --git a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp index 52950aa323..ff87960d27 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp @@ -15,7 +15,7 @@ #define DEBUG_TYPE "asm-printer" #include "llvm/MC/MCInst.h" #include "X86ATTAsmPrinter.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" using namespace llvm; diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index 2e769a4d95..3ca35c50da 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -17,7 +17,7 @@ #include "X86.h" #include "X86ATTAsmPrinter.h" #include "X86IntelAsmPrinter.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; @@ -27,9 +27,9 @@ using namespace llvm; /// static AsmPrinter *createX86CodePrinterPass(formatted_raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *tai, + const MCAsmInfo *tai, bool verbose) { - if (tm.getTargetAsmInfo()->getAssemblerDialect() == 1) + if (tm.getMCAsmInfo()->getAssemblerDialect() == 1) return new X86IntelAsmPrinter(o, tm, tai, verbose); return new X86ATTAsmPrinter(o, tm, tai, verbose); } diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp index 141512e64c..17182c37fa 100644 --- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp @@ -16,7 +16,7 @@ #define DEBUG_TYPE "asm-printer" #include "X86IntelAsmPrinter.h" #include "X86InstrInfo.h" -#include "X86TargetAsmInfo.h" +#include "X86MCAsmInfo.h" #include "X86.h" #include "llvm/CallingConv.h" #include "llvm/Constants.h" @@ -27,7 +27,7 @@ #include "llvm/Assembly/Writer.h" #include "llvm/CodeGen/DwarfWriter.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/ErrorHandling.h" diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h index c7c5df2089..379e4e7269 100644 --- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h @@ -26,7 +26,7 @@ namespace llvm { struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter { explicit X86IntelAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V) {} virtual const char *getPassName() const { diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index b55267dce8..c2c34ee907 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -31,7 +31,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetOptions.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" using namespace llvm; namespace { @@ -2993,7 +2993,7 @@ static unsigned GetInstSizeWithDesc(const MachineInstr &MI, const MachineFunction *MF = MI.getParent()->getParent(); const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo(); FinalSize += TII.getInlineAsmLength(MI.getOperand(0).getSymbolName(), - *MF->getTarget().getTargetAsmInfo()); + *MF->getTarget().getMCAsmInfo()); break; } case TargetInstrInfo::DBG_LABEL: diff --git a/lib/Target/X86/X86MCAsmInfo.cpp b/lib/Target/X86/X86MCAsmInfo.cpp new file mode 100644 index 0000000000..9393fb8bcc --- /dev/null +++ b/lib/Target/X86/X86MCAsmInfo.cpp @@ -0,0 +1,131 @@ +//===-- X86MCAsmInfo.cpp - X86 asm properties -----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the X86MCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "X86MCAsmInfo.h" +#include "X86TargetMachine.h" +#include "llvm/ADT/Triple.h" +#include "llvm/Support/CommandLine.h" +using namespace llvm; + +enum AsmWriterFlavorTy { + // Note: This numbering has to match the GCC assembler dialects for inline + // asm alternatives to work right. + ATT = 0, Intel = 1 +}; + +static cl::opt +AsmWriterFlavor("x86-asm-syntax", cl::init(ATT), + cl::desc("Choose style of code to emit from X86 backend:"), + cl::values(clEnumValN(ATT, "att", "Emit AT&T-style assembly"), + clEnumValN(Intel, "intel", "Emit Intel-style assembly"), + clEnumValEnd)); + + +static const char *const x86_asm_table[] = { + "{si}", "S", + "{di}", "D", + "{ax}", "a", + "{cx}", "c", + "{memory}", "memory", + "{flags}", "", + "{dirflag}", "", + "{fpsr}", "", + "{cc}", "cc", + 0,0}; + +X86DarwinMCAsmInfo::X86DarwinMCAsmInfo(const Triple &Triple) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = AsmWriterFlavor; + + bool is64Bit = Triple.getArch() == Triple::x86_64; + + TextAlignFillValue = 0x90; + + if (!is64Bit) + Data64bitsDirective = 0; // we can't emit a 64-bit unit + + // Leopard and above support aligned common symbols. + COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9; + + if (is64Bit) { + PersonalityPrefix = ""; + PersonalitySuffix = "+4@GOTPCREL"; + } else { + PersonalityPrefix = "L"; + PersonalitySuffix = "$non_lazy_ptr"; + } + + CommentString = "##"; + PCSymbol = "."; + + SupportsDebugInformation = true; + DwarfUsesInlineInfoSection = true; + + // Exceptions handling + ExceptionsType = ExceptionHandling::Dwarf; + AbsoluteEHSectionOffsets = false; +} + +X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &Triple) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = AsmWriterFlavor; + + PrivateGlobalPrefix = ".L"; + WeakRefDirective = "\t.weak\t"; + SetDirective = "\t.set\t"; + PCSymbol = "."; + + // Set up DWARF directives + HasLEB128 = true; // Target asm supports leb128 directives (little-endian) + + // Debug Information + AbsoluteDebugSectionOffsets = true; + SupportsDebugInformation = true; + + // Exceptions handling + ExceptionsType = ExceptionHandling::Dwarf; + AbsoluteEHSectionOffsets = false; + + // On Linux we must declare when we can use a non-executable stack. + if (Triple.getOS() == Triple::Linux) + NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; +} + +X86COFFMCAsmInfo::X86COFFMCAsmInfo(const Triple &Triple) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = AsmWriterFlavor; +} + + +X86WinMCAsmInfo::X86WinMCAsmInfo(const Triple &Triple) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = AsmWriterFlavor; + + 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; + HasSingleParameterDotFile = false; + + AlignmentIsInBytes = true; +} diff --git a/lib/Target/X86/X86MCAsmInfo.h b/lib/Target/X86/X86MCAsmInfo.h new file mode 100644 index 0000000000..7c1bfac664 --- /dev/null +++ b/lib/Target/X86/X86MCAsmInfo.h @@ -0,0 +1,42 @@ +//=====-- X86MCAsmInfo.h - X86 asm properties -----------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the X86MCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef X86TARGETASMINFO_H +#define X86TARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCAsmInfoCOFF.h" +#include "llvm/MC/MCAsmInfoDarwin.h" + +namespace llvm { + class Triple; + + struct X86DarwinMCAsmInfo : public DarwinMCAsmInfo { + explicit X86DarwinMCAsmInfo(const Triple &Triple); + }; + + struct X86ELFMCAsmInfo : public MCAsmInfo { + explicit X86ELFMCAsmInfo(const Triple &Triple); + }; + + struct X86COFFMCAsmInfo : public COFFMCAsmInfo { + explicit X86COFFMCAsmInfo(const Triple &Triple); + }; + + struct X86WinMCAsmInfo : public MCAsmInfo { + explicit X86WinMCAsmInfo(const Triple &Triple); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 112ff1ce24..5d1ee17c37 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -30,7 +30,7 @@ #include "llvm/CodeGen/MachineLocation.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp deleted file mode 100644 index d978eb179d..0000000000 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ /dev/null @@ -1,131 +0,0 @@ -//===-- X86TargetAsmInfo.cpp - X86 asm properties ---------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the X86TargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "X86TargetAsmInfo.h" -#include "X86TargetMachine.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/CommandLine.h" -using namespace llvm; - -enum AsmWriterFlavorTy { - // Note: This numbering has to match the GCC assembler dialects for inline - // asm alternatives to work right. - ATT = 0, Intel = 1 -}; - -static cl::opt -AsmWriterFlavor("x86-asm-syntax", cl::init(ATT), - cl::desc("Choose style of code to emit from X86 backend:"), - cl::values(clEnumValN(ATT, "att", "Emit AT&T-style assembly"), - clEnumValN(Intel, "intel", "Emit Intel-style assembly"), - clEnumValEnd)); - - -static const char *const x86_asm_table[] = { - "{si}", "S", - "{di}", "D", - "{ax}", "a", - "{cx}", "c", - "{memory}", "memory", - "{flags}", "", - "{dirflag}", "", - "{fpsr}", "", - "{cc}", "cc", - 0,0}; - -X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) { - AsmTransCBE = x86_asm_table; - AssemblerDialect = AsmWriterFlavor; - - bool is64Bit = Triple.getArch() == Triple::x86_64; - - TextAlignFillValue = 0x90; - - if (!is64Bit) - Data64bitsDirective = 0; // we can't emit a 64-bit unit - - // Leopard and above support aligned common symbols. - COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9; - - if (is64Bit) { - PersonalityPrefix = ""; - PersonalitySuffix = "+4@GOTPCREL"; - } else { - PersonalityPrefix = "L"; - PersonalitySuffix = "$non_lazy_ptr"; - } - - CommentString = "##"; - PCSymbol = "."; - - SupportsDebugInformation = true; - DwarfUsesInlineInfoSection = true; - - // Exceptions handling - ExceptionsType = ExceptionHandling::Dwarf; - AbsoluteEHSectionOffsets = false; -} - -X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const Triple &Triple) { - AsmTransCBE = x86_asm_table; - AssemblerDialect = AsmWriterFlavor; - - PrivateGlobalPrefix = ".L"; - WeakRefDirective = "\t.weak\t"; - SetDirective = "\t.set\t"; - PCSymbol = "."; - - // Set up DWARF directives - HasLEB128 = true; // Target asm supports leb128 directives (little-endian) - - // Debug Information - AbsoluteDebugSectionOffsets = true; - SupportsDebugInformation = true; - - // Exceptions handling - ExceptionsType = ExceptionHandling::Dwarf; - AbsoluteEHSectionOffsets = false; - - // On Linux we must declare when we can use a non-executable stack. - if (Triple.getOS() == Triple::Linux) - NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; -} - -X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const Triple &Triple) { - AsmTransCBE = x86_asm_table; - AssemblerDialect = AsmWriterFlavor; -} - - -X86WinTargetAsmInfo::X86WinTargetAsmInfo(const Triple &Triple) { - AsmTransCBE = x86_asm_table; - AssemblerDialect = AsmWriterFlavor; - - 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; - HasSingleParameterDotFile = false; - - AlignmentIsInBytes = true; -} diff --git a/lib/Target/X86/X86TargetAsmInfo.h b/lib/Target/X86/X86TargetAsmInfo.h deleted file mode 100644 index 91de368259..0000000000 --- a/lib/Target/X86/X86TargetAsmInfo.h +++ /dev/null @@ -1,42 +0,0 @@ -//=====-- X86TargetAsmInfo.h - X86 asm properties -------------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the X86TargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef X86TARGETASMINFO_H -#define X86TARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" -#include "llvm/Target/COFFTargetAsmInfo.h" -#include "llvm/Target/DarwinTargetAsmInfo.h" - -namespace llvm { - class Triple; - - struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo { - explicit X86DarwinTargetAsmInfo(const Triple &Triple); - }; - - struct X86ELFTargetAsmInfo : public TargetAsmInfo { - explicit X86ELFTargetAsmInfo(const Triple &Triple); - }; - - struct X86COFFTargetAsmInfo : public COFFTargetAsmInfo { - explicit X86COFFTargetAsmInfo(const Triple &Triple); - }; - - struct X86WinTargetAsmInfo : public TargetAsmInfo { - explicit X86WinTargetAsmInfo(const Triple &Triple); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 8c4e5d02be..689cebd57b 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "X86TargetAsmInfo.h" +#include "X86MCAsmInfo.h" #include "X86TargetMachine.h" #include "X86.h" #include "llvm/PassManager.h" @@ -22,20 +22,20 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; -static const TargetAsmInfo *createTargetAsmInfo(const Target &T, +static const MCAsmInfo *createMCAsmInfo(const Target &T, const StringRef &TT) { Triple TheTriple(TT); switch (TheTriple.getOS()) { case Triple::Darwin: - return new X86DarwinTargetAsmInfo(TheTriple); + return new X86DarwinMCAsmInfo(TheTriple); case Triple::MinGW32: case Triple::MinGW64: case Triple::Cygwin: - return new X86COFFTargetAsmInfo(TheTriple); + return new X86COFFMCAsmInfo(TheTriple); case Triple::Win32: - return new X86WinTargetAsmInfo(TheTriple); + return new X86WinMCAsmInfo(TheTriple); default: - return new X86ELFTargetAsmInfo(TheTriple); + return new X86ELFMCAsmInfo(TheTriple); } } @@ -45,8 +45,8 @@ extern "C" void LLVMInitializeX86Target() { RegisterTargetMachine Y(TheX86_64Target); // Register the target asm info. - RegisterAsmInfoFn A(TheX86_32Target, createTargetAsmInfo); - RegisterAsmInfoFn B(TheX86_64Target, createTargetAsmInfo); + RegisterAsmInfoFn A(TheX86_32Target, createMCAsmInfo); + RegisterAsmInfoFn B(TheX86_64Target, createMCAsmInfo); } diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp index 88473495d1..bf32d69784 100644 --- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp @@ -16,7 +16,7 @@ #include "XCore.h" #include "XCoreInstrInfo.h" #include "XCoreSubtarget.h" -#include "XCoreTargetAsmInfo.h" +#include "XCoreMCAsmInfo.h" #include "XCoreTargetMachine.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" @@ -56,7 +56,7 @@ namespace { const XCoreSubtarget &Subtarget; public: explicit XCoreAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), DW(0), Subtarget(TM.getSubtarget()) {} diff --git a/lib/Target/XCore/MCSectionXCore.cpp b/lib/Target/XCore/MCSectionXCore.cpp index d2bb9e47d8..a40f0326a5 100644 --- a/lib/Target/XCore/MCSectionXCore.cpp +++ b/lib/Target/XCore/MCSectionXCore.cpp @@ -26,7 +26,7 @@ MCSectionXCore::Create(const StringRef &Section, unsigned Type, /// PrintTargetSpecificSectionFlags - This handles the XCore-specific cp/dp /// section flags. -void MCSectionXCore::PrintTargetSpecificSectionFlags(const TargetAsmInfo &TAI, +void MCSectionXCore::PrintTargetSpecificSectionFlags(const MCAsmInfo &TAI, raw_ostream &OS) const { if (getFlags() & MCSectionXCore::SHF_CP_SECTION) OS << 'c'; diff --git a/lib/Target/XCore/MCSectionXCore.h b/lib/Target/XCore/MCSectionXCore.h index e2e55bdaa6..7396f4e4c1 100644 --- a/lib/Target/XCore/MCSectionXCore.h +++ b/lib/Target/XCore/MCSectionXCore.h @@ -44,7 +44,7 @@ public: /// PrintTargetSpecificSectionFlags - This handles the XCore-specific cp/dp /// section flags. - virtual void PrintTargetSpecificSectionFlags(const TargetAsmInfo &TAI, + virtual void PrintTargetSpecificSectionFlags(const MCAsmInfo &TAI, raw_ostream &OS) const; }; diff --git a/lib/Target/XCore/XCoreMCAsmInfo.cpp b/lib/Target/XCore/XCoreMCAsmInfo.cpp new file mode 100644 index 0000000000..dffdda9a1f --- /dev/null +++ b/lib/Target/XCore/XCoreMCAsmInfo.cpp @@ -0,0 +1,31 @@ +//===-- XCoreMCAsmInfo.cpp - XCore asm properties -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "XCoreMCAsmInfo.h" +using namespace llvm; + +XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) { + SupportsDebugInformation = true; + Data16bitsDirective = "\t.short\t"; + Data32bitsDirective = "\t.long\t"; + Data64bitsDirective = 0; + ZeroDirective = "\t.space\t"; + CommentString = "#"; + + PrivateGlobalPrefix = ".L"; + AscizDirective = ".asciiz"; + WeakDefDirective = "\t.weak\t"; + WeakRefDirective = "\t.weak\t"; + SetDirective = "\t.set\t"; + + // Debug + HasLEB128 = true; + AbsoluteDebugSectionOffsets = true; +} + diff --git a/lib/Target/XCore/XCoreMCAsmInfo.h b/lib/Target/XCore/XCoreMCAsmInfo.h new file mode 100644 index 0000000000..01f8e481a9 --- /dev/null +++ b/lib/Target/XCore/XCoreMCAsmInfo.h @@ -0,0 +1,29 @@ +//=====-- XCoreMCAsmInfo.h - XCore asm properties -------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the XCoreMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef XCORETARGETASMINFO_H +#define XCORETARGETASMINFO_H + +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + class StringRef; + class XCoreMCAsmInfo : public MCAsmInfo { + public: + explicit XCoreMCAsmInfo(const Target &T, const StringRef &TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/XCore/XCoreTargetAsmInfo.cpp b/lib/Target/XCore/XCoreTargetAsmInfo.cpp deleted file mode 100644 index 9cd87a5755..0000000000 --- a/lib/Target/XCore/XCoreTargetAsmInfo.cpp +++ /dev/null @@ -1,31 +0,0 @@ -//===-- XCoreTargetAsmInfo.cpp - XCore asm properties ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "XCoreTargetAsmInfo.h" -using namespace llvm; - -XCoreTargetAsmInfo::XCoreTargetAsmInfo(const Target &T, const StringRef &TT) { - SupportsDebugInformation = true; - Data16bitsDirective = "\t.short\t"; - Data32bitsDirective = "\t.long\t"; - Data64bitsDirective = 0; - ZeroDirective = "\t.space\t"; - CommentString = "#"; - - PrivateGlobalPrefix = ".L"; - AscizDirective = ".asciiz"; - WeakDefDirective = "\t.weak\t"; - WeakRefDirective = "\t.weak\t"; - SetDirective = "\t.set\t"; - - // Debug - HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; -} - diff --git a/lib/Target/XCore/XCoreTargetAsmInfo.h b/lib/Target/XCore/XCoreTargetAsmInfo.h deleted file mode 100644 index 784288633f..0000000000 --- a/lib/Target/XCore/XCoreTargetAsmInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -//=====-- XCoreTargetAsmInfo.h - XCore asm properties ---------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the XCoreTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef XCORETARGETASMINFO_H -#define XCORETARGETASMINFO_H - -#include "llvm/Target/TargetAsmInfo.h" - -namespace llvm { - class Target; - class StringRef; - class XCoreTargetAsmInfo : public TargetAsmInfo { - public: - explicit XCoreTargetAsmInfo(const Target &T, const StringRef &TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp index b1afc7e61a..75f2055ebf 100644 --- a/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/lib/Target/XCore/XCoreTargetMachine.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "XCoreTargetAsmInfo.h" +#include "XCoreMCAsmInfo.h" #include "XCoreTargetMachine.h" #include "XCore.h" #include "llvm/Module.h" @@ -40,5 +40,5 @@ bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM, // Force static initialization. extern "C" void LLVMInitializeXCoreTarget() { RegisterTargetMachine X(TheXCoreTarget); - RegisterAsmInfo Y(TheXCoreTarget); + RegisterAsmInfo Y(TheXCoreTarget); } -- cgit v1.2.3