llvm.org GIT mirror llvm / af76e59
Rename TargetAsmInfo (and its subclasses) to MCAsmInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
143 changed file(s) with 1196 addition(s) and 1195 deletion(s). Raw diff Collapse all Expand all
4747 class MCStreamer;
4848 class DwarfWriter;
4949 class Mangler;
50 class TargetAsmInfo;
50 class MCAsmInfo;
5151 class TargetLoweringObjectFile;
5252 class Type;
5353 class formatted_raw_ostream;
9595
9696 /// Target Asm Printer information.
9797 ///
98 const TargetAsmInfo *TAI;
98 const MCAsmInfo *TAI;
9999
100100 /// Target Register Information.
101101 ///
148148
149149 protected:
150150 explicit AsmPrinter(formatted_raw_ostream &o, TargetMachine &TM,
151 const TargetAsmInfo *T, bool V);
151 const MCAsmInfo *T, bool V);
152152
153153 public:
154154 virtual ~AsmPrinter();
3333 class Value;
3434 class Module;
3535 class GlobalVariable;
36 class TargetAsmInfo;
36 class MCAsmInfo;
3737 class raw_ostream;
3838 class Instruction;
3939 class DICompileUnit;
6767 /// BeginModule - Emit all Dwarf sections that should come prior to the
6868 /// content.
6969 void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS,
70 AsmPrinter *A, const TargetAsmInfo *T);
70 AsmPrinter *A, const MCAsmInfo *T);
7171
7272 /// EndModule - Emit all Dwarf sections that should come after the content.
7373 ///
4141 class AsmPrinter;
4242 class GCStrategy;
4343 class Constant;
44 class TargetAsmInfo;
44 class MCAsmInfo;
4545
4646
4747 namespace GC {
6262
6363 /// beginAssembly/finishAssembly - Emit module metadata as assembly code.
6464 virtual void beginAssembly(raw_ostream &OS, AsmPrinter &AP,
65 const TargetAsmInfo &TAI);
65 const MCAsmInfo &TAI);
6666
6767 virtual void finishAssembly(raw_ostream &OS, AsmPrinter &AP,
68 const TargetAsmInfo &TAI);
68 const MCAsmInfo &TAI);
6969
7070 virtual ~GCMetadataPrinter();
7171 };
0
1 #include "llvm/Target/TargetAsmInfo.h"
2
0 #include "llvm/Target/COFFTargetAsmInfo.h"
1
0 #include "llvm/Target/DarwinTargetAsmInfo.h"
1919
2020 namespace llvm {
2121 class MCContext;
22 class TargetAsmInfo;
22 class MCAsmInfo;
2323 class raw_ostream;
2424
2525 /// MCSection - Instances of this class represent a uniqued identifier for a
3636
3737 SectionKind getKind() const { return Kind; }
3838
39 virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
39 virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
4040 raw_ostream &OS) const = 0;
4141 };
4242
6161 const std::string &getName() const { return Name; }
6262 bool isDirective() const { return IsDirective; }
6363
64 virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
64 virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
6565 raw_ostream &OS) const;
6666 };
6767
4747 /// ShouldOmitSectionDirective - Decides whether a '.section' directive
4848 /// should be printed before the section name
4949 bool ShouldOmitSectionDirective(const char *Name,
50 const TargetAsmInfo &TAI) const;
50 const MCAsmInfo &TAI) const;
5151
5252 /// ShouldPrintSectionType - Only prints the section type if supported
5353 bool ShouldPrintSectionType(unsigned Ty) const;
170170 unsigned getType() const { return Type; }
171171 unsigned getFlags() const { return Flags; }
172172
173 virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
173 virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
174174 raw_ostream &OS) const;
175175
176176
178178 /// MCSectionELF subclasses with target specific section flags should
179179 /// implement this method if they end up adding letters to the attributes
180180 /// list.
181 virtual void PrintTargetSpecificSectionFlags(const TargetAsmInfo &TAI,
181 virtual void PrintTargetSpecificSectionFlags(const MCAsmInfo &TAI,
182182 raw_ostream &OS) const {
183183 }
184184
165165 unsigned &TAA, // Out.
166166 unsigned &StubSize); // Out.
167167
168 virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
168 virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
169169 raw_ostream &OS) const;
170170 };
171171
2424 class MCSymbol;
2525 class StringRef;
2626 class raw_ostream;
27 class TargetAsmInfo;
27 class MCAsmInfo;
2828
2929 /// MCStreamer - Streaming machine code generation interface. This interface
3030 /// is intended to provide a programatic interface that is very similar to the
240240 ///
241241 /// \arg AP - If given, an AsmPrinter to use for printing instructions.
242242 MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS,
243 const TargetAsmInfo &TAI, AsmPrinter *AP = 0);
243 const MCAsmInfo &TAI, AsmPrinter *AP = 0);
244244
245245 // FIXME: These two may end up getting rolled into a single
246246 // createObjectStreamer interface, which implements the assembler backend, and
None //===-- COFFTargetAsmInfo.h - COFF asm properties ---------------*- C++ -*-===//
0 //===-- MCAsmInfoCOFF.h - COFF asm properties -------------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
99 #ifndef LLVM_COFF_TARGET_ASM_INFO_H
1010 #define LLVM_COFF_TARGET_ASM_INFO_H
1111
12 #include "llvm/Target/TargetAsmInfo.h"
12 #include "llvm/MC/MCAsmInfo.h"
1313
1414 namespace llvm {
15 class COFFTargetAsmInfo : public TargetAsmInfo {
15 class COFFMCAsmInfo : public MCAsmInfo {
1616 protected:
17 explicit COFFTargetAsmInfo();
17 explicit COFFMCAsmInfo();
1818
1919 };
2020 }
None //===---- DarwinTargetAsmInfo.h - Darwin asm properties ---------*- C++ -*-===//
0 //===---- DarwinMCAsmInfo.h - Darwin asm properties -------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1414 #ifndef LLVM_DARWIN_TARGET_ASM_INFO_H
1515 #define LLVM_DARWIN_TARGET_ASM_INFO_H
1616
17 #include "llvm/Target/TargetAsmInfo.h"
17 #include "llvm/MC/MCAsmInfo.h"
1818
1919 namespace llvm {
2020 class GlobalValue;
2222 class Type;
2323 class Mangler;
2424
25 struct DarwinTargetAsmInfo : public TargetAsmInfo {
26 explicit DarwinTargetAsmInfo();
25 struct DarwinMCAsmInfo : public MCAsmInfo {
26 explicit DarwinMCAsmInfo();
2727 };
2828 }
2929
None //===-- llvm/Target/TargetAsmInfo.h - Asm info ------------------*- C++ -*-===//
0 //===-- llvm/MC/MCAsmInfo.h - Asm info --------------------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
2222 namespace llvm {
2323 template class SmallVectorImpl;
2424
25 /// TargetAsmInfo - This class is intended to be used as a base class for asm
25 /// MCAsmInfo - This class is intended to be used as a base class for asm
2626 /// properties and features specific to the target.
2727 namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; }
2828
29 class TargetAsmInfo {
29 class MCAsmInfo {
3030 protected:
3131 //===------------------------------------------------------------------===//
3232 // Properties to be set by the target writer, used to configure asm printer.
309309 const char *const *AsmTransCBE; // Defaults to empty
310310
311311 public:
312 explicit TargetAsmInfo();
313 virtual ~TargetAsmInfo();
312 explicit MCAsmInfo();
313 virtual ~MCAsmInfo();
314314
315315 /// getSLEB128Size - Compute the number of bytes required for a signed
316316 /// leb128 value.
1818
1919 namespace llvm {
2020
21 class TargetAsmInfo;
21 class MCAsmInfo;
2222 class TargetRegisterClass;
2323 class TargetRegisterInfo;
2424 class LiveVariables;
463463 /// Measure the specified inline asm to determine an approximation of its
464464 /// length.
465465 virtual unsigned getInlineAsmLength(const char *Str,
466 const TargetAsmInfo &TAI) const;
466 const MCAsmInfo &TAI) const;
467467 };
468468
469469 /// TargetInstrInfoImpl - This is the default implementation of
2424 class GlobalValue;
2525 class StringRef;
2626 class TargetMachine;
27 class TargetAsmInfo;
27 class MCAsmInfo;
2828
2929 class TargetLoweringObjectFile {
3030 MCContext *Ctx;
2020 namespace llvm {
2121
2222 class Target;
23 class TargetAsmInfo;
23 class MCAsmInfo;
2424 class TargetData;
2525 class TargetSubtarget;
2626 class TargetInstrInfo;
101101
102102 /// AsmInfo - Contains target specific asm information.
103103 ///
104 const TargetAsmInfo *AsmInfo;
104 const MCAsmInfo *AsmInfo;
105105
106106 public:
107107 virtual ~TargetMachine();
119119 virtual TargetLowering *getTargetLowering() const { return 0; }
120120 virtual const TargetData *getTargetData() const { return 0; }
121121
122 /// getTargetAsmInfo - Return target specific asm information.
123 ///
124 const TargetAsmInfo *getTargetAsmInfo() const { return AsmInfo; }
122 /// getMCAsmInfo - Return target specific asm information.
123 ///
124 const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
125125
126126 /// getSubtarget - This method returns a pointer to the specified type of
127127 /// TargetSubtarget. In debug builds, it verifies that the object being
2626 class AsmPrinter;
2727 class MCAsmParser;
2828 class Module;
29 class TargetAsmInfo;
29 class MCAsmInfo;
3030 class TargetAsmParser;
3131 class TargetMachine;
3232 class formatted_raw_ostream;
4545
4646 typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT);
4747
48 typedef const TargetAsmInfo *(*AsmInfoCtorFnTy)(const Target &T,
49 const StringRef &TT);
48 typedef const MCAsmInfo *(*AsmInfoCtorFnTy)(const Target &T,
49 const StringRef &TT);
5050 typedef TargetMachine *(*TargetMachineCtorTy)(const Target &T,
5151 const std::string &TT,
5252 const std::string &Features);
5353 typedef AsmPrinter *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS,
5454 TargetMachine &TM,
55 const TargetAsmInfo *TAI,
55 const MCAsmInfo *TAI,
5656 bool VerboseAsm);
5757 typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,
5858 MCAsmParser &P);
110110 bool hasAsmParser() const { return AsmParserCtorFn != 0; }
111111
112112
113 /// createAsmInfo - Create a TargetAsmInfo implementation for the specified
113 /// createAsmInfo - Create a MCAsmInfo implementation for the specified
114114 /// target triple.
115115 ///
116116 /// \arg Triple - This argument is used to determine the target machine
117117 /// feature set; it should always be provided. Generally this should be
118118 /// either the target triple from the module, or the target triple of the
119119 /// host if that does not exist.
120 const TargetAsmInfo *createAsmInfo(const StringRef &Triple) const {
120 const MCAsmInfo *createAsmInfo(const StringRef &Triple) const {
121121 if (!AsmInfoCtorFn)
122122 return 0;
123123 return AsmInfoCtorFn(*this, Triple);
139139
140140 /// createAsmPrinter - Create a target specific assembly printer pass.
141141 AsmPrinter *createAsmPrinter(formatted_raw_ostream &OS, TargetMachine &TM,
142 const TargetAsmInfo *TAI, bool Verbose) const {
142 const MCAsmInfo *TAI, bool Verbose) const {
143143 if (!AsmPrinterCtorFn)
144144 return 0;
145145 return AsmPrinterCtorFn(OS, TM, TAI, Verbose);
242242 Target::TripleMatchQualityFnTy TQualityFn,
243243 bool HasJIT = false);
244244
245 /// RegisterAsmInfo - Register a TargetAsmInfo implementation for the
245 /// RegisterAsmInfo - Register a MCAsmInfo implementation for the
246246 /// given target.
247247 ///
248248 /// Clients are responsible for ensuring that registration doesn't occur
250250 /// this is done by initializing all targets at program startup.
251251 ///
252252 /// @param T - The target being registered.
253 /// @param Fn - A function to construct a TargetAsmInfo for the target.
253 /// @param Fn - A function to construct a MCAsmInfo for the target.
254254 static void RegisterAsmInfo(Target &T, Target::AsmInfoCtorFnTy Fn) {
255255 // Ignore duplicate registration.
256256 if (!T.AsmInfoCtorFn)
339339 ///
340340 /// extern "C" void LLVMInitializeFooTarget() {
341341 /// extern Target TheFooTarget;
342 /// RegisterAsmInfo X(TheFooTarget);
343 /// }
344 template
342 /// RegisterAsmInfo X(TheFooTarget);
343 /// }
344 template
345345 struct RegisterAsmInfo {
346346 RegisterAsmInfo(Target &T) {
347347 TargetRegistry::RegisterAsmInfo(T, &Allocator);
348348 }
349349 private:
350 static const TargetAsmInfo *Allocator(const Target &T, const StringRef &TT){
351 return new TargetAsmInfoImpl(T, TT);
350 static const MCAsmInfo *Allocator(const Target &T, const StringRef &TT) {
351 return new MCAsmInfoImpl(T, TT);
352352 }
353353
354354 };
405405
406406 private:
407407 static AsmPrinter *Allocator(formatted_raw_ostream &OS, TargetMachine &TM,
408 const TargetAsmInfo *TAI, bool Verbose) {
408 const MCAsmInfo *TAI, bool Verbose) {
409409 return new AsmPrinterImpl(OS, TM, TAI, Verbose);
410410 }
411411 };
3131 #include "llvm/Support/ErrorHandling.h"
3232 #include "llvm/Support/FormattedStream.h"
3333 #include "llvm/Support/Mangler.h"
34 #include "llvm/Target/TargetAsmInfo.h"
34 #include "llvm/MC/MCAsmInfo.h"
3535 #include "llvm/Target/TargetData.h"
3636 #include "llvm/Target/TargetLowering.h"
3737 #include "llvm/Target/TargetLoweringObjectFile.h"
4949
5050 char AsmPrinter::ID = 0;
5151 AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
52 const TargetAsmInfo *T, bool VDef)
52 const MCAsmInfo *T, bool VDef)
5353 : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
5454 TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
5555
17911791 ///
17921792 static void PrintChildLoopComment(formatted_raw_ostream &O,
17931793 const MachineLoop *loop,
1794 const TargetAsmInfo *TAI,
1794 const MCAsmInfo *TAI,
17951795 int FunctionNumber) {
17961796 // Add child loop information
17971797 for(MachineLoop::iterator cl = loop->begin(),
1313 #include "DIE.h"
1414 #include "DwarfPrinter.h"
1515 #include "llvm/CodeGen/AsmPrinter.h"
16 #include "llvm/Target/TargetAsmInfo.h"
16 #include "llvm/MC/MCAsmInfo.h"
1717 #include "llvm/Target/TargetData.h"
1818 #include "llvm/Support/ErrorHandling.h"
1919 #include
223223 case dwarf::DW_FORM_data4: return sizeof(int32_t);
224224 case dwarf::DW_FORM_ref8: // Fall thru
225225 case dwarf::DW_FORM_data8: return sizeof(int64_t);
226 case dwarf::DW_FORM_udata: return TargetAsmInfo::getULEB128Size(Integer);
227 case dwarf::DW_FORM_sdata: return TargetAsmInfo::getSLEB128Size(Integer);
226 case dwarf::DW_FORM_udata: return MCAsmInfo::getULEB128Size(Integer);
227 case dwarf::DW_FORM_sdata: return MCAsmInfo::getSLEB128Size(Integer);
228228 default: llvm_unreachable("DIE Value form not supported yet"); break;
229229 }
230230 return 0;
498498 case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
499499 case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
500500 case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
501 case dwarf::DW_FORM_block: return Size + TargetAsmInfo::getULEB128Size(Size);
501 case dwarf::DW_FORM_block: return Size + MCAsmInfo::getULEB128Size(Size);
502502 default: llvm_unreachable("Improper form for block"); break;
503503 }
504504 return 0;
1616 #include "llvm/CodeGen/MachineModuleInfo.h"
1717 #include "llvm/MC/MCSection.h"
1818 #include "llvm/MC/MCStreamer.h"
19 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/MC/MCAsmInfo.h"
2020 #include "llvm/Target/TargetData.h"
2121 #include "llvm/Target/TargetFrameInfo.h"
2222 #include "llvm/Target/TargetLoweringObjectFile.h"
223223
224224 } // end llvm namespace
225225
226 DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
226 DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T)
227227 : Dwarf(OS, A, T, "dbg"), ModuleCU(0),
228228 AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
229229 ValuesSet(InitValuesSetSize), Values(), StringPool(),
17931793 Die->setOffset(Offset);
17941794
17951795 // Start the size with the size of abbreviation code.
1796 Offset += TargetAsmInfo::getULEB128Size(AbbrevNumber);
1796 Offset += MCAsmInfo::getULEB128Size(AbbrevNumber);
17971797
17981798 const SmallVector &Values = Die->getValues();
17991799 const SmallVector &AbbrevData = Abbrev->getData();
3434 class DbgConcreteScope;
3535 class MachineFrameInfo;
3636 class MachineModuleInfo;
37 class TargetAsmInfo;
37 class MCAsmInfo;
3838 class Timer;
3939
4040 //===----------------------------------------------------------------------===//
457457 //===--------------------------------------------------------------------===//
458458 // Main entry points.
459459 //
460 DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
460 DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T);
461461 virtual ~DwarfDebug();
462462
463463 /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
1717 #include "llvm/CodeGen/MachineFunction.h"
1818 #include "llvm/CodeGen/MachineLocation.h"
1919 #include "llvm/MC/MCStreamer.h"
20 #include "llvm/Target/TargetAsmInfo.h"
20 #include "llvm/MC/MCAsmInfo.h"
2121 #include "llvm/Target/TargetData.h"
2222 #include "llvm/Target/TargetFrameInfo.h"
2323 #include "llvm/Target/TargetLoweringObjectFile.h"
3535 }
3636
3737 DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A,
38 const TargetAsmInfo *T)
38 const MCAsmInfo *T)
3939 : Dwarf(OS, A, T, "eh"), shouldEmitTable(false), shouldEmitMoves(false),
4040 shouldEmitTableModule(false), shouldEmitMovesModule(false),
4141 ExceptionTimer(0) {
303303 for (std::vector::const_iterator
304304 I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) {
305305 FilterOffsets.push_back(Offset);
306 Offset -= TargetAsmInfo::getULEB128Size(*I);
306 Offset -= MCAsmInfo::getULEB128Size(*I);
307307 }
308308
309309 FirstActions.reserve(LandingPads.size());
327327 const unsigned SizePrevIds = PrevLPI->TypeIds.size();
328328 assert(Actions.size());
329329 PrevAction = &Actions.back();
330 SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) +
331 TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
330 SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
331 MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
332332
333333 for (unsigned j = NumShared; j != SizePrevIds; ++j) {
334334 SizeAction -=
335 TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
335 MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
336336 SizeAction += -PrevAction->NextAction;
337337 PrevAction = PrevAction->Previous;
338338 }
343343 int TypeID = TypeIds[J];
344344 assert(-1 - TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
345345 int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
346 unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID);
346 unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
347347
348348 int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
349 SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction);
349 SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
350350 SizeSiteActions += SizeAction;
351351
352352 ActionEntry Action = { ValueForTypeID, NextAction, PrevAction };
555555 SizeSites = CallSites.size() *
556556 (SiteStartSize + SiteLengthSize + LandingPadSize);
557557 for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
558 SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action);
558 SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
559559 if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
560 SizeSites += TargetAsmInfo::getULEB128Size(i);
560 SizeSites += MCAsmInfo::getULEB128Size(i);
561561 }
562562 // Type infos.
563563 const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
564564 unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
565565
566566 unsigned TypeOffset = sizeof(int8_t) + // Call site format
567 TargetAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
567 MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
568568 SizeSites + SizeActions + SizeTypes;
569569
570570 unsigned TotalSize = sizeof(int8_t) + // LPStart format
571571 sizeof(int8_t) + // TType format
572572 (HaveTTData ?
573 TargetAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset
573 MCAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset
574574 TypeOffset;
575575
576576 unsigned SizeAlign = (4 - TotalSize) & 3;
2323
2424 struct LandingPadInfo;
2525 class MachineModuleInfo;
26 class TargetAsmInfo;
26 class MCAsmInfo;
2727 class Timer;
2828 class raw_ostream;
2929
163163 //===--------------------------------------------------------------------===//
164164 // Main entry points.
165165 //
166 DwarfException(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
166 DwarfException(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T);
167167 virtual ~DwarfException();
168168
169169 /// BeginModule - Emit all exception information that should come prior to the
1818 #include "llvm/CodeGen/MachineModuleInfo.h"
1919 #include "llvm/Support/Dwarf.h"
2020 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Target/TargetAsmInfo.h"
21 #include "llvm/MC/MCAsmInfo.h"
2222 #include "llvm/Target/TargetData.h"
2323 #include "llvm/Target/TargetFrameInfo.h"
2424 #include "llvm/Target/TargetRegisterInfo.h"
2525
2626 using namespace llvm;
2727
28 Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T,
28 Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
2929 const char *flavor)
3030 : O(OS), Asm(A), TAI(T), TD(Asm->TM.getTargetData()),
3131 RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),
2424 class MachineFunction;
2525 class MachineModuleInfo;
2626 class Module;
27 class TargetAsmInfo;
27 class MCAsmInfo;
2828 class TargetData;
2929 class TargetRegisterInfo;
3030
4444
4545 /// TAI - Target asm information.
4646 ///
47 const TargetAsmInfo *TAI;
47 const MCAsmInfo *TAI;
4848
4949 /// TD - Target data.
5050 ///
7979 ///
8080 unsigned SetCounter;
8181
82 Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T,
82 Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
8383 const char *flavor);
8484 public:
8585 //===------------------------------------------------------------------===//
8787 //
8888 const AsmPrinter *getAsm() const { return Asm; }
8989 MachineModuleInfo *getMMI() const { return MMI; }
90 const TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
90 const MCAsmInfo *getMCAsmInfo() const { return TAI; }
9191 const TargetData *getTargetData() const { return TD; }
9292
9393 void PrintRelDirective(bool Force32Bit = false,
3838 void DwarfWriter::BeginModule(Module *M,
3939 MachineModuleInfo *MMI,
4040 raw_ostream &OS, AsmPrinter *A,
41 const TargetAsmInfo *T) {
41 const MCAsmInfo *T) {
4242 DE = new DwarfException(OS, A, T);
4343 DD = new DwarfDebug(OS, A, T);
4444 DE->BeginModule(M, MMI);
1515 #include "llvm/CodeGen/GCMetadataPrinter.h"
1616 #include "llvm/Module.h"
1717 #include "llvm/MC/MCStreamer.h"
18 #include "llvm/Target/TargetAsmInfo.h"
18 #include "llvm/MC/MCAsmInfo.h"
1919 #include "llvm/Target/TargetData.h"
2020 #include "llvm/Target/TargetLoweringObjectFile.h"
2121 #include "llvm/Target/TargetMachine.h"
2929 class VISIBILITY_HIDDEN OcamlGCMetadataPrinter : public GCMetadataPrinter {
3030 public:
3131 void beginAssembly(raw_ostream &OS, AsmPrinter &AP,
32 const TargetAsmInfo &TAI);
32 const MCAsmInfo &TAI);
3333
3434 void finishAssembly(raw_ostream &OS, AsmPrinter &AP,
35 const TargetAsmInfo &TAI);
35 const MCAsmInfo &TAI);
3636 };
3737
3838 }
4343 void llvm::linkOcamlGCPrinter() { }
4444
4545 static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP,
46 const TargetAsmInfo &TAI, const char *Id) {
46 const MCAsmInfo &TAI, const char *Id) {
4747 const std::string &MId = M.getModuleIdentifier();
4848
4949 std::string Mangled;
6363 }
6464
6565 void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
66 const TargetAsmInfo &TAI) {
66 const MCAsmInfo &TAI) {
6767 AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection());
6868 EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
6969
8888 /// either condition is detected in a function which uses the GC.
8989 ///
9090 void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP,
91 const TargetAsmInfo &TAI) {
91 const MCAsmInfo &TAI) {
9292 const char *AddressDirective;
9393 int AddressAlignLog;
9494 if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) {
2222 #include "llvm/Target/TargetData.h"
2323 #include "llvm/Target/TargetELFWriterInfo.h"
2424 #include "llvm/Target/TargetMachine.h"
25 #include "llvm/Target/TargetAsmInfo.h"
25 #include "llvm/MC/MCAsmInfo.h"
2626 #include "llvm/Support/Debug.h"
2727 #include "llvm/Support/ErrorHandling.h"
2828 #include "llvm/Support/raw_ostream.h"
4343 #include "llvm/CodeGen/MachineConstantPool.h"
4444 #include "llvm/MC/MCContext.h"
4545 #include "llvm/MC/MCSectionELF.h"
46 #include "llvm/Target/TargetAsmInfo.h"
46 #include "llvm/MC/MCAsmInfo.h"
4747 #include "llvm/Target/TargetData.h"
4848 #include "llvm/Target/TargetELFWriterInfo.h"
4949 #include "llvm/Target/TargetLowering.h"
7979 isLittleEndian(TM.getTargetData()->isLittleEndian()),
8080 ElfHdr(isLittleEndian, is64Bit) {
8181
82 TAI = TM.getTargetAsmInfo();
82 TAI = TM.getMCAsmInfo();
8383 TEW = TM.getELFWriterInfo();
8484
8585 // Create the object code emitter object for this target.
3131 class MachineCodeEmitter;
3232 class MachineConstantPoolEntry;
3333 class ObjectCodeEmitter;
34 class TargetAsmInfo;
34 class MCAsmInfo;
3535 class TargetELFWriterInfo;
3636 class TargetLoweringObjectFile;
3737 class raw_ostream;
8787
8888 /// TAI - Target Asm Info, provide information about section names for
8989 /// globals and other target specific stuff.
90 const TargetAsmInfo *TAI;
90 const MCAsmInfo *TAI;
9191
9292 //===------------------------------------------------------------------===//
9393 // Properties inferred automatically from the target machine.
1919 GCMetadataPrinter::~GCMetadataPrinter() { }
2020
2121 void GCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
22 const TargetAsmInfo &TAI) {
22 const MCAsmInfo &TAI) {
2323 // Default is no action.
2424 }
2525
2626 void GCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP,
27 const TargetAsmInfo &TAI) {
27 const MCAsmInfo &TAI) {
2828 // Default is no action.
2929 }
1919 #include "llvm/CodeGen/GCStrategy.h"
2020 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
2121 #include "llvm/Target/TargetOptions.h"
22 #include "llvm/Target/TargetAsmInfo.h"
22 #include "llvm/MC/MCAsmInfo.h"
2323 #include "llvm/Target/TargetRegistry.h"
2424 #include "llvm/Transforms/Scalar.h"
2525 #include "llvm/Support/CommandLine.h"
107107 bool Verbose,
108108 formatted_raw_ostream &Out) {
109109 FunctionPass *Printer =
110 getTarget().createAsmPrinter(Out, *this, getTargetAsmInfo(), Verbose);
110 getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(), Verbose);
111111 if (!Printer)
112112 return true;
113113
238238
239239 // Turn exception handling constructs into something the code generators can
240240 // handle.
241 switch (getTargetAsmInfo()->getExceptionHandlingType())
241 switch (getMCAsmInfo()->getExceptionHandlingType())
242242 {
243243 case ExceptionHandling::SjLj:
244244 // SjLj piggy-backs on dwarf for this bit. The cleanups done apply to both
2020 namespace llvm {
2121
2222 class GlobalValue;
23 class TargetAsmInfo;
23 class MCAsmInfo;
2424
2525 /// MachOSym - This struct contains information about each symbol that is
2626 /// added to logical symbol table for the module. This is eventually
6767 };
6868
6969 MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
70 const TargetAsmInfo *TAI);
70 const MCAsmInfo *TAI);
7171
7272 struct SymCmp {
7373 // FIXME: this does not appear to be sorting 'f' after 'F'
1616 #include "llvm/CodeGen/MachineFunction.h"
1717 #include "llvm/CodeGen/MachineJumpTableInfo.h"
1818 #include "llvm/CodeGen/MachineRelocation.h"
19 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/MC/MCAsmInfo.h"
2020 #include "llvm/Target/TargetData.h"
2121 #include "llvm/Target/TargetMachine.h"
2222 #include "llvm/Support/ErrorHandling.h"
3434 ObjectCodeEmitter(&mos), MOW(mow), TM(MOW.TM) {
3535 is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
3636 isLittleEndian = TM.getTargetData()->isLittleEndian();
37 TAI = TM.getTargetAsmInfo();
37 TAI = TM.getMCAsmInfo();
3838 }
3939
4040 /// startFunction - This callback is invoked when a new machine function is
2929 /// machine directly, indicating what header values and flags to set.
3030 bool is64Bit, isLittleEndian;
3131
32 const TargetAsmInfo *TAI;
32 const MCAsmInfo *TAI;
3333
3434 /// Relocations - These are the relocations that the function needs, as
3535 /// emitted.
2828 #include "llvm/DerivedTypes.h"
2929 #include "llvm/Module.h"
3030 #include "llvm/PassManager.h"
31 #include "llvm/Target/TargetAsmInfo.h"
31 #include "llvm/MC/MCAsmInfo.h"
3232 #include "llvm/Target/TargetData.h"
3333 #include "llvm/Target/TargetMachine.h"
3434 #include "llvm/Target/TargetMachOWriterInfo.h"
6060 is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
6161 isLittleEndian = TM.getTargetData()->isLittleEndian();
6262
63 TAI = TM.getTargetAsmInfo();
63 TAI = TM.getMCAsmInfo();
6464
6565 // Create the machine code emitter object for this target.
6666 MachOCE = new MachOCodeEmitter(*this, *getTextSection(true));
742742 //===----------------------------------------------------------------------===//
743743
744744 MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
745 const TargetAsmInfo *TAI) :
745 const MCAsmInfo *TAI) :
746746 GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect),
747747 n_desc(0), n_value(0) {
748748
3030 struct MachOSym;
3131 class TargetData;
3232 class TargetMachine;
33 class TargetAsmInfo;
33 class MCAsmInfo;
3434 class ObjectCodeEmitter;
3535 class OutputBuffer;
3636 class raw_ostream;
7777 bool is64Bit, isLittleEndian;
7878
7979 // Target Asm Info
80 const TargetAsmInfo *TAI;
80 const MCAsmInfo *TAI;
8181
8282 /// Header - An instance of MachOHeader that we will update while we build
8383 /// the file, and then emit during finalization.
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "llvm/Target/TargetLowering.h"
14 #include "llvm/Target/TargetAsmInfo.h"
14 #include "llvm/MC/MCAsmInfo.h"
1515 #include "llvm/Target/TargetData.h"
1616 #include "llvm/Target/TargetLoweringObjectFile.h"
1717 #include "llvm/Target/TargetMachine.h"
529529 InitLibcallCallingConvs(LibcallCallingConvs);
530530
531531 // Tell Legalize whether the assembler supports DEBUG_LOC.
532 const TargetAsmInfo *TASM = TM.getTargetAsmInfo();
532 const MCAsmInfo *TASM = TM.getMCAsmInfo();
533533 if (!TASM || !TASM->hasDotLocAndDotFile())
534534 setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
535535 }
2121 #include "llvm/CodeGen/MachineModuleInfo.h"
2222 #include "llvm/ExecutionEngine/JITMemoryManager.h"
2323 #include "llvm/Support/ErrorHandling.h"
24 #include "llvm/Target/TargetAsmInfo.h"
24 #include "llvm/MC/MCAsmInfo.h"
2525 #include "llvm/Target/TargetData.h"
2626 #include "llvm/Target/TargetInstrInfo.h"
2727 #include "llvm/Target/TargetFrameInfo.h"
3939 unsigned char* EndFunction) {
4040 const TargetMachine& TM = F.getTarget();
4141 TD = TM.getTargetData();
42 needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding();
42 needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding();
4343 stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
4444 RI = TM.getRegisterInfo();
4545 JCE = &jce;
241241 for(std::vector::const_iterator I = FilterIds.begin(),
242242 E = FilterIds.end(); I != E; ++I) {
243243 FilterOffsets.push_back(Offset);
244 Offset -= TargetAsmInfo::getULEB128Size(*I);
244 Offset -= MCAsmInfo::getULEB128Size(*I);
245245 }
246246
247247 // Compute the actions table and gather the first action index for each
266266 const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
267267 assert(Actions.size());
268268 PrevAction = &Actions.back();
269 SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) +
270 TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
269 SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
270 MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
271271 for (unsigned j = NumShared; j != SizePrevIds; ++j) {
272 SizeAction -= TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
272 SizeAction -= MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
273273 SizeAction += -PrevAction->NextAction;
274274 PrevAction = PrevAction->Previous;
275275 }
280280 int TypeID = TypeIds[I];
281281 assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
282282 int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
283 unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID);
283 unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
284284
285285 int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
286 SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction);
286 SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
287287 SizeSiteActions += SizeAction;
288288
289289 ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
386386 sizeof(int32_t) + // Site length.
387387 sizeof(int32_t)); // Landing pad.
388388 for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
389 SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action);
389 SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
390390
391391 unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize();
392392
393393 unsigned TypeOffset = sizeof(int8_t) + // Call site format
394394 // Call-site table length
395 TargetAsmInfo::getULEB128Size(SizeSites) +
395 MCAsmInfo::getULEB128Size(SizeSites) +
396396 SizeSites + SizeActions + SizeTypes;
397397
398398 // Begin the exception table.
606606 unsigned char* EndFunction) {
607607 const TargetMachine& TM = F.getTarget();
608608 TD = TM.getTargetData();
609 needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding();
609 needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding();
610610 stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
611611 RI = TM.getRegisterInfo();
612612 JCE = &jce;
644644 // If there is a personality and landing pads then point to the language
645645 // specific data area in the exception table.
646646 if (MMI->getPersonalityIndex()) {
647 FinalSize += TargetAsmInfo::getULEB128Size(4);
647 FinalSize += MCAsmInfo::getULEB128Size(4);
648648 FinalSize += PointerSize;
649649 } else {
650 FinalSize += TargetAsmInfo::getULEB128Size(0);
650 FinalSize += MCAsmInfo::getULEB128Size(0);
651651 }
652652
653653 // Indicate locations of function specific callee saved registers in
675675 FinalSize += 4;
676676 FinalSize += 1;
677677 FinalSize += Personality ? 5 : 3; // "zPLR" or "zR"
678 FinalSize += TargetAsmInfo::getULEB128Size(1);
679 FinalSize += TargetAsmInfo::getSLEB128Size(stackGrowth);
678 FinalSize += MCAsmInfo::getULEB128Size(1);
679 FinalSize += MCAsmInfo::getSLEB128Size(stackGrowth);
680680 FinalSize += 1;
681681
682682 if (Personality) {
683 FinalSize += TargetAsmInfo::getULEB128Size(7);
683 FinalSize += MCAsmInfo::getULEB128Size(7);
684684
685685 // Encoding
686686 FinalSize+= 1;
687687 //Personality
688688 FinalSize += PointerSize;
689689
690 FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
691 FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
690 FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
691 FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
692692
693693 } else {
694 FinalSize += TargetAsmInfo::getULEB128Size(1);
695 FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
694 FinalSize += MCAsmInfo::getULEB128Size(1);
695 FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
696696 }
697697
698698 std::vector Moves;
744744 } else {
745745 ++FinalSize;
746746 unsigned RegNum = RI->getDwarfRegNum(Src.getReg(), true);
747 FinalSize += TargetAsmInfo::getULEB128Size(RegNum);
747 FinalSize += MCAsmInfo::getULEB128Size(RegNum);
748748 }
749749
750750 int Offset = -Src.getOffset();
751751
752 FinalSize += TargetAsmInfo::getULEB128Size(Offset);
752 FinalSize += MCAsmInfo::getULEB128Size(Offset);
753753 } else {
754754 llvm_unreachable("Machine move no supported yet.");
755755 }
758758 if (Dst.isReg()) {
759759 ++FinalSize;
760760 unsigned RegNum = RI->getDwarfRegNum(Dst.getReg(), true);
761 FinalSize += TargetAsmInfo::getULEB128Size(RegNum);
761 FinalSize += MCAsmInfo::getULEB128Size(RegNum);
762762 } else {
763763 llvm_unreachable("Machine move no supported yet.");
764764 }
768768
769769 if (Offset < 0) {
770770 ++FinalSize;
771 FinalSize += TargetAsmInfo::getULEB128Size(Reg);
772 FinalSize += TargetAsmInfo::getSLEB128Size(Offset);
771 FinalSize += MCAsmInfo::getULEB128Size(Reg);
772 FinalSize += MCAsmInfo::getSLEB128Size(Offset);
773773 } else if (Reg < 64) {
774774 ++FinalSize;
775 FinalSize += TargetAsmInfo::getULEB128Size(Offset);
775 FinalSize += MCAsmInfo::getULEB128Size(Offset);
776776 } else {
777777 ++FinalSize;
778 FinalSize += TargetAsmInfo::getULEB128Size(Reg);
779 FinalSize += TargetAsmInfo::getULEB128Size(Offset);
778 FinalSize += MCAsmInfo::getULEB128Size(Reg);
779 FinalSize += MCAsmInfo::getULEB128Size(Offset);
780780 }
781781 }
782782 }
819819 for(std::vector::const_iterator I = FilterIds.begin(),
820820 E = FilterIds.end(); I != E; ++I) {
821821 FilterOffsets.push_back(Offset);
822 Offset -= TargetAsmInfo::getULEB128Size(*I);
822 Offset -= MCAsmInfo::getULEB128Size(*I);
823823 }
824824
825825 // Compute the actions table and gather the first action index for each
844844 const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
845845 assert(Actions.size());
846846 PrevAction = &Actions.back();
847 SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) +
848 TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
847 SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
848 MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
849849 for (unsigned j = NumShared; j != SizePrevIds; ++j) {
850 SizeAction -= TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
850 SizeAction -= MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
851851 SizeAction += -PrevAction->NextAction;
852852 PrevAction = PrevAction->Previous;
853853 }
858858 int TypeID = TypeIds[I];
859859 assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
860860 int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
861 unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID);
861 unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
862862
863863 int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
864 SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction);
864 SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
865865 SizeSiteActions += SizeAction;
866866
867867 ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
964964 sizeof(int32_t) + // Site length.
965965 sizeof(int32_t)); // Landing pad.
966966 for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
967 SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action);
967 SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
968968
969969 unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize();
970970
971971 unsigned TypeOffset = sizeof(int8_t) + // Call site format
972972 // Call-site table length
973 TargetAsmInfo::getULEB128Size(SizeSites) +
973 MCAsmInfo::getULEB128Size(SizeSites) +
974974 SizeSites + SizeActions + SizeTypes;
975975
976976 unsigned TotalSize = sizeof(int8_t) + // LPStart format
977977 sizeof(int8_t) + // TType format
978 TargetAsmInfo::getULEB128Size(TypeOffset) + // TType base offset
978 MCAsmInfo::getULEB128Size(TypeOffset) + // TType base offset
979979 TypeOffset;
980980
981981 unsigned SizeAlign = (4 - TotalSize) & 3;
10131013 // Asm->EOL("Landing pad");
10141014 FinalSize += PointerSize;
10151015
1016 FinalSize += TargetAsmInfo::getULEB128Size(S.Action);
1016 FinalSize += MCAsmInfo::getULEB128Size(S.Action);
10171017 // Asm->EOL("Action");
10181018 }
10191019
10221022 ActionEntry &Action = Actions[I];
10231023
10241024 //Asm->EOL("TypeInfo index");
1025 FinalSize += TargetAsmInfo::getSLEB128Size(Action.ValueForTypeID);
1025 FinalSize += MCAsmInfo::getSLEB128Size(Action.ValueForTypeID);
10261026 //Asm->EOL("Next action");
1027 FinalSize += TargetAsmInfo::getSLEB128Size(Action.NextAction);
1027 FinalSize += MCAsmInfo::getSLEB128Size(Action.NextAction);
10281028 }
10291029
10301030 // Emit the type ids.
10361036 // Emit the filter typeids.
10371037 for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) {
10381038 unsigned TypeID = FilterIds[j];
1039 FinalSize += TargetAsmInfo::getULEB128Size(TypeID);
1039 FinalSize += MCAsmInfo::getULEB128Size(TypeID);
10401040 //Asm->EOL("Filter TypeInfo index");
10411041 }
10421042
1313 #include "llvm/MC/MCSectionMachO.h"
1414 #include "llvm/MC/MCSymbol.h"
1515 #include "llvm/MC/MCValue.h"
16 #include "llvm/Target/TargetAsmInfo.h"
16 #include "llvm/MC/MCAsmInfo.h"
1717 #include "llvm/Support/ErrorHandling.h"
1818 #include "llvm/Support/MathExtras.h"
1919 #include "llvm/Support/raw_ostream.h"
2323
2424 class MCAsmStreamer : public MCStreamer {
2525 raw_ostream &OS;
26 const TargetAsmInfo &TAI;
26 const MCAsmInfo &TAI;
2727 AsmPrinter *Printer;
2828 public:
29 MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const TargetAsmInfo &tai,
29 MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const MCAsmInfo &tai,
3030 AsmPrinter *_AsmPrinter)
3131 : MCStreamer(Context), OS(_OS), TAI(tai), Printer(_AsmPrinter) {}
3232 ~MCAsmStreamer() {}
313313 }
314314
315315 MCStreamer *llvm::createAsmStreamer(MCContext &Context, raw_ostream &OS,
316 const TargetAsmInfo &TAI, AsmPrinter *AP) {
316 const MCAsmInfo &TAI, AsmPrinter *AP) {
317317 return new MCAsmStreamer(Context, OS, TAI, AP);
318318 }
88
99 #include "llvm/MC/MCSection.h"
1010 #include "llvm/MC/MCContext.h"
11 #include "llvm/Target/TargetAsmInfo.h"
11 #include "llvm/MC/MCAsmInfo.h"
1212 #include "llvm/Support/raw_ostream.h"
1313 using namespace llvm;
1414
2828 return new (Ctx) MCSectionCOFF(Name, IsDirective, K);
2929 }
3030
31 void MCSectionCOFF::PrintSwitchToSection(const TargetAsmInfo &TAI,
31 void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &TAI,
3232 raw_ostream &OS) const {
3333
3434 if (isDirective()) {
99 #include "llvm/MC/MCSectionELF.h"
1010 #include "llvm/MC/MCContext.h"
1111 #include "llvm/Support/raw_ostream.h"
12 #include "llvm/Target/TargetAsmInfo.h"
12 #include "llvm/MC/MCAsmInfo.h"
1313
1414 using namespace llvm;
1515
2222 // ShouldOmitSectionDirective - Decides whether a '.section' directive
2323 // should be printed before the section name
2424 bool MCSectionELF::ShouldOmitSectionDirective(const char *Name,
25 const TargetAsmInfo &TAI) const {
25 const MCAsmInfo &TAI) const {
2626
2727 // FIXME: Does .section .bss/.data/.text work everywhere??
2828 if (strcmp(Name, ".text") == 0 ||
4343 return true;
4444 }
4545
46 void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI,
46 void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &TAI,
4747 raw_ostream &OS) const {
4848
4949 if (ShouldOmitSectionDirective(SectionName.c_str(), TAI)) {
7171 Reserved2, K);
7272 }
7373
74 void MCSectionMachO::PrintSwitchToSection(const TargetAsmInfo &TAI,
74 void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &TAI,
7575 raw_ostream &OS) const {
7676 OS << "\t.section\t" << getSegmentName() << ',' << getSectionName();
7777
2020 #include "llvm/CodeGen/MachineFrameInfo.h"
2121 #include "llvm/CodeGen/MachineInstrBuilder.h"
2222 #include "llvm/CodeGen/MachineJumpTableInfo.h"
23 #include "llvm/Target/TargetAsmInfo.h"
23 #include "llvm/MC/MCAsmInfo.h"
2424 #include "llvm/Support/CommandLine.h"
2525 #include "llvm/Support/ErrorHandling.h"
2626 using namespace llvm;
404404 unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
405405 const MachineBasicBlock &MBB = *MI->getParent();
406406 const MachineFunction *MF = MBB.getParent();
407 const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo();
407 const MCAsmInfo *TAI = MF->getTarget().getMCAsmInfo();
408408
409409 // Basic size info comes from the TSFlags field.
410410 const TargetInstrDesc &TID = MI->getDesc();
2020 #include "llvm/CodeGen/MachineFrameInfo.h"
2121 #include "llvm/CodeGen/MachineInstrBuilder.h"
2222 #include "llvm/CodeGen/MachineJumpTableInfo.h"
23 #include "llvm/Target/TargetAsmInfo.h"
23 #include "llvm/MC/MCAsmInfo.h"
2424 #include "llvm/Support/CommandLine.h"
2525 using namespace llvm;
2626
0 //===-- ARMMCAsmInfo.cpp - ARM asm properties -------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the ARMMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "ARMMCAsmInfo.h"
14 using namespace llvm;
15
16 static const char *const arm_asm_table[] = {
17 "{r0}", "r0",
18 "{r1}", "r1",
19 "{r2}", "r2",
20 "{r3}", "r3",
21 "{r4}", "r4",
22 "{r5}", "r5",
23 "{r6}", "r6",
24 "{r7}", "r7",
25 "{r8}", "r8",
26 "{r9}", "r9",
27 "{r10}", "r10",
28 "{r11}", "r11",
29 "{r12}", "r12",
30 "{r13}", "r13",
31 "{r14}", "r14",
32 "{lr}", "lr",
33 "{sp}", "sp",
34 "{ip}", "ip",
35 "{fp}", "fp",
36 "{sl}", "sl",
37 "{memory}", "memory",
38 "{cc}", "cc",
39 0,0
40 };
41
42 ARMDarwinMCAsmInfo::ARMDarwinMCAsmInfo() {
43 AsmTransCBE = arm_asm_table;
44 Data64bitsDirective = 0;
45 CommentString = "@";
46 COMMDirectiveTakesAlignment = false;
47 SupportsDebugInformation = true;
48
49 // Exceptions handling
50 ExceptionsType = ExceptionHandling::SjLj;
51 AbsoluteEHSectionOffsets = false;
52 }
53
54 ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
55 AlignmentIsInBytes = false;
56 Data64bitsDirective = 0;
57 CommentString = "@";
58 COMMDirectiveTakesAlignment = false;
59
60 NeedsSet = false;
61 HasLEB128 = true;
62 AbsoluteDebugSectionOffsets = true;
63 PrivateGlobalPrefix = ".L";
64 WeakRefDirective = "\t.weak\t";
65 SetDirective = "\t.set\t";
66 LCOMMDirective = "\t.lcomm\t";
67
68 DwarfRequiresFrameSection = false;
69
70 SupportsDebugInformation = true;
71 }
0 //=====-- ARMMCAsmInfo.h - ARM asm properties -------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the ARMMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_ARMTARGETASMINFO_H
14 #define LLVM_ARMTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfoDarwin.h"
17
18 namespace llvm {
19
20 struct ARMDarwinMCAsmInfo : public DarwinMCAsmInfo {
21 explicit ARMDarwinMCAsmInfo();
22 };
23
24 struct ARMELFMCAsmInfo : public MCAsmInfo {
25 explicit ARMELFMCAsmInfo();
26 };
27
28 } // namespace llvm
29
30 #endif
+0
-72
lib/Target/ARM/ARMTargetAsmInfo.cpp less more
None //===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the ARMTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "ARMTargetAsmInfo.h"
14 using namespace llvm;
15
16 static const char *const arm_asm_table[] = {
17 "{r0}", "r0",
18 "{r1}", "r1",
19 "{r2}", "r2",
20 "{r3}", "r3",
21 "{r4}", "r4",
22 "{r5}", "r5",
23 "{r6}", "r6",
24 "{r7}", "r7",
25 "{r8}", "r8",
26 "{r9}", "r9",
27 "{r10}", "r10",
28 "{r11}", "r11",
29 "{r12}", "r12",
30 "{r13}", "r13",
31 "{r14}", "r14",
32 "{lr}", "lr",
33 "{sp}", "sp",
34 "{ip}", "ip",
35 "{fp}", "fp",
36 "{sl}", "sl",
37 "{memory}", "memory",
38 "{cc}", "cc",
39 0,0
40 };
41
42 ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
43 AsmTransCBE = arm_asm_table;
44 Data64bitsDirective = 0;
45 CommentString = "@";
46 COMMDirectiveTakesAlignment = false;
47 SupportsDebugInformation = true;
48
49 // Exceptions handling
50 ExceptionsType = ExceptionHandling::SjLj;
51 AbsoluteEHSectionOffsets = false;
52 }
53
54 ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() {
55 AlignmentIsInBytes = false;
56 Data64bitsDirective = 0;
57 CommentString = "@";
58 COMMDirectiveTakesAlignment = false;
59
60 NeedsSet = false;
61 HasLEB128 = true;
62 AbsoluteDebugSectionOffsets = true;
63 PrivateGlobalPrefix = ".L";
64 WeakRefDirective = "\t.weak\t";
65 SetDirective = "\t.set\t";
66 LCOMMDirective = "\t.lcomm\t";
67
68 DwarfRequiresFrameSection = false;
69
70 SupportsDebugInformation = true;
71 }
+0
-31
lib/Target/ARM/ARMTargetAsmInfo.h less more
None //=====-- ARMTargetAsmInfo.h - ARM asm properties -------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the ARMTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_ARMTARGETASMINFO_H
14 #define LLVM_ARMTARGETASMINFO_H
15
16 #include "llvm/Target/DarwinTargetAsmInfo.h"
17
18 namespace llvm {
19
20 struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
21 explicit ARMDarwinTargetAsmInfo();
22 };
23
24 struct ARMELFTargetAsmInfo : public TargetAsmInfo {
25 explicit ARMELFTargetAsmInfo();
26 };
27
28 } // namespace llvm
29
30 #endif
1010 //===----------------------------------------------------------------------===//
1111
1212 #include "ARMTargetMachine.h"
13 #include "ARMTargetAsmInfo.h"
13 #include "ARMMCAsmInfo.h"
1414 #include "ARMFrameInfo.h"
1515 #include "ARM.h"
1616 #include "llvm/PassManager.h"
2626 static cl::opt DisableIfConversion("disable-arm-if-conversion",cl::Hidden,
2727 cl::desc("Disable if-conversion pass"));
2828
29 static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
29 static const MCAsmInfo *createMCAsmInfo(const Target &T,
3030 const StringRef &TT) {
3131 Triple TheTriple(TT);
3232 switch (TheTriple.getOS()) {
3333 case Triple::Darwin:
34 return new ARMDarwinTargetAsmInfo();
34 return new ARMDarwinMCAsmInfo();
3535 default:
36 return new ARMELFTargetAsmInfo();
36 return new ARMELFMCAsmInfo();
3737 }
3838 }
3939
4444 RegisterTargetMachine Y(TheThumbTarget);
4545
4646 // Register the target asm info.
47 RegisterAsmInfoFn A(TheARMTarget, createTargetAsmInfo);
48 RegisterAsmInfoFn B(TheThumbTarget, createTargetAsmInfo);
47 RegisterAsmInfoFn A(TheARMTarget, createMCAsmInfo);
48 RegisterAsmInfoFn B(TheThumbTarget, createMCAsmInfo);
4949 }
5050
5151 /// TargetMachine ctor - Create an ARM architecture model.
2828 #include "llvm/CodeGen/MachineJumpTableInfo.h"
2929 #include "llvm/MC/MCSectionMachO.h"
3030 #include "llvm/MC/MCStreamer.h"
31 #include "llvm/Target/TargetAsmInfo.h"
31 #include "llvm/MC/MCAsmInfo.h"
3232 #include "llvm/Target/TargetData.h"
3333 #include "llvm/Target/TargetLoweringObjectFile.h"
3434 #include "llvm/Target/TargetMachine.h"
110110 bool InCPMode;
111111 public:
112112 explicit ARMAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
113 const TargetAsmInfo *T, bool V)
113 const MCAsmInfo *T, bool V)
114114 : AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL),
115115 InCPMode(false) {
116116 Subtarget = &TM.getSubtarget();
422422 }
423423
424424 static void printSOImm(formatted_raw_ostream &O, int64_t V, bool VerboseAsm,
425 const TargetAsmInfo *TAI) {
425 const MCAsmInfo *TAI) {
426426 // Break it up into two parts that make up a shifter immediate.
427427 V = ARM_AM::getSOImmVal(V);
428428 assert(V != -1 && "Not a valid so_imm value!");
1616 #include "llvm/CodeGen/MachineFunctionPass.h"
1717 #include "llvm/Support/Compiler.h"
1818 #include "llvm/Target/TargetMachine.h"
19 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/MC/MCAsmInfo.h"
2020 using namespace llvm;
2121
2222 namespace {
0 //===-- AlphaMCAsmInfo.cpp - Alpha asm properties ---------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the AlphaMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "AlphaMCAsmInfo.h"
14 using namespace llvm;
15
16 AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = false;
18 PrivateGlobalPrefix = "$";
19 PICJumpTableDirective = ".gprel32";
20 WeakRefDirective = "\t.weak\t";
21 }
0 //=====-- AlphaMCAsmInfo.h - Alpha asm properties -------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the AlphaMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef ALPHATARGETASMINFO_H
14 #define ALPHATARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct AlphaMCAsmInfo : public MCAsmInfo {
23 explicit AlphaMCAsmInfo(const Target &T, const StringRef &TT);
24 };
25
26 } // namespace llvm
27
28 #endif
+0
-22
lib/Target/Alpha/AlphaTargetAsmInfo.cpp less more
None //===-- AlphaTargetAsmInfo.cpp - Alpha asm properties -----------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the AlphaTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "AlphaTargetAsmInfo.h"
14 using namespace llvm;
15
16 AlphaTargetAsmInfo::AlphaTargetAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = false;
18 PrivateGlobalPrefix = "$";
19 PICJumpTableDirective = ".gprel32";
20 WeakRefDirective = "\t.weak\t";
21 }
+0
-29
lib/Target/Alpha/AlphaTargetAsmInfo.h less more
None //=====-- AlphaTargetAsmInfo.h - Alpha asm properties ---------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the AlphaTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef ALPHATARGETASMINFO_H
14 #define ALPHATARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct AlphaTargetAsmInfo : public TargetAsmInfo {
23 explicit AlphaTargetAsmInfo(const Target &T, const StringRef &TT);
24 };
25
26 } // namespace llvm
27
28 #endif
1111
1212 #include "Alpha.h"
1313 #include "AlphaJITInfo.h"
14 #include "AlphaTargetAsmInfo.h"
14 #include "AlphaMCAsmInfo.h"
1515 #include "AlphaTargetMachine.h"
1616 #include "llvm/PassManager.h"
1717 #include "llvm/Support/FormattedStream.h"
2121 extern "C" void LLVMInitializeAlphaTarget() {
2222 // Register the target.
2323 RegisterTargetMachine X(TheAlphaTarget);
24 RegisterAsmInfoTargetAsmInfo> Y(TheAlphaTarget);
24 RegisterAsmInfoMCAsmInfo> Y(TheAlphaTarget);
2525 }
2626
2727 AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
2121 #include "llvm/CodeGen/AsmPrinter.h"
2222 #include "llvm/CodeGen/DwarfWriter.h"
2323 #include "llvm/MC/MCStreamer.h"
24 #include "llvm/Target/TargetAsmInfo.h"
24 #include "llvm/MC/MCAsmInfo.h"
2525 #include "llvm/Target/TargetLoweringObjectFile.h"
2626 #include "llvm/Target/TargetMachine.h"
2727 #include "llvm/Target/TargetRegistry.h"
4040 ///
4141
4242 explicit AlphaAsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
43 const TargetAsmInfo *T, bool V)
43 const MCAsmInfo *T, bool V)
4444 : AsmPrinter(o, tm, T, V) {}
4545
4646 virtual const char *getPassName() const {
2323 #include "llvm/CodeGen/MachineConstantPool.h"
2424 #include "llvm/CodeGen/MachineInstr.h"
2525 #include "llvm/MC/MCStreamer.h"
26 #include "llvm/Target/TargetAsmInfo.h"
26 #include "llvm/MC/MCAsmInfo.h"
2727 #include "llvm/Target/TargetData.h"
2828 #include "llvm/Target/TargetLoweringObjectFile.h"
2929 #include "llvm/Target/TargetRegistry.h"
3939 class VISIBILITY_HIDDEN BlackfinAsmPrinter : public AsmPrinter {
4040 public:
4141 BlackfinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
42 const TargetAsmInfo *TAI, bool V)
42 const MCAsmInfo *TAI, bool V)
4343 : AsmPrinter(O, TM, TAI, V) {}
4444
4545 virtual const char *getPassName() const {
0 //===-- BlackfinMCAsmInfo.cpp - Blackfin asm properties -------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the BlackfinMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "BlackfinMCAsmInfo.h"
14
15 using namespace llvm;
16
17 BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) {
18 GlobalPrefix = "_";
19 CommentString = "//";
20 }
0 //===-- BlackfinMCAsmInfo.h - Blackfin asm properties ---------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the BlackfinMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef BLACKFINTARGETASMINFO_H
14 #define BLACKFINTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct BlackfinMCAsmInfo : public MCAsmInfo {
23 explicit BlackfinMCAsmInfo(const Target &T, const StringRef &TT);
24 };
25
26 } // namespace llvm
27
28 #endif
+0
-22
lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp less more
None //===-- BlackfinTargetAsmInfo.cpp - Blackfin asm properties -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the BlackfinTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "BlackfinTargetAsmInfo.h"
14
15 using namespace llvm;
16
17 BlackfinTargetAsmInfo::BlackfinTargetAsmInfo(const Target &T,
18 const StringRef &TT) {
19 GlobalPrefix = "_";
20 CommentString = "//";
21 }
+0
-29
lib/Target/Blackfin/BlackfinTargetAsmInfo.h less more
None //===-- BlackfinTargetAsmInfo.h - Blackfin asm properties -----*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the BlackfinTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef BLACKFINTARGETASMINFO_H
14 #define BLACKFINTARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct BlackfinTargetAsmInfo : public TargetAsmInfo {
23 explicit BlackfinTargetAsmInfo(const Target &T, const StringRef &TT);
24 };
25
26 } // namespace llvm
27
28 #endif
1111
1212 #include "BlackfinTargetMachine.h"
1313 #include "Blackfin.h"
14 #include "BlackfinTargetAsmInfo.h"
14 #include "BlackfinMCAsmInfo.h"
1515 #include "llvm/PassManager.h"
1616 #include "llvm/Target/TargetRegistry.h"
1717
1919
2020 extern "C" void LLVMInitializeBlackfinTarget() {
2121 RegisterTargetMachine X(TheBlackfinTarget);
22 RegisterAsmInfoTargetAsmInfo> Y(TheBlackfinTarget);
22 RegisterAsmInfoMCAsmInfo> Y(TheBlackfinTarget);
2323
2424 }
2525
3232 #include "llvm/CodeGen/Passes.h"
3333 #include "llvm/CodeGen/IntrinsicLowering.h"
3434 #include "llvm/Transforms/Scalar.h"
35 #include "llvm/Target/TargetAsmInfo.h"
35 #include "llvm/MC/MCAsmInfo.h"
3636 #include "llvm/Target/TargetData.h"
3737 #include "llvm/Target/TargetRegistry.h"
3838 #include "llvm/Support/CallSite.h"
8585 Mangler *Mang;
8686 LoopInfo *LI;
8787 const Module *TheModule;
88 const TargetAsmInfo* TAsm;
88 const MCAsmInfo* TAsm;
8989 const TargetData* TD;
9090 std::map TypeNames;
9191 std::map FPConstantMap;
32383238
32393239 const char *const *table = 0;
32403240
3241 // Grab the translation table from TargetAsmInfo if it exists.
3241 // Grab the translation table from MCAsmInfo if it exists.
32423242 if (!TAsm) {
32433243 std::string Triple = TheModule->getTargetTriple();
32443244 if (Triple.empty())
None //===-- COFFTargetAsmInfo.cpp - COFF asm properties -------------*- C++ -*-===//
0 //===-- COFFMCAsmInfo.cpp - COFF asm properties -----------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/Target/COFFTargetAsmInfo.h"
14 #include "llvm/MC/MCAsmInfoCOFF.h"
1515 #include "llvm/ADT/SmallVector.h"
1616 using namespace llvm;
1717
18 COFFTargetAsmInfo::COFFTargetAsmInfo() {
18 COFFMCAsmInfo::COFFMCAsmInfo() {
1919 GlobalPrefix = "_";
2020 LCOMMDirective = "\t.lcomm\t";
2121 COMMDirectiveTakesAlignment = false;
2525 #include "llvm/CodeGen/MachineFunctionPass.h"
2626 #include "llvm/CodeGen/MachineInstr.h"
2727 #include "llvm/MC/MCStreamer.h"
28 #include "llvm/Target/TargetAsmInfo.h"
28 #include "llvm/MC/MCAsmInfo.h"
2929 #include "llvm/Target/TargetLoweringObjectFile.h"
3030 #include "llvm/Target/TargetInstrInfo.h"
3131 #include "llvm/Target/TargetOptions.h"
5252 std::set FnStubs, GVStubs;
5353 public:
5454 explicit SPUAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
55 const TargetAsmInfo *T, bool V) :
55 const MCAsmInfo *T, bool V) :
5656 AsmPrinter(O, TM, T, V) {}
5757
5858 virtual const char *getPassName() const {
289289 DwarfWriter *DW;
290290 public:
291291 explicit LinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
292 const TargetAsmInfo *T, bool V)
292 const MCAsmInfo *T, bool V)
293293 : SPUAsmPrinter(O, TM, T, V), DW(0) {}
294294
295295 virtual const char *getPassName() const {
0 //===-- SPUMCAsmInfo.cpp - Cell SPU asm properties ------------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SPUMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "SPUMCAsmInfo.h"
14 using namespace llvm;
15
16 SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) {
17 ZeroDirective = "\t.space\t";
18 SetDirective = "\t.set";
19 Data64bitsDirective = "\t.quad\t";
20 AlignmentIsInBytes = false;
21 LCOMMDirective = "\t.lcomm\t";
22
23 PCSymbol = ".";
24 CommentString = "#";
25 GlobalPrefix = "";
26 PrivateGlobalPrefix = ".L";
27
28 // Has leb128, .loc and .file
29 HasLEB128 = true;
30 HasDotLocAndDotFile = true;
31
32 SupportsDebugInformation = true;
33 NeedsSet = true;
34
35 // Exception handling is not supported on CellSPU (think about it: you only
36 // have 256K for code+data. Would you support exception handling?)
37 ExceptionsType = ExceptionHandling::None;
38 }
39
0 //===-- SPUMCAsmInfo.h - Cell SPU asm properties ---------------*- C++ -*--===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the SPUMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef SPUTARGETASMINFO_H
14 #define SPUTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct SPULinuxMCAsmInfo : public MCAsmInfo {
23 explicit SPULinuxMCAsmInfo(const Target &T, const StringRef &TT);
24 };
25 } // namespace llvm
26
27 #endif /* SPUTARGETASMINFO_H */
+0
-40
lib/Target/CellSPU/SPUTargetAsmInfo.cpp less more
None //===-- SPUTargetAsmInfo.cpp - Cell SPU asm properties ----------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SPUTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "SPUTargetAsmInfo.h"
14 using namespace llvm;
15
16 SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const Target &T, const StringRef &TT) {
17 ZeroDirective = "\t.space\t";
18 SetDirective = "\t.set";
19 Data64bitsDirective = "\t.quad\t";
20 AlignmentIsInBytes = false;
21 LCOMMDirective = "\t.lcomm\t";
22
23 PCSymbol = ".";
24 CommentString = "#";
25 GlobalPrefix = "";
26 PrivateGlobalPrefix = ".L";
27
28 // Has leb128, .loc and .file
29 HasLEB128 = true;
30 HasDotLocAndDotFile = true;
31
32 SupportsDebugInformation = true;
33 NeedsSet = true;
34
35 // Exception handling is not supported on CellSPU (think about it: you only
36 // have 256K for code+data. Would you support exception handling?)
37 ExceptionsType = ExceptionHandling::None;
38 }
39
+0
-28
lib/Target/CellSPU/SPUTargetAsmInfo.h less more
None //===-- SPUTargetAsmInfo.h - Cell SPU asm properties -----------*- C++ -*--===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the SPUTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef SPUTARGETASMINFO_H
14 #define SPUTARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct SPULinuxTargetAsmInfo : public TargetAsmInfo {
23 explicit SPULinuxTargetAsmInfo(const Target &T, const StringRef &TT);
24 };
25 } // namespace llvm
26
27 #endif /* SPUTARGETASMINFO_H */
1212
1313 #include "SPU.h"
1414 #include "SPURegisterNames.h"
15 #include "SPUTargetAsmInfo.h"
15 #include "SPUMCAsmInfo.h"
1616 #include "SPUTargetMachine.h"
1717 #include "llvm/PassManager.h"
1818 #include "llvm/CodeGen/RegAllocRegistry.h"
2424 extern "C" void LLVMInitializeCellSPUTarget() {
2525 // Register the target.
2626 RegisterTargetMachine X(TheCellSPUTarget);
27 RegisterAsmInfoTargetAsmInfo> Y(TheCellSPUTarget);
27 RegisterAsmInfoMCAsmInfo> Y(TheCellSPUTarget);
2828 }
2929
3030 const std::pair *
None //===-- DarwinTargetAsmInfo.cpp - Darwin asm properties ---------*- C++ -*-===//
0 //===-- MCAsmInfoDarwin.cpp - Darwin asm properties -------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/Target/DarwinTargetAsmInfo.h"
14 #include "llvm/MC/MCAsmInfoDarwin.h"
1515 using namespace llvm;
1616
17 DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
17 DarwinMCAsmInfo::DarwinMCAsmInfo() {
1818 // Common settings for all Darwin targets.
1919 // Syntax:
2020 GlobalPrefix = "_";
1414 #define DEBUG_TYPE "asm-printer"
1515 #include "MSP430.h"
1616 #include "MSP430InstrInfo.h"
17 #include "MSP430TargetAsmInfo.h"
17 #include "MSP430MCAsmInfo.h"
1818 #include "MSP430TargetMachine.h"
1919 #include "llvm/Constants.h"
2020 #include "llvm/DerivedTypes.h"
4343 class VISIBILITY_HIDDEN MSP430AsmPrinter : public AsmPrinter {
4444 public:
4545 MSP430AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
46 const TargetAsmInfo *TAI, bool V)
46 const MCAsmInfo *TAI, bool V)
4747 : AsmPrinter(O, TM, TAI, V) {}
4848
4949 virtual const char *getPassName() const {
0 //===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the MSP430MCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "MSP430MCAsmInfo.h"
14 using namespace llvm;
15
16 MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = false;
18 }
0 //=====-- MSP430MCAsmInfo.h - MSP430 asm properties -----------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the MSP430MCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef MSP430TARGETASMINFO_H
14 #define MSP430TARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21 struct MSP430MCAsmInfo : public MCAsmInfo {
22 explicit MSP430MCAsmInfo(const Target &T, const StringRef &TT);
23 };
24
25 } // namespace llvm
26
27 #endif
+0
-19
lib/Target/MSP430/MSP430TargetAsmInfo.cpp less more
None //===-- MSP430TargetAsmInfo.cpp - MSP430 asm properties -------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the MSP430TargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "MSP430TargetAsmInfo.h"
14 using namespace llvm;
15
16 MSP430TargetAsmInfo::MSP430TargetAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = false;
18 }
+0
-28
lib/Target/MSP430/MSP430TargetAsmInfo.h less more
None //=====-- MSP430TargetAsmInfo.h - MSP430 asm properties -------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the MSP430TargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef MSP430TARGETASMINFO_H
14 #define MSP430TARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21 struct MSP430TargetAsmInfo : public TargetAsmInfo {
22 explicit MSP430TargetAsmInfo(const Target &T, const StringRef &TT);
23 };
24
25 } // namespace llvm
26
27 #endif
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "MSP430.h"
14 #include "MSP430TargetAsmInfo.h"
14 #include "MSP430MCAsmInfo.h"
1515 #include "MSP430TargetMachine.h"
1616 #include "llvm/PassManager.h"
1717 #include "llvm/CodeGen/Passes.h"
18 #include "llvm/Target/TargetAsmInfo.h"
18 #include "llvm/MC/MCAsmInfo.h"
1919 #include "llvm/Target/TargetRegistry.h"
2020 using namespace llvm;
2121
2222 extern "C" void LLVMInitializeMSP430Target() {
2323 // Register the target.
2424 RegisterTargetMachine X(TheMSP430Target);
25 RegisterAsmInfoTargetAsmInfo> Z(TheMSP430Target);
25 RegisterAsmInfoMCAsmInfo> Z(TheMSP430Target);
2626 }
2727
2828 MSP430TargetMachine::MSP430TargetMachine(const Target &T,
2828 #include "llvm/CodeGen/MachineFrameInfo.h"
2929 #include "llvm/CodeGen/MachineInstr.h"
3030 #include "llvm/MC/MCStreamer.h"
31 #include "llvm/Target/TargetAsmInfo.h"
31 #include "llvm/MC/MCAsmInfo.h"
3232 #include "llvm/Target/TargetData.h"
3333 #include "llvm/Target/TargetLoweringObjectFile.h"
3434 #include "llvm/Target/TargetMachine.h"
5353 const MipsSubtarget *Subtarget;
5454 public:
5555 explicit MipsAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
56 const TargetAsmInfo *T, bool V)
56 const MCAsmInfo *T, bool V)
5757 : AsmPrinter(O, TM, T, V) {
5858 Subtarget = &TM.getSubtarget();
5959 }
0 //===-- MipsMCAsmInfo.cpp - Mips asm properties ---------------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the MipsMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "MipsMCAsmInfo.h"
14 using namespace llvm;
15
16 MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = false;
18 COMMDirectiveTakesAlignment = true;
19 Data16bitsDirective = "\t.half\t";
20 Data32bitsDirective = "\t.word\t";
21 Data64bitsDirective = NULL;
22 PrivateGlobalPrefix = "$";
23 CommentString = "#";
24 ZeroDirective = "\t.space\t";
25 PICJumpTableDirective = "\t.gpword\t";
26 }
0 //=====-- MipsMCAsmInfo.h - Mips asm properties ---------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the MipsMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef MIPSTARGETASMINFO_H
14 #define MIPSTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 class MipsMCAsmInfo : public MCAsmInfo {
23 public:
24 explicit MipsMCAsmInfo(const Target &T, const StringRef &TT);
25 };
26
27 } // namespace llvm
28
29 #endif
+0
-27
lib/Target/Mips/MipsTargetAsmInfo.cpp less more
None //===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the MipsTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "MipsTargetAsmInfo.h"
14 using namespace llvm;
15
16 MipsTargetAsmInfo::MipsTargetAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = false;
18 COMMDirectiveTakesAlignment = true;
19 Data16bitsDirective = "\t.half\t";
20 Data32bitsDirective = "\t.word\t";
21 Data64bitsDirective = NULL;
22 PrivateGlobalPrefix = "$";
23 CommentString = "#";
24 ZeroDirective = "\t.space\t";
25 PICJumpTableDirective = "\t.gpword\t";
26 }
+0
-30
lib/Target/Mips/MipsTargetAsmInfo.h less more
None //=====-- MipsTargetAsmInfo.h - Mips asm properties -----------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the MipsTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef MIPSTARGETASMINFO_H
14 #define MIPSTARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 class MipsTargetAsmInfo : public TargetAsmInfo {
23 public:
24 explicit MipsTargetAsmInfo(const Target &T, const StringRef &TT);
25 };
26
27 } // namespace llvm
28
29 #endif
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "Mips.h"
14 #include "MipsTargetAsmInfo.h"
14 #include "MipsMCAsmInfo.h"
1515 #include "MipsTargetMachine.h"
1616 #include "llvm/PassManager.h"
1717 #include "llvm/Target/TargetRegistry.h"
2121 // Register the target.
2222 RegisterTargetMachine X(TheMipsTarget);
2323 RegisterTargetMachine Y(TheMipselTarget);
24 RegisterAsmInfo A(TheMipsTarget);
25 RegisterAsmInfoTargetAsmInfo> B(TheMipselTarget);
24 RegisterAsmInfoMCAsmInfo> A(TheMipsTarget);
25 RegisterAsmInfo B(TheMipselTarget);
2626 }
2727
2828 // DataLayout --> Big-endian, 32-bit pointer/ABI/alignment
1313
1414 #include "PIC16AsmPrinter.h"
1515 #include "MCSectionPIC16.h"
16 #include "PIC16TargetAsmInfo.h"
16 #include "PIC16MCAsmInfo.h"
1717 #include "llvm/DerivedTypes.h"
1818 #include "llvm/Function.h"
1919 #include "llvm/Module.h"
3333 #include "PIC16GenAsmWriter.inc"
3434
3535 PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
36 const TargetAsmInfo *T, bool V)
36 const MCAsmInfo *T, bool V)
3737 : AsmPrinter(O, TM, T, V), DbgInfo(O, T) {
3838 PTLI = static_cast(TM.getTargetLowering());
39 PTAI = static_castTargetAsmInfo*>(T);
39 PTAI = static_castMCAsmInfo*>(T);
4040 PTOF = (PIC16TargetObjectFile*)&PTLI->getObjFileLowering();
4141 }
4242
1717 #include "PIC16.h"
1818 #include "PIC16TargetMachine.h"
1919 #include "PIC16DebugInfo.h"
20 #include "PIC16MCAsmInfo.h"
2021 #include "PIC16TargetObjectFile.h"
2122 #include "llvm/Analysis/DebugInfo.h"
22 #include "PIC16TargetAsmInfo.h"
2323 #include "llvm/CodeGen/AsmPrinter.h"
2424 #include "llvm/Support/CommandLine.h"
25 #include "llvm/Target/TargetAsmInfo.h"
2625 #include "llvm/Target/TargetMachine.h"
2726 #include
2827 #include
3130 class VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter {
3231 public:
3332 explicit PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
34 const TargetAsmInfo *T, bool V);
33 const MCAsmInfo *T, bool V);
3534 private:
3635 virtual const char *getPassName() const {
3736 return "PIC16 Assembly Printer";
7069 PIC16TargetObjectFile *PTOF;
7170 PIC16TargetLowering *PTLI;
7271 PIC16DbgInfo DbgInfo;
73 const PIC16TargetAsmInfo *PTAI;
72 const PIC16MCAsmInfo *PTAI;
7473 std::list LibcallDecls; // List of extern decls.
7574 };
7675 } // end of namespace
3131 static MCSectionPIC16 *Create(const StringRef &Name,
3232 SectionKind K, MCContext &Ctx);
3333
34 virtual void PrintSwitchToSection(const TargetAsmInfo &TAI,
34 virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
3535 raw_ostream &OS) const;
3636 };
3737
1515
1616 #include "llvm/Analysis/DebugInfo.h"
1717 #include "llvm/Module.h"
18 #include "llvm/Target/TargetAsmInfo.h"
18 #include "llvm/MC/MCAsmInfo.h"
1919 #include
2020
2121 namespace llvm {
9393
9494 class PIC16DbgInfo {
9595 formatted_raw_ostream &O;
96 const TargetAsmInfo *TAI;
96 const MCAsmInfo *TAI;
9797 std::string CurFile;
9898 unsigned CurLine;
9999
102102 bool EmitDebugDirectives;
103103
104104 public:
105 PIC16DbgInfo(formatted_raw_ostream &o, const TargetAsmInfo *T)
105 PIC16DbgInfo(formatted_raw_ostream &o, const MCAsmInfo *T)
106106 : O(o), TAI(T) {
107107 CurFile = "";
108108 CurLine = 0;
0 //===-- PIC16MCAsmInfo.cpp - PIC16 asm properties -------------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the PIC16MCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "PIC16MCAsmInfo.h"
14
15 // FIXME: Layering violation to get enums and static function, should be moved
16 // to separate headers.
17 #include "PIC16.h"
18 #include "PIC16ISelLowering.h"
19 using namespace llvm;
20
21 PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) {
22 CommentString = ";";
23 GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
24 GlobalDirective = "\tglobal\t";
25 ExternDirective = "\textern\t";
26
27 Data8bitsDirective = " db ";
28 Data16bitsDirective = " dw ";
29 Data32bitsDirective = " dl ";
30 Data64bitsDirective = NULL;
31 ZeroDirective = NULL;
32 AsciiDirective = " dt ";
33 AscizDirective = NULL;
34
35 RomData8bitsDirective = " dw ";
36 RomData16bitsDirective = " rom_di ";
37 RomData32bitsDirective = " rom_dl ";
38
39
40 // Set it to false because we weed to generate c file name and not bc file
41 // name.
42 HasSingleParameterDotFile = false;
43 }
44
45 const char *PIC16MCAsmInfo::getDataASDirective(unsigned Size,
46 unsigned AS) const {
47 if (AS != PIC16ISD::ROM_SPACE)
48 return 0;
49
50 switch (Size) {
51 case 8: return RomData8bitsDirective;
52 case 16: return RomData16bitsDirective;
53 case 32: return RomData32bitsDirective;
54 default: return NULL;
55 }
56 }
57
0 //=====-- PIC16MCAsmInfo.h - PIC16 asm properties -------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the PIC16MCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef PIC16TARGETASMINFO_H
14 #define PIC16TARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 class PIC16MCAsmInfo : public MCAsmInfo {
23 const char *RomData8bitsDirective;
24 const char *RomData16bitsDirective;
25 const char *RomData32bitsDirective;
26 public:
27 PIC16MCAsmInfo(const Target &T, const StringRef &TT);
28
29 virtual const char *getDataASDirective(unsigned size, unsigned AS) const;
30 };
31
32 } // namespace llvm
33
34 #endif
2121 #define DEBUG_TYPE "pic16-codegen"
2222 #include "PIC16.h"
2323 #include "PIC16InstrInfo.h"
24 #include "PIC16TargetAsmInfo.h"
24 #include "PIC16MCAsmInfo.h"
2525 #include "PIC16TargetMachine.h"
2626 #include "llvm/CodeGen/MachineFunctionPass.h"
2727 #include "llvm/CodeGen/MachineInstrBuilder.h"
+0
-58
lib/Target/PIC16/PIC16TargetAsmInfo.cpp less more
None //===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the PIC16TargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "PIC16TargetAsmInfo.h"
14
15 // FIXME: Layering violation to get enums and static function, should be moved
16 // to separate headers.
17 #include "PIC16.h"
18 #include "PIC16ISelLowering.h"
19 using namespace llvm;
20
21 PIC16TargetAsmInfo::PIC16TargetAsmInfo(const Target &T, const StringRef &TT) {
22 CommentString = ";";
23 GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
24 GlobalDirective = "\tglobal\t";
25 ExternDirective = "\textern\t";
26
27 Data8bitsDirective = " db ";
28 Data16bitsDirective = " dw ";
29 Data32bitsDirective = " dl ";
30 Data64bitsDirective = NULL;
31 ZeroDirective = NULL;
32 AsciiDirective = " dt ";
33 AscizDirective = NULL;
34
35 RomData8bitsDirective = " dw ";
36 RomData16bitsDirective = " rom_di ";
37 RomData32bitsDirective = " rom_dl ";
38
39
40 // Set it to false because we weed to generate c file name and not bc file
41 // name.
42 HasSingleParameterDotFile = false;
43 }
44
45 const char *PIC16TargetAsmInfo::
46 getDataASDirective(unsigned Size, unsigned AS) const {
47 if (AS != PIC16ISD::ROM_SPACE)
48 return 0;
49
50 switch (Size) {
51 case 8: return RomData8bitsDirective;
52 case 16: return RomData16bitsDirective;
53 case 32: return RomData32bitsDirective;
54 default: return NULL;
55 }
56 }
57
+0
-35
lib/Target/PIC16/PIC16TargetAsmInfo.h less more
None //=====-- PIC16TargetAsmInfo.h - PIC16 asm properties ---------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the PIC16TargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef PIC16TARGETASMINFO_H
14 #define PIC16TARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 class PIC16TargetAsmInfo : public TargetAsmInfo {
23 const char *RomData8bitsDirective;
24 const char *RomData16bitsDirective;
25 const char *RomData32bitsDirective;
26 public:
27 PIC16TargetAsmInfo(const Target &T, const StringRef &TT);
28
29 virtual const char *getDataASDirective(unsigned size, unsigned AS) const;
30 };
31
32 } // namespace llvm
33
34 #endif
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "PIC16.h"
14 #include "PIC16TargetAsmInfo.h"
14 #include "PIC16MCAsmInfo.h"
1515 #include "PIC16TargetMachine.h"
1616 #include "llvm/PassManager.h"
1717 #include "llvm/CodeGen/Passes.h"
2323 // Register the target. Curretnly the codegen works for
2424 // enhanced pic16 mid-range.
2525 RegisterTargetMachine X(ThePIC16Target);
26 RegisterAsmInfoTargetAsmInfo> A(ThePIC16Target);
26 RegisterAsmInfoMCAsmInfo> A(ThePIC16Target);
2727 }
2828
2929
2424 }
2525
2626
27 void MCSectionPIC16::PrintSwitchToSection(const TargetAsmInfo &TAI,
27 void MCSectionPIC16::PrintSwitchToSection(const MCAsmInfo &TAI,
2828 raw_ostream &OS) const {
2929 OS << getName() << '\n';
3030 }
3232 #include "llvm/CodeGen/MachineInstrBuilder.h"
3333 #include "llvm/MC/MCSectionMachO.h"
3434 #include "llvm/MC/MCStreamer.h"
35 #include "llvm/Target/TargetAsmInfo.h"
35 #include "llvm/MC/MCAsmInfo.h"
3636 #include "llvm/Target/TargetLoweringObjectFile.h"
3737 #include "llvm/Target/TargetRegisterInfo.h"
3838 #include "llvm/Target/TargetInstrInfo.h"
8686 uint64_t LabelID;
8787 public:
8888 explicit PPCAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
89 const TargetAsmInfo *T, bool V)
89 const MCAsmInfo *T, bool V)
9090 : AsmPrinter(O, TM, T, V),
9191 Subtarget(TM.getSubtarget()), LabelID(0) {}
9292
345345 class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
346346 public:
347347 explicit PPCLinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
348 const TargetAsmInfo *T, bool V)
348 const MCAsmInfo *T, bool V)
349349 : PPCAsmPrinter(O, TM, T, V){}
350350
351351 virtual const char *getPassName() const {
371371 formatted_raw_ostream &OS;
372372 public:
373373 explicit PPCDarwinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
374 const TargetAsmInfo *T, bool V)
374 const MCAsmInfo *T, bool V)
375375 : PPCAsmPrinter(O, TM, T, V), OS(O) {}
376376
377377 virtual const char *getPassName() const {
11501150 ///
11511151 static AsmPrinter *createPPCAsmPrinterPass(formatted_raw_ostream &o,
11521152 TargetMachine &tm,
1153 const TargetAsmInfo *tai,
1153 const MCAsmInfo *tai,
11541154 bool verbose) {
11551155 const PPCSubtarget *Subtarget = &tm.getSubtarget();
11561156
2121 #include "llvm/Support/CommandLine.h"
2222 #include "llvm/Support/ErrorHandling.h"
2323 #include "llvm/Support/raw_ostream.h"
24 #include "llvm/Target/TargetAsmInfo.h"
24 #include "llvm/MC/MCAsmInfo.h"
2525 using namespace llvm;
2626
2727 extern cl::opt EnablePPC32RS; // FIXME (64-bit): See PPCRegisterInfo.cpp.
767767 case PPC::INLINEASM: { // Inline Asm: Variable size.
768768 const MachineFunction *MF = MI->getParent()->getParent();
769769 const char *AsmStr = MI->getOperand(0).getSymbolName();
770 return getInlineAsmLength(AsmStr, *MF->getTarget().getTargetAsmInfo());
770 return getInlineAsmLength(AsmStr, *MF->getTarget().getMCAsmInfo());
771771 }
772772 case PPC::DBG_LABEL:
773773 case PPC::EH_LABEL:
0 //===-- PPCMCAsmInfo.cpp - PPC asm properties -------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the DarwinMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "PPCMCAsmInfo.h"
14 using namespace llvm;
15
16 PPCDarwinMCAsmInfo::PPCDarwinMCAsmInfo(bool is64Bit) {
17 PCSymbol = ".";
18 CommentString = ";";
19 ExceptionsType = ExceptionHandling::Dwarf;
20
21 if (!is64Bit)
22 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
23 AssemblerDialect = 1; // New-Style mnemonics.
24 }
25
26 PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
27 CommentString = "#";
28 GlobalPrefix = "";
29 PrivateGlobalPrefix = ".L";
30 UsedDirective = "\t# .no_dead_strip\t";
31 WeakRefDirective = "\t.weak\t";
32
33 // Uses '.section' before '.bss' directive
34 UsesELFSectionDirectiveForBSS = true;
35
36 // Debug Information
37 AbsoluteDebugSectionOffsets = true;
38 SupportsDebugInformation = true;
39
40 PCSymbol = ".";
41
42 // Set up DWARF directives
43 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
44
45 // Exceptions handling
46 if (!is64Bit)
47 ExceptionsType = ExceptionHandling::Dwarf;
48 AbsoluteEHSectionOffsets = false;
49
50 ZeroDirective = "\t.space\t";
51 SetDirective = "\t.set";
52 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
53 AlignmentIsInBytes = false;
54 LCOMMDirective = "\t.lcomm\t";
55 AssemblerDialect = 0; // Old-Style mnemonics.
56 }
57
0 //=====-- PPCMCAsmInfo.h - PPC asm properties -----------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the DarwinMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef PPCTARGETASMINFO_H
14 #define PPCTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfoDarwin.h"
17
18 namespace llvm {
19
20 struct PPCDarwinMCAsmInfo : public DarwinMCAsmInfo {
21 explicit PPCDarwinMCAsmInfo(bool is64Bit);
22 };
23
24 struct PPCLinuxMCAsmInfo : public MCAsmInfo {
25 explicit PPCLinuxMCAsmInfo(bool is64Bit);
26 };
27
28 } // namespace llvm
29
30 #endif
+0
-58
lib/Target/PowerPC/PPCTargetAsmInfo.cpp less more
None //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the DarwinTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "PPCTargetAsmInfo.h"
14 using namespace llvm;
15
16 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
17 PCSymbol = ".";
18 CommentString = ";";
19 ExceptionsType = ExceptionHandling::Dwarf;
20
21 if (!is64Bit)
22 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
23 AssemblerDialect = 1; // New-Style mnemonics.
24 }
25
26 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) {
27 CommentString = "#";
28 GlobalPrefix = "";
29 PrivateGlobalPrefix = ".L";
30 UsedDirective = "\t# .no_dead_strip\t";
31 WeakRefDirective = "\t.weak\t";
32
33 // Uses '.section' before '.bss' directive
34 UsesELFSectionDirectiveForBSS = true;
35
36 // Debug Information
37 AbsoluteDebugSectionOffsets = true;
38 SupportsDebugInformation = true;
39
40 PCSymbol = ".";
41
42 // Set up DWARF directives
43 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
44
45 // Exceptions handling
46 if (!is64Bit)
47 ExceptionsType = ExceptionHandling::Dwarf;
48 AbsoluteEHSectionOffsets = false;
49
50 ZeroDirective = "\t.space\t";
51 SetDirective = "\t.set";
52 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
53 AlignmentIsInBytes = false;
54 LCOMMDirective = "\t.lcomm\t";
55 AssemblerDialect = 0; // Old-Style mnemonics.
56 }
57
+0
-32
lib/Target/PowerPC/PPCTargetAsmInfo.h less more
None //=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the DarwinTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef PPCTARGETASMINFO_H
14 #define PPCTARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17 #include "llvm/Target/DarwinTargetAsmInfo.h"
18
19 namespace llvm {
20
21 struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
22 explicit PPCDarwinTargetAsmInfo(bool is64Bit);
23 };
24
25 struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
26 explicit PPCLinuxTargetAsmInfo(bool is64Bit);
27 };
28
29 } // namespace llvm
30
31 #endif
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "PPC.h"
14 #include "PPCTargetAsmInfo.h"
14 #include "PPCMCAsmInfo.h"
1515 #include "PPCTargetMachine.h"
1616 #include "llvm/PassManager.h"
1717 #include "llvm/Target/TargetOptions.h"
1919 #include "llvm/Support/FormattedStream.h"
2020 using namespace llvm;
2121
22 static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
22 static const MCAsmInfo *createMCAsmInfo(const Target &T,
2323 const StringRef &TT) {
2424 Triple TheTriple(TT);
2525 bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
2626 if (TheTriple.getOS() == Triple::Darwin)
27 return new PPCDarwinTargetAsmInfo(isPPC64);
28 return new PPCLinuxTargetAsmInfo(isPPC64);
27 return new PPCDarwinMCAsmInfo(isPPC64);
28 return new PPCLinuxMCAsmInfo(isPPC64);
2929
3030 }
3131
3434 RegisterTargetMachine A(ThePPC32Target);
3535 RegisterTargetMachine B(ThePPC64Target);
3636
37 RegisterAsmInfoFn C(ThePPC32Target, createTargetAsmInfo);
38 RegisterAsmInfoFn D(ThePPC64Target, createTargetAsmInfo);
37 RegisterAsmInfoFn C(ThePPC32Target, createMCAsmInfo);
38 RegisterAsmInfoFn D(ThePPC64Target, createMCAsmInfo);
3939 }
4040
4141
2424 #include "llvm/CodeGen/MachineConstantPool.h"
2525 #include "llvm/CodeGen/MachineInstr.h"
2626 #include "llvm/MC/MCStreamer.h"
27 #include "llvm/Target/TargetAsmInfo.h"
27 #include "llvm/MC/MCAsmInfo.h"
2828 #include "llvm/Target/TargetLoweringObjectFile.h"
2929 #include "llvm/Target/TargetRegistry.h"
3030 #include "llvm/ADT/Statistic.h"
5252 unsigned BBNumber;
5353 public:
5454 explicit SparcAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
55 const TargetAsmInfo *T, bool V)
55 const MCAsmInfo *T, bool V)
5656 : AsmPrinter(O, TM, T, V), BBNumber(0) {}
5757
5858 virtual const char *getPassName() const {
0 //===-- SparcMCAsmInfo.cpp - Sparc asm properties -------------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SparcMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "SparcMCAsmInfo.h"
14 #include "llvm/ADT/SmallVector.h"
15 using namespace llvm;
16
17 SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) {
18 Data16bitsDirective = "\t.half\t";
19 Data32bitsDirective = "\t.word\t";
20 Data64bitsDirective = 0; // .xword is only supported by V9.
21 ZeroDirective = "\t.skip\t";
22 CommentString = "!";
23 COMMDirectiveTakesAlignment = true;
24
25 SunStyleELFSectionSwitchSyntax = true;
26 }
27
28
0 //=====-- SparcMCAsmInfo.h - Sparc asm properties -------------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the SparcMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef SPARCTARGETASMINFO_H
14 #define SPARCTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21 struct SparcELFMCAsmInfo : public MCAsmInfo {
22 explicit SparcELFMCAsmInfo(const Target &T, const StringRef &TT);
23 };
24
25 } // namespace llvm
26
27 #endif
+0
-30
lib/Target/Sparc/SparcTargetAsmInfo.cpp less more
None //===-- SparcTargetAsmInfo.cpp - Sparc asm properties ---------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SparcTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "SparcTargetAsmInfo.h"
14 #include "llvm/ADT/SmallVector.h"
15 using namespace llvm;
16
17 SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const Target &T,
18 const StringRef &TT) {
19 Data16bitsDirective = "\t.half\t";
20 Data32bitsDirective = "\t.word\t";
21 Data64bitsDirective = 0; // .xword is only supported by V9.
22 ZeroDirective = "\t.skip\t";
23 CommentString = "!";
24 COMMDirectiveTakesAlignment = true;
25
26 SunStyleELFSectionSwitchSyntax = true;
27 }
28
29
+0
-28
lib/Target/Sparc/SparcTargetAsmInfo.h less more
None //=====-- SparcTargetAsmInfo.h - Sparc asm properties ---------*- C++ -*--====//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the SparcTargetAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef SPARCTARGETASMINFO_H
14 #define SPARCTARGETASMINFO_H
15
16 #include "llvm/Target/TargetAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21 struct SparcELFTargetAsmInfo : public TargetAsmInfo {
22 explicit SparcELFTargetAsmInfo(const Target &T, const StringRef &TT);
23 };
24
25 } // namespace llvm
26
27 #endif
99 //
1010 //===----------------------------------------------------------------------===//
1111
12 #include "SparcTargetAsmInfo.h"
12 #include "SparcMCAsmInfo.h"
1313 #include "SparcTargetMachine.h"
1414 #include "Sparc.h"
1515 #include "llvm/PassManager.h"
1919 extern "C" void LLVMInitializeSparcTarget() {
2020 // Register the target.
2121 RegisterTargetMachine X(TheSparcTarget);
22 RegisterAsmInfoTargetAsmInfo> Y(TheSparcTarget);
22 RegisterAsmInfoMCAsmInfo> Y(TheSparcTarget);
2323
2424 }
2525
2626 #include "llvm/CodeGen/MachineConstantPool.h"
2727 #include "llvm/CodeGen/MachineInstr.h"
2828 #include "llvm/MC/MCStreamer.h"
29 #include "llvm/Target/TargetAsmInfo.h"
29 #include "llvm/MC/MCAsmInfo.h"
3030 #include "llvm/Target/TargetData.h"
3131 #include "llvm/Target/TargetLoweringObjectFile.h"
3232 #include "llvm/Target/TargetRegistry.h"
4343 class VISIBILITY_HIDDEN SystemZAsmPrinter : public AsmPrinter {
4444 public:
4545 SystemZAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
46 const TargetAsmInfo *TAI, bool V)
46 const MCAsmInfo *TAI, bool V)
4747 : AsmPrinter(O, TM, TAI, V) {}
4848
4949 virtual const char *getPassName() const {
0 //===-- SystemZMCAsmInfo.cpp - SystemZ asm properties ---------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SystemZMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "SystemZMCAsmInfo.h"
14 using namespace llvm;
15
16 SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) {
17 AlignmentIsInBytes = true;
18
19 PrivateGlobalPrefix = ".L";
20 WeakRefDirective = "\t.weak\t";
21 SetDirective = "\t.set\t";
22 PCSymbol = ".";
23
24 NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
25 }
0 //====-- SystemZMCAsmInfo.h - SystemZ asm properties -----------*- C++ -*--===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the SystemZMCAsmInfo class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef SystemZTARGETASMINFO_H
14 #define SystemZTARGETASMINFO_H
15
16 #include "llvm/MC/MCAsmInfo.h"
17
18 namespace llvm {
19 class Target;
20 class StringRef;
21
22 struct SystemZMCAsmInfo : public MCAsmInfo {
23 explicit SystemZMCAsmInfo(const Target &T, const StringRef &TT);
24 };
25
26 } // namespace llvm
27
28 #endif
+0
-27
lib/Target/SystemZ/SystemZTargetAsmInfo.cpp less more
None //===-- SystemZTargetAsmInfo.cpp - SystemZ asm properties -----------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SystemZTargetAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "SystemZTargetAsmInfo.h"
14 using namespace llvm;
15
16 SystemZTargetAsmInfo::SystemZTargetAsmInfo(const Target &T,
17