Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-08-22 20:48:53 +00:00
parent 9c52affd37
commit af76e592c7
120 changed files with 446 additions and 445 deletions

View File

@ -48,7 +48,7 @@ namespace llvm {
class MCStreamer; class MCStreamer;
class DwarfWriter; class DwarfWriter;
class Mangler; class Mangler;
class TargetAsmInfo; class MCAsmInfo;
class TargetLoweringObjectFile; class TargetLoweringObjectFile;
class Type; class Type;
class formatted_raw_ostream; class formatted_raw_ostream;
@ -96,7 +96,7 @@ namespace llvm {
/// Target Asm Printer information. /// Target Asm Printer information.
/// ///
const TargetAsmInfo *TAI; const MCAsmInfo *TAI;
/// Target Register Information. /// Target Register Information.
/// ///
@ -149,7 +149,7 @@ namespace llvm {
protected: protected:
explicit AsmPrinter(formatted_raw_ostream &o, TargetMachine &TM, explicit AsmPrinter(formatted_raw_ostream &o, TargetMachine &TM,
const TargetAsmInfo *T, bool V); const MCAsmInfo *T, bool V);
public: public:
virtual ~AsmPrinter(); virtual ~AsmPrinter();

View File

@ -34,7 +34,7 @@ class MachineInstr;
class Value; class Value;
class Module; class Module;
class GlobalVariable; class GlobalVariable;
class TargetAsmInfo; class MCAsmInfo;
class raw_ostream; class raw_ostream;
class Instruction; class Instruction;
class DICompileUnit; class DICompileUnit;
@ -68,7 +68,7 @@ public:
/// BeginModule - Emit all Dwarf sections that should come prior to the /// BeginModule - Emit all Dwarf sections that should come prior to the
/// content. /// content.
void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS, void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS,
AsmPrinter *A, const TargetAsmInfo *T); AsmPrinter *A, const MCAsmInfo *T);
/// EndModule - Emit all Dwarf sections that should come after the content. /// EndModule - Emit all Dwarf sections that should come after the content.
/// ///

View File

@ -42,7 +42,7 @@ namespace llvm {
class AsmPrinter; class AsmPrinter;
class GCStrategy; class GCStrategy;
class Constant; class Constant;
class TargetAsmInfo; class MCAsmInfo;
namespace GC { namespace GC {

View File

@ -63,10 +63,10 @@ namespace llvm {
/// beginAssembly/finishAssembly - Emit module metadata as assembly code. /// beginAssembly/finishAssembly - Emit module metadata as assembly code.
virtual void beginAssembly(raw_ostream &OS, AsmPrinter &AP, virtual void beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI); const MCAsmInfo &TAI);
virtual void finishAssembly(raw_ostream &OS, AsmPrinter &AP, virtual void finishAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI); const MCAsmInfo &TAI);
virtual ~GCMetadataPrinter(); virtual ~GCMetadataPrinter();
}; };

View File

@ -0,0 +1,3 @@
#include "llvm/Target/TargetAsmInfo.h"

View File

@ -0,0 +1,2 @@
#include "llvm/Target/COFFTargetAsmInfo.h"

View File

@ -0,0 +1 @@
#include "llvm/Target/DarwinTargetAsmInfo.h"

View File

@ -20,7 +20,7 @@
namespace llvm { namespace llvm {
class MCContext; class MCContext;
class TargetAsmInfo; class MCAsmInfo;
class raw_ostream; class raw_ostream;
/// MCSection - Instances of this class represent a uniqued identifier for a /// MCSection - Instances of this class represent a uniqued identifier for a
@ -37,7 +37,7 @@ namespace llvm {
SectionKind getKind() const { return Kind; } SectionKind getKind() const { return Kind; }
virtual void PrintSwitchToSection(const TargetAsmInfo &TAI, virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const = 0; raw_ostream &OS) const = 0;
}; };
@ -62,7 +62,7 @@ namespace llvm {
const std::string &getName() const { return Name; } const std::string &getName() const { return Name; }
bool isDirective() const { return IsDirective; } bool isDirective() const { return IsDirective; }
virtual void PrintSwitchToSection(const TargetAsmInfo &TAI, virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const; raw_ostream &OS) const;
}; };

View File

@ -48,7 +48,7 @@ public:
/// ShouldOmitSectionDirective - Decides whether a '.section' directive /// ShouldOmitSectionDirective - Decides whether a '.section' directive
/// should be printed before the section name /// should be printed before the section name
bool ShouldOmitSectionDirective(const char *Name, bool ShouldOmitSectionDirective(const char *Name,
const TargetAsmInfo &TAI) const; const MCAsmInfo &TAI) const;
/// ShouldPrintSectionType - Only prints the section type if supported /// ShouldPrintSectionType - Only prints the section type if supported
bool ShouldPrintSectionType(unsigned Ty) const; bool ShouldPrintSectionType(unsigned Ty) const;
@ -171,7 +171,7 @@ public:
unsigned getType() const { return Type; } unsigned getType() const { return Type; }
unsigned getFlags() const { return Flags; } unsigned getFlags() const { return Flags; }
virtual void PrintSwitchToSection(const TargetAsmInfo &TAI, virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const; raw_ostream &OS) const;
@ -179,7 +179,7 @@ public:
/// MCSectionELF subclasses with target specific section flags should /// MCSectionELF subclasses with target specific section flags should
/// implement this method if they end up adding letters to the attributes /// implement this method if they end up adding letters to the attributes
/// list. /// list.
virtual void PrintTargetSpecificSectionFlags(const TargetAsmInfo &TAI, virtual void PrintTargetSpecificSectionFlags(const MCAsmInfo &TAI,
raw_ostream &OS) const { raw_ostream &OS) const {
} }

View File

@ -166,7 +166,7 @@ public:
unsigned &TAA, // Out. unsigned &TAA, // Out.
unsigned &StubSize); // Out. unsigned &StubSize); // Out.
virtual void PrintSwitchToSection(const TargetAsmInfo &TAI, virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const; raw_ostream &OS) const;
}; };

View File

@ -25,7 +25,7 @@ namespace llvm {
class MCSymbol; class MCSymbol;
class StringRef; class StringRef;
class raw_ostream; class raw_ostream;
class TargetAsmInfo; class MCAsmInfo;
/// MCStreamer - Streaming machine code generation interface. This interface /// MCStreamer - Streaming machine code generation interface. This interface
/// is intended to provide a programatic interface that is very similar to the /// is intended to provide a programatic interface that is very similar to the
@ -241,7 +241,7 @@ namespace llvm {
/// ///
/// \arg AP - If given, an AsmPrinter to use for printing instructions. /// \arg AP - If given, an AsmPrinter to use for printing instructions.
MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS, MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS,
const TargetAsmInfo &TAI, AsmPrinter *AP = 0); const MCAsmInfo &TAI, AsmPrinter *AP = 0);
// FIXME: These two may end up getting rolled into a single // FIXME: These two may end up getting rolled into a single
// createObjectStreamer interface, which implements the assembler backend, and // createObjectStreamer interface, which implements the assembler backend, and

View File

@ -1,4 +1,4 @@
//===-- COFFTargetAsmInfo.h - COFF asm properties ---------------*- C++ -*-===// //===-- MCAsmInfoCOFF.h - COFF asm properties -------------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -10,12 +10,12 @@
#ifndef LLVM_COFF_TARGET_ASM_INFO_H #ifndef LLVM_COFF_TARGET_ASM_INFO_H
#define LLVM_COFF_TARGET_ASM_INFO_H #define LLVM_COFF_TARGET_ASM_INFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class COFFTargetAsmInfo : public TargetAsmInfo { class COFFMCAsmInfo : public MCAsmInfo {
protected: protected:
explicit COFFTargetAsmInfo(); explicit COFFMCAsmInfo();
}; };
} }

View File

@ -1,4 +1,4 @@
//===---- DarwinTargetAsmInfo.h - Darwin asm properties ---------*- C++ -*-===// //===---- DarwinMCAsmInfo.h - Darwin asm properties -------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -15,7 +15,7 @@
#ifndef LLVM_DARWIN_TARGET_ASM_INFO_H #ifndef LLVM_DARWIN_TARGET_ASM_INFO_H
#define LLVM_DARWIN_TARGET_ASM_INFO_H #define LLVM_DARWIN_TARGET_ASM_INFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class GlobalValue; class GlobalValue;
@ -23,8 +23,8 @@ namespace llvm {
class Type; class Type;
class Mangler; class Mangler;
struct DarwinTargetAsmInfo : public TargetAsmInfo { struct DarwinMCAsmInfo : public MCAsmInfo {
explicit DarwinTargetAsmInfo(); explicit DarwinMCAsmInfo();
}; };
} }

View File

@ -1,4 +1,4 @@
//===-- llvm/Target/TargetAsmInfo.h - Asm info ------------------*- C++ -*-===// //===-- llvm/MC/MCAsmInfo.h - Asm info --------------------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -23,11 +23,11 @@
namespace llvm { namespace llvm {
template <typename T> class SmallVectorImpl; template <typename T> class SmallVectorImpl;
/// TargetAsmInfo - This class is intended to be used as a base class for asm /// MCAsmInfo - This class is intended to be used as a base class for asm
/// properties and features specific to the target. /// properties and features specific to the target.
namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; } namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; }
class TargetAsmInfo { class MCAsmInfo {
protected: protected:
//===------------------------------------------------------------------===// //===------------------------------------------------------------------===//
// Properties to be set by the target writer, used to configure asm printer. // Properties to be set by the target writer, used to configure asm printer.
@ -310,8 +310,8 @@ namespace llvm {
const char *const *AsmTransCBE; // Defaults to empty const char *const *AsmTransCBE; // Defaults to empty
public: public:
explicit TargetAsmInfo(); explicit MCAsmInfo();
virtual ~TargetAsmInfo(); virtual ~MCAsmInfo();
/// getSLEB128Size - Compute the number of bytes required for a signed /// getSLEB128Size - Compute the number of bytes required for a signed
/// leb128 value. /// leb128 value.

View File

@ -19,7 +19,7 @@
namespace llvm { namespace llvm {
class TargetAsmInfo; class MCAsmInfo;
class TargetRegisterClass; class TargetRegisterClass;
class TargetRegisterInfo; class TargetRegisterInfo;
class LiveVariables; class LiveVariables;
@ -464,7 +464,7 @@ public:
/// Measure the specified inline asm to determine an approximation of its /// Measure the specified inline asm to determine an approximation of its
/// length. /// length.
virtual unsigned getInlineAsmLength(const char *Str, virtual unsigned getInlineAsmLength(const char *Str,
const TargetAsmInfo &TAI) const; const MCAsmInfo &TAI) const;
}; };
/// TargetInstrInfoImpl - This is the default implementation of /// TargetInstrInfoImpl - This is the default implementation of

View File

@ -25,7 +25,7 @@ namespace llvm {
class GlobalValue; class GlobalValue;
class StringRef; class StringRef;
class TargetMachine; class TargetMachine;
class TargetAsmInfo; class MCAsmInfo;
class TargetLoweringObjectFile { class TargetLoweringObjectFile {
MCContext *Ctx; MCContext *Ctx;

View File

@ -21,7 +21,7 @@
namespace llvm { namespace llvm {
class Target; class Target;
class TargetAsmInfo; class MCAsmInfo;
class TargetData; class TargetData;
class TargetSubtarget; class TargetSubtarget;
class TargetInstrInfo; class TargetInstrInfo;
@ -102,7 +102,7 @@ protected: // Can only create subclasses.
/// AsmInfo - Contains target specific asm information. /// AsmInfo - Contains target specific asm information.
/// ///
const TargetAsmInfo *AsmInfo; const MCAsmInfo *AsmInfo;
public: public:
virtual ~TargetMachine(); virtual ~TargetMachine();
@ -120,9 +120,9 @@ public:
virtual TargetLowering *getTargetLowering() const { return 0; } virtual TargetLowering *getTargetLowering() const { return 0; }
virtual const TargetData *getTargetData() const { return 0; } virtual const TargetData *getTargetData() const { return 0; }
/// getTargetAsmInfo - Return target specific asm information. /// getMCAsmInfo - Return target specific asm information.
/// ///
const TargetAsmInfo *getTargetAsmInfo() const { return AsmInfo; } const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
/// getSubtarget - This method returns a pointer to the specified type of /// getSubtarget - This method returns a pointer to the specified type of
/// TargetSubtarget. In debug builds, it verifies that the object being /// TargetSubtarget. In debug builds, it verifies that the object being

View File

@ -27,7 +27,7 @@ namespace llvm {
class AsmPrinter; class AsmPrinter;
class MCAsmParser; class MCAsmParser;
class Module; class Module;
class TargetAsmInfo; class MCAsmInfo;
class TargetAsmParser; class TargetAsmParser;
class TargetMachine; class TargetMachine;
class formatted_raw_ostream; class formatted_raw_ostream;
@ -46,14 +46,14 @@ namespace llvm {
typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT); typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT);
typedef const TargetAsmInfo *(*AsmInfoCtorFnTy)(const Target &T, typedef const MCAsmInfo *(*AsmInfoCtorFnTy)(const Target &T,
const StringRef &TT); const StringRef &TT);
typedef TargetMachine *(*TargetMachineCtorTy)(const Target &T, typedef TargetMachine *(*TargetMachineCtorTy)(const Target &T,
const std::string &TT, const std::string &TT,
const std::string &Features); const std::string &Features);
typedef AsmPrinter *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS, typedef AsmPrinter *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS,
TargetMachine &TM, TargetMachine &TM,
const TargetAsmInfo *TAI, const MCAsmInfo *TAI,
bool VerboseAsm); bool VerboseAsm);
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T, typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,
MCAsmParser &P); MCAsmParser &P);
@ -111,14 +111,14 @@ namespace llvm {
bool hasAsmParser() const { return AsmParserCtorFn != 0; } bool hasAsmParser() const { return AsmParserCtorFn != 0; }
/// createAsmInfo - Create a TargetAsmInfo implementation for the specified /// createAsmInfo - Create a MCAsmInfo implementation for the specified
/// target triple. /// target triple.
/// ///
/// \arg Triple - This argument is used to determine the target machine /// \arg Triple - This argument is used to determine the target machine
/// feature set; it should always be provided. Generally this should be /// feature set; it should always be provided. Generally this should be
/// either the target triple from the module, or the target triple of the /// either the target triple from the module, or the target triple of the
/// host if that does not exist. /// host if that does not exist.
const TargetAsmInfo *createAsmInfo(const StringRef &Triple) const { const MCAsmInfo *createAsmInfo(const StringRef &Triple) const {
if (!AsmInfoCtorFn) if (!AsmInfoCtorFn)
return 0; return 0;
return AsmInfoCtorFn(*this, Triple); return AsmInfoCtorFn(*this, Triple);
@ -140,7 +140,7 @@ namespace llvm {
/// createAsmPrinter - Create a target specific assembly printer pass. /// createAsmPrinter - Create a target specific assembly printer pass.
AsmPrinter *createAsmPrinter(formatted_raw_ostream &OS, TargetMachine &TM, AsmPrinter *createAsmPrinter(formatted_raw_ostream &OS, TargetMachine &TM,
const TargetAsmInfo *TAI, bool Verbose) const { const MCAsmInfo *TAI, bool Verbose) const {
if (!AsmPrinterCtorFn) if (!AsmPrinterCtorFn)
return 0; return 0;
return AsmPrinterCtorFn(OS, TM, TAI, Verbose); return AsmPrinterCtorFn(OS, TM, TAI, Verbose);
@ -243,7 +243,7 @@ namespace llvm {
Target::TripleMatchQualityFnTy TQualityFn, Target::TripleMatchQualityFnTy TQualityFn,
bool HasJIT = false); bool HasJIT = false);
/// RegisterAsmInfo - Register a TargetAsmInfo implementation for the /// RegisterAsmInfo - Register a MCAsmInfo implementation for the
/// given target. /// given target.
/// ///
/// Clients are responsible for ensuring that registration doesn't occur /// Clients are responsible for ensuring that registration doesn't occur
@ -251,7 +251,7 @@ namespace llvm {
/// this is done by initializing all targets at program startup. /// this is done by initializing all targets at program startup.
/// ///
/// @param T - The target being registered. /// @param T - The target being registered.
/// @param Fn - A function to construct a TargetAsmInfo for the target. /// @param Fn - A function to construct a MCAsmInfo for the target.
static void RegisterAsmInfo(Target &T, Target::AsmInfoCtorFnTy Fn) { static void RegisterAsmInfo(Target &T, Target::AsmInfoCtorFnTy Fn) {
// Ignore duplicate registration. // Ignore duplicate registration.
if (!T.AsmInfoCtorFn) if (!T.AsmInfoCtorFn)
@ -340,16 +340,16 @@ namespace llvm {
/// ///
/// extern "C" void LLVMInitializeFooTarget() { /// extern "C" void LLVMInitializeFooTarget() {
/// extern Target TheFooTarget; /// extern Target TheFooTarget;
/// RegisterAsmInfo<FooTargetAsmInfo> X(TheFooTarget); /// RegisterAsmInfo<FooMCAsmInfo> X(TheFooTarget);
/// } /// }
template<class TargetAsmInfoImpl> template<class MCAsmInfoImpl>
struct RegisterAsmInfo { struct RegisterAsmInfo {
RegisterAsmInfo(Target &T) { RegisterAsmInfo(Target &T) {
TargetRegistry::RegisterAsmInfo(T, &Allocator); TargetRegistry::RegisterAsmInfo(T, &Allocator);
} }
private: private:
static const TargetAsmInfo *Allocator(const Target &T, const StringRef &TT){ static const MCAsmInfo *Allocator(const Target &T, const StringRef &TT) {
return new TargetAsmInfoImpl(T, TT); return new MCAsmInfoImpl(T, TT);
} }
}; };
@ -406,7 +406,7 @@ namespace llvm {
private: private:
static AsmPrinter *Allocator(formatted_raw_ostream &OS, TargetMachine &TM, static AsmPrinter *Allocator(formatted_raw_ostream &OS, TargetMachine &TM,
const TargetAsmInfo *TAI, bool Verbose) { const MCAsmInfo *TAI, bool Verbose) {
return new AsmPrinterImpl(OS, TM, TAI, Verbose); return new AsmPrinterImpl(OS, TM, TAI, Verbose);
} }
}; };

View File

@ -32,7 +32,7 @@
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h" #include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
@ -50,7 +50,7 @@ AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
char AsmPrinter::ID = 0; char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm, AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
const TargetAsmInfo *T, bool VDef) const MCAsmInfo *T, bool VDef)
: MachineFunctionPass(&ID), FunctionNumber(0), O(o), : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()), TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
@ -1792,7 +1792,7 @@ Indent(formatted_raw_ostream &out, int level, int scale = 2) {
/// ///
static void PrintChildLoopComment(formatted_raw_ostream &O, static void PrintChildLoopComment(formatted_raw_ostream &O,
const MachineLoop *loop, const MachineLoop *loop,
const TargetAsmInfo *TAI, const MCAsmInfo *TAI,
int FunctionNumber) { int FunctionNumber) {
// Add child loop information // Add child loop information
for(MachineLoop::iterator cl = loop->begin(), for(MachineLoop::iterator cl = loop->begin(),

View File

@ -14,7 +14,7 @@
#include "DIE.h" #include "DIE.h"
#include "DwarfPrinter.h" #include "DwarfPrinter.h"
#include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include <ostream> #include <ostream>
@ -224,8 +224,8 @@ unsigned DIEInteger::SizeOf(const TargetData *TD, unsigned Form) const {
case dwarf::DW_FORM_data4: return sizeof(int32_t); case dwarf::DW_FORM_data4: return sizeof(int32_t);
case dwarf::DW_FORM_ref8: // Fall thru case dwarf::DW_FORM_ref8: // Fall thru
case dwarf::DW_FORM_data8: return sizeof(int64_t); case dwarf::DW_FORM_data8: return sizeof(int64_t);
case dwarf::DW_FORM_udata: return TargetAsmInfo::getULEB128Size(Integer); case dwarf::DW_FORM_udata: return MCAsmInfo::getULEB128Size(Integer);
case dwarf::DW_FORM_sdata: return TargetAsmInfo::getSLEB128Size(Integer); case dwarf::DW_FORM_sdata: return MCAsmInfo::getSLEB128Size(Integer);
default: llvm_unreachable("DIE Value form not supported yet"); break; default: llvm_unreachable("DIE Value form not supported yet"); break;
} }
return 0; return 0;
@ -499,7 +499,7 @@ unsigned DIEBlock::SizeOf(const TargetData *TD, unsigned Form) const {
case dwarf::DW_FORM_block1: return Size + sizeof(int8_t); case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
case dwarf::DW_FORM_block2: return Size + sizeof(int16_t); case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
case dwarf::DW_FORM_block4: return Size + sizeof(int32_t); case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
case dwarf::DW_FORM_block: return Size + TargetAsmInfo::getULEB128Size(Size); case dwarf::DW_FORM_block: return Size + MCAsmInfo::getULEB128Size(Size);
default: llvm_unreachable("Improper form for block"); break; default: llvm_unreachable("Improper form for block"); break;
} }
return 0; return 0;

View File

@ -17,7 +17,7 @@
#include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
@ -224,7 +224,7 @@ DbgScope::~DbgScope() {
} // end llvm namespace } // end llvm namespace
DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T) DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T)
: Dwarf(OS, A, T, "dbg"), ModuleCU(0), : Dwarf(OS, A, T, "dbg"), ModuleCU(0),
AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(), AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
ValuesSet(InitValuesSetSize), Values(), StringPool(), ValuesSet(InitValuesSetSize), Values(), StringPool(),
@ -1794,7 +1794,7 @@ unsigned DwarfDebug::SizeAndOffsetDie(DIE *Die, unsigned Offset, bool Last) {
Die->setOffset(Offset); Die->setOffset(Offset);
// Start the size with the size of abbreviation code. // Start the size with the size of abbreviation code.
Offset += TargetAsmInfo::getULEB128Size(AbbrevNumber); Offset += MCAsmInfo::getULEB128Size(AbbrevNumber);
const SmallVector<DIEValue*, 32> &Values = Die->getValues(); const SmallVector<DIEValue*, 32> &Values = Die->getValues();
const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData(); const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();

View File

@ -35,7 +35,7 @@ class DbgScope;
class DbgConcreteScope; class DbgConcreteScope;
class MachineFrameInfo; class MachineFrameInfo;
class MachineModuleInfo; class MachineModuleInfo;
class TargetAsmInfo; class MCAsmInfo;
class Timer; class Timer;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -458,7 +458,7 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Main entry points. // Main entry points.
// //
DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T); DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T);
virtual ~DwarfDebug(); virtual ~DwarfDebug();
/// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should

View File

@ -18,7 +18,7 @@
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLocation.h" #include "llvm/CodeGen/MachineLocation.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
@ -36,7 +36,7 @@ static TimerGroup &getDwarfTimerGroup() {
} }
DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A, DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A,
const TargetAsmInfo *T) const MCAsmInfo *T)
: Dwarf(OS, A, T, "eh"), shouldEmitTable(false), shouldEmitMoves(false), : Dwarf(OS, A, T, "eh"), shouldEmitTable(false), shouldEmitMoves(false),
shouldEmitTableModule(false), shouldEmitMovesModule(false), shouldEmitTableModule(false), shouldEmitMovesModule(false),
ExceptionTimer(0) { ExceptionTimer(0) {
@ -304,7 +304,7 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
for (std::vector<unsigned>::const_iterator for (std::vector<unsigned>::const_iterator
I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) { I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) {
FilterOffsets.push_back(Offset); FilterOffsets.push_back(Offset);
Offset -= TargetAsmInfo::getULEB128Size(*I); Offset -= MCAsmInfo::getULEB128Size(*I);
} }
FirstActions.reserve(LandingPads.size()); FirstActions.reserve(LandingPads.size());
@ -328,12 +328,12 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
const unsigned SizePrevIds = PrevLPI->TypeIds.size(); const unsigned SizePrevIds = PrevLPI->TypeIds.size();
assert(Actions.size()); assert(Actions.size());
PrevAction = &Actions.back(); PrevAction = &Actions.back();
SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) + SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
for (unsigned j = NumShared; j != SizePrevIds; ++j) { for (unsigned j = NumShared; j != SizePrevIds; ++j) {
SizeAction -= SizeAction -=
TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
SizeAction += -PrevAction->NextAction; SizeAction += -PrevAction->NextAction;
PrevAction = PrevAction->Previous; PrevAction = PrevAction->Previous;
} }
@ -344,10 +344,10 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
int TypeID = TypeIds[J]; int TypeID = TypeIds[J];
assert(-1 - TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); assert(-1 - TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID); unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction); SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
SizeSiteActions += SizeAction; SizeSiteActions += SizeAction;
ActionEntry Action = { ValueForTypeID, NextAction, PrevAction }; ActionEntry Action = { ValueForTypeID, NextAction, PrevAction };
@ -556,22 +556,22 @@ void DwarfException::EmitExceptionTable() {
SizeSites = CallSites.size() * SizeSites = CallSites.size() *
(SiteStartSize + SiteLengthSize + LandingPadSize); (SiteStartSize + SiteLengthSize + LandingPadSize);
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) { for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action); SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj) if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
SizeSites += TargetAsmInfo::getULEB128Size(i); SizeSites += MCAsmInfo::getULEB128Size(i);
} }
// Type infos. // Type infos.
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize; unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
unsigned TypeOffset = sizeof(int8_t) + // Call site format unsigned TypeOffset = sizeof(int8_t) + // Call site format
TargetAsmInfo::getULEB128Size(SizeSites) + // Call-site table length MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
SizeSites + SizeActions + SizeTypes; SizeSites + SizeActions + SizeTypes;
unsigned TotalSize = sizeof(int8_t) + // LPStart format unsigned TotalSize = sizeof(int8_t) + // LPStart format
sizeof(int8_t) + // TType format sizeof(int8_t) + // TType format
(HaveTTData ? (HaveTTData ?
TargetAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset MCAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset
TypeOffset; TypeOffset;
unsigned SizeAlign = (4 - TotalSize) & 3; unsigned SizeAlign = (4 - TotalSize) & 3;

View File

@ -24,7 +24,7 @@ namespace llvm {
struct LandingPadInfo; struct LandingPadInfo;
class MachineModuleInfo; class MachineModuleInfo;
class TargetAsmInfo; class MCAsmInfo;
class Timer; class Timer;
class raw_ostream; class raw_ostream;
@ -164,7 +164,7 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Main entry points. // Main entry points.
// //
DwarfException(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T); DwarfException(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T);
virtual ~DwarfException(); virtual ~DwarfException();
/// BeginModule - Emit all exception information that should come prior to the /// BeginModule - Emit all exception information that should come prior to the

View File

@ -19,14 +19,14 @@
#include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/Support/Dwarf.h" #include "llvm/Support/Dwarf.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm; using namespace llvm;
Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T, Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
const char *flavor) const char *flavor)
: O(OS), Asm(A), TAI(T), TD(Asm->TM.getTargetData()), : O(OS), Asm(A), TAI(T), TD(Asm->TM.getTargetData()),
RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL), RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),

View File

@ -25,7 +25,7 @@ namespace llvm {
class MachineFunction; class MachineFunction;
class MachineModuleInfo; class MachineModuleInfo;
class Module; class Module;
class TargetAsmInfo; class MCAsmInfo;
class TargetData; class TargetData;
class TargetRegisterInfo; class TargetRegisterInfo;
@ -45,7 +45,7 @@ namespace llvm {
/// TAI - Target asm information. /// TAI - Target asm information.
/// ///
const TargetAsmInfo *TAI; const MCAsmInfo *TAI;
/// TD - Target data. /// TD - Target data.
/// ///
@ -80,7 +80,7 @@ namespace llvm {
/// ///
unsigned SetCounter; unsigned SetCounter;
Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T, Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
const char *flavor); const char *flavor);
public: public:
//===------------------------------------------------------------------===// //===------------------------------------------------------------------===//
@ -88,7 +88,7 @@ namespace llvm {
// //
const AsmPrinter *getAsm() const { return Asm; } const AsmPrinter *getAsm() const { return Asm; }
MachineModuleInfo *getMMI() const { return MMI; } MachineModuleInfo *getMMI() const { return MMI; }
const TargetAsmInfo *getTargetAsmInfo() const { return TAI; } const MCAsmInfo *getMCAsmInfo() const { return TAI; }
const TargetData *getTargetData() const { return TD; } const TargetData *getTargetData() const { return TD; }
void PrintRelDirective(bool Force32Bit = false, void PrintRelDirective(bool Force32Bit = false,

View File

@ -39,7 +39,7 @@ DwarfWriter::~DwarfWriter() {
void DwarfWriter::BeginModule(Module *M, void DwarfWriter::BeginModule(Module *M,
MachineModuleInfo *MMI, MachineModuleInfo *MMI,
raw_ostream &OS, AsmPrinter *A, raw_ostream &OS, AsmPrinter *A,
const TargetAsmInfo *T) { const MCAsmInfo *T) {
DE = new DwarfException(OS, A, T); DE = new DwarfException(OS, A, T);
DD = new DwarfDebug(OS, A, T); DD = new DwarfDebug(OS, A, T);
DE->BeginModule(M, MMI); DE->BeginModule(M, MMI);

View File

@ -16,7 +16,7 @@
#include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -30,10 +30,10 @@ namespace {
class VISIBILITY_HIDDEN OcamlGCMetadataPrinter : public GCMetadataPrinter { class VISIBILITY_HIDDEN OcamlGCMetadataPrinter : public GCMetadataPrinter {
public: public:
void beginAssembly(raw_ostream &OS, AsmPrinter &AP, void beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI); const MCAsmInfo &TAI);
void finishAssembly(raw_ostream &OS, AsmPrinter &AP, void finishAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI); const MCAsmInfo &TAI);
}; };
} }
@ -44,7 +44,7 @@ Y("ocaml", "ocaml 3.10-compatible collector");
void llvm::linkOcamlGCPrinter() { } void llvm::linkOcamlGCPrinter() { }
static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI, const char *Id) { const MCAsmInfo &TAI, const char *Id) {
const std::string &MId = M.getModuleIdentifier(); const std::string &MId = M.getModuleIdentifier();
std::string Mangled; std::string Mangled;
@ -64,7 +64,7 @@ static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP,
} }
void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) { const MCAsmInfo &TAI) {
AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection()); AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin"); EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
@ -89,7 +89,7 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
/// either condition is detected in a function which uses the GC. /// either condition is detected in a function which uses the GC.
/// ///
void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) { const MCAsmInfo &TAI) {
const char *AddressDirective; const char *AddressDirective;
int AddressAlignLog; int AddressAlignLog;
if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) { if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) {

View File

@ -23,7 +23,7 @@
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetELFWriterInfo.h" #include "llvm/Target/TargetELFWriterInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"

View File

@ -44,7 +44,7 @@
#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetELFWriterInfo.h" #include "llvm/Target/TargetELFWriterInfo.h"
#include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetLowering.h"
@ -80,7 +80,7 @@ ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm)
isLittleEndian(TM.getTargetData()->isLittleEndian()), isLittleEndian(TM.getTargetData()->isLittleEndian()),
ElfHdr(isLittleEndian, is64Bit) { ElfHdr(isLittleEndian, is64Bit) {
TAI = TM.getTargetAsmInfo(); TAI = TM.getMCAsmInfo();
TEW = TM.getELFWriterInfo(); TEW = TM.getELFWriterInfo();
// Create the object code emitter object for this target. // Create the object code emitter object for this target.

View File

@ -32,7 +32,7 @@ namespace llvm {
class MachineCodeEmitter; class MachineCodeEmitter;
class MachineConstantPoolEntry; class MachineConstantPoolEntry;
class ObjectCodeEmitter; class ObjectCodeEmitter;
class TargetAsmInfo; class MCAsmInfo;
class TargetELFWriterInfo; class TargetELFWriterInfo;
class TargetLoweringObjectFile; class TargetLoweringObjectFile;
class raw_ostream; class raw_ostream;
@ -88,7 +88,7 @@ namespace llvm {
/// TAI - Target Asm Info, provide information about section names for /// TAI - Target Asm Info, provide information about section names for
/// globals and other target specific stuff. /// globals and other target specific stuff.
const TargetAsmInfo *TAI; const MCAsmInfo *TAI;
//===------------------------------------------------------------------===// //===------------------------------------------------------------------===//
// Properties inferred automatically from the target machine. // Properties inferred automatically from the target machine.

View File

@ -20,11 +20,11 @@ GCMetadataPrinter::GCMetadataPrinter() { }
GCMetadataPrinter::~GCMetadataPrinter() { } GCMetadataPrinter::~GCMetadataPrinter() { }
void GCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, void GCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) { const MCAsmInfo &TAI) {
// Default is no action. // Default is no action.
} }
void GCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, void GCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) { const MCAsmInfo &TAI) {
// Default is no action. // Default is no action.
} }

View File

@ -20,7 +20,7 @@
#include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/GCStrategy.h"
#include "llvm/CodeGen/MachineFunctionAnalysis.h" #include "llvm/CodeGen/MachineFunctionAnalysis.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
@ -108,7 +108,7 @@ bool LLVMTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
bool Verbose, bool Verbose,
formatted_raw_ostream &Out) { formatted_raw_ostream &Out) {
FunctionPass *Printer = FunctionPass *Printer =
getTarget().createAsmPrinter(Out, *this, getTargetAsmInfo(), Verbose); getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(), Verbose);
if (!Printer) if (!Printer)
return true; return true;
@ -239,7 +239,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
// Turn exception handling constructs into something the code generators can // Turn exception handling constructs into something the code generators can
// handle. // handle.
switch (getTargetAsmInfo()->getExceptionHandlingType()) switch (getMCAsmInfo()->getExceptionHandlingType())
{ {
case ExceptionHandling::SjLj: case ExceptionHandling::SjLj:
// SjLj piggy-backs on dwarf for this bit. The cleanups done apply to both // SjLj piggy-backs on dwarf for this bit. The cleanups done apply to both

View File

@ -21,7 +21,7 @@
namespace llvm { namespace llvm {
class GlobalValue; class GlobalValue;
class TargetAsmInfo; class MCAsmInfo;
/// MachOSym - This struct contains information about each symbol that is /// MachOSym - This struct contains information about each symbol that is
/// added to logical symbol table for the module. This is eventually /// added to logical symbol table for the module. This is eventually
@ -68,7 +68,7 @@ struct MachOSym {
}; };
MachOSym(const GlobalValue *gv, std::string name, uint8_t sect, MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
const TargetAsmInfo *TAI); const MCAsmInfo *TAI);
struct SymCmp { struct SymCmp {
// FIXME: this does not appear to be sorting 'f' after 'F' // FIXME: this does not appear to be sorting 'f' after 'F'

View File

@ -17,7 +17,7 @@
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRelocation.h" #include "llvm/CodeGen/MachineRelocation.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
@ -35,7 +35,7 @@ MachOCodeEmitter::MachOCodeEmitter(MachOWriter &mow, MachOSection &mos) :
ObjectCodeEmitter(&mos), MOW(mow), TM(MOW.TM) { ObjectCodeEmitter(&mos), MOW(mow), TM(MOW.TM) {
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
isLittleEndian = TM.getTargetData()->isLittleEndian(); isLittleEndian = TM.getTargetData()->isLittleEndian();
TAI = TM.getTargetAsmInfo(); TAI = TM.getMCAsmInfo();
} }
/// startFunction - This callback is invoked when a new machine function is /// startFunction - This callback is invoked when a new machine function is

View File

@ -30,7 +30,7 @@ class MachOCodeEmitter : public ObjectCodeEmitter {
/// machine directly, indicating what header values and flags to set. /// machine directly, indicating what header values and flags to set.
bool is64Bit, isLittleEndian; bool is64Bit, isLittleEndian;
const TargetAsmInfo *TAI; const MCAsmInfo *TAI;
/// Relocations - These are the relocations that the function needs, as /// Relocations - These are the relocations that the function needs, as
/// emitted. /// emitted.

View File

@ -29,7 +29,7 @@
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetMachOWriterInfo.h" #include "llvm/Target/TargetMachOWriterInfo.h"
@ -61,7 +61,7 @@ MachOWriter::MachOWriter(raw_ostream &o, TargetMachine &tm)
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
isLittleEndian = TM.getTargetData()->isLittleEndian(); isLittleEndian = TM.getTargetData()->isLittleEndian();
TAI = TM.getTargetAsmInfo(); TAI = TM.getMCAsmInfo();
// Create the machine code emitter object for this target. // Create the machine code emitter object for this target.
MachOCE = new MachOCodeEmitter(*this, *getTextSection(true)); MachOCE = new MachOCodeEmitter(*this, *getTextSection(true));
@ -743,7 +743,7 @@ void MachOWriter::InitMem(const Constant *C, uintptr_t Offset,
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect, MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
const TargetAsmInfo *TAI) : const MCAsmInfo *TAI) :
GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect), GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect),
n_desc(0), n_value(0) { n_desc(0), n_value(0) {

View File

@ -31,7 +31,7 @@ namespace llvm {
struct MachOSym; struct MachOSym;
class TargetData; class TargetData;
class TargetMachine; class TargetMachine;
class TargetAsmInfo; class MCAsmInfo;
class ObjectCodeEmitter; class ObjectCodeEmitter;
class OutputBuffer; class OutputBuffer;
class raw_ostream; class raw_ostream;
@ -78,7 +78,7 @@ namespace llvm {
bool is64Bit, isLittleEndian; bool is64Bit, isLittleEndian;
// Target Asm Info // Target Asm Info
const TargetAsmInfo *TAI; const MCAsmInfo *TAI;
/// Header - An instance of MachOHeader that we will update while we build /// Header - An instance of MachOHeader that we will update while we build
/// the file, and then emit during finalization. /// the file, and then emit during finalization.

View File

@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -530,7 +530,7 @@ TargetLowering::TargetLowering(TargetMachine &tm,TargetLoweringObjectFile *tlof)
InitLibcallCallingConvs(LibcallCallingConvs); InitLibcallCallingConvs(LibcallCallingConvs);
// Tell Legalize whether the assembler supports DEBUG_LOC. // Tell Legalize whether the assembler supports DEBUG_LOC.
const TargetAsmInfo *TASM = TM.getTargetAsmInfo(); const MCAsmInfo *TASM = TM.getMCAsmInfo();
if (!TASM || !TASM->hasDotLocAndDotFile()) if (!TASM || !TASM->hasDotLocAndDotFile())
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
} }

View File

@ -22,7 +22,7 @@
#include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h" #include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetFrameInfo.h"
@ -40,7 +40,7 @@ unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
unsigned char* EndFunction) { unsigned char* EndFunction) {
const TargetMachine& TM = F.getTarget(); const TargetMachine& TM = F.getTarget();
TD = TM.getTargetData(); TD = TM.getTargetData();
needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding(); needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding();
stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
RI = TM.getRegisterInfo(); RI = TM.getRegisterInfo();
JCE = &jce; JCE = &jce;
@ -242,7 +242,7 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
for(std::vector<unsigned>::const_iterator I = FilterIds.begin(), for(std::vector<unsigned>::const_iterator I = FilterIds.begin(),
E = FilterIds.end(); I != E; ++I) { E = FilterIds.end(); I != E; ++I) {
FilterOffsets.push_back(Offset); FilterOffsets.push_back(Offset);
Offset -= TargetAsmInfo::getULEB128Size(*I); Offset -= MCAsmInfo::getULEB128Size(*I);
} }
// Compute the actions table and gather the first action index for each // Compute the actions table and gather the first action index for each
@ -267,10 +267,10 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size(); const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
assert(Actions.size()); assert(Actions.size());
PrevAction = &Actions.back(); PrevAction = &Actions.back();
SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) + SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
for (unsigned j = NumShared; j != SizePrevIds; ++j) { for (unsigned j = NumShared; j != SizePrevIds; ++j) {
SizeAction -= TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); SizeAction -= MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
SizeAction += -PrevAction->NextAction; SizeAction += -PrevAction->NextAction;
PrevAction = PrevAction->Previous; PrevAction = PrevAction->Previous;
} }
@ -281,10 +281,10 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
int TypeID = TypeIds[I]; int TypeID = TypeIds[I];
assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID); unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction); SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
SizeSiteActions += SizeAction; SizeSiteActions += SizeAction;
ActionEntry Action = {ValueForTypeID, NextAction, PrevAction}; ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
@ -387,13 +387,13 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
sizeof(int32_t) + // Site length. sizeof(int32_t) + // Site length.
sizeof(int32_t)); // Landing pad. sizeof(int32_t)); // Landing pad.
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action); SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize(); unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize();
unsigned TypeOffset = sizeof(int8_t) + // Call site format unsigned TypeOffset = sizeof(int8_t) + // Call site format
// Call-site table length // Call-site table length
TargetAsmInfo::getULEB128Size(SizeSites) + MCAsmInfo::getULEB128Size(SizeSites) +
SizeSites + SizeActions + SizeTypes; SizeSites + SizeActions + SizeTypes;
// Begin the exception table. // Begin the exception table.
@ -607,7 +607,7 @@ unsigned JITDwarfEmitter::GetDwarfTableSizeInBytes(MachineFunction& F,
unsigned char* EndFunction) { unsigned char* EndFunction) {
const TargetMachine& TM = F.getTarget(); const TargetMachine& TM = F.getTarget();
TD = TM.getTargetData(); TD = TM.getTargetData();
needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding(); needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding();
stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
RI = TM.getRegisterInfo(); RI = TM.getRegisterInfo();
JCE = &jce; JCE = &jce;
@ -645,10 +645,10 @@ JITDwarfEmitter::GetEHFrameSizeInBytes(const Function* Personality,
// If there is a personality and landing pads then point to the language // If there is a personality and landing pads then point to the language
// specific data area in the exception table. // specific data area in the exception table.
if (MMI->getPersonalityIndex()) { if (MMI->getPersonalityIndex()) {
FinalSize += TargetAsmInfo::getULEB128Size(4); FinalSize += MCAsmInfo::getULEB128Size(4);
FinalSize += PointerSize; FinalSize += PointerSize;
} else { } else {
FinalSize += TargetAsmInfo::getULEB128Size(0); FinalSize += MCAsmInfo::getULEB128Size(0);
} }
// Indicate locations of function specific callee saved registers in // Indicate locations of function specific callee saved registers in
@ -676,24 +676,24 @@ unsigned JITDwarfEmitter::GetCommonEHFrameSizeInBytes(const Function* Personalit
FinalSize += 4; FinalSize += 4;
FinalSize += 1; FinalSize += 1;
FinalSize += Personality ? 5 : 3; // "zPLR" or "zR" FinalSize += Personality ? 5 : 3; // "zPLR" or "zR"
FinalSize += TargetAsmInfo::getULEB128Size(1); FinalSize += MCAsmInfo::getULEB128Size(1);
FinalSize += TargetAsmInfo::getSLEB128Size(stackGrowth); FinalSize += MCAsmInfo::getSLEB128Size(stackGrowth);
FinalSize += 1; FinalSize += 1;
if (Personality) { if (Personality) {
FinalSize += TargetAsmInfo::getULEB128Size(7); FinalSize += MCAsmInfo::getULEB128Size(7);
// Encoding // Encoding
FinalSize+= 1; FinalSize+= 1;
//Personality //Personality
FinalSize += PointerSize; FinalSize += PointerSize;
FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
} else { } else {
FinalSize += TargetAsmInfo::getULEB128Size(1); FinalSize += MCAsmInfo::getULEB128Size(1);
FinalSize += TargetAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel); FinalSize += MCAsmInfo::getULEB128Size(dwarf::DW_EH_PE_pcrel);
} }
std::vector<MachineMove> Moves; std::vector<MachineMove> Moves;
@ -745,12 +745,12 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
} else { } else {
++FinalSize; ++FinalSize;
unsigned RegNum = RI->getDwarfRegNum(Src.getReg(), true); unsigned RegNum = RI->getDwarfRegNum(Src.getReg(), true);
FinalSize += TargetAsmInfo::getULEB128Size(RegNum); FinalSize += MCAsmInfo::getULEB128Size(RegNum);
} }
int Offset = -Src.getOffset(); int Offset = -Src.getOffset();
FinalSize += TargetAsmInfo::getULEB128Size(Offset); FinalSize += MCAsmInfo::getULEB128Size(Offset);
} else { } else {
llvm_unreachable("Machine move no supported yet."); llvm_unreachable("Machine move no supported yet.");
} }
@ -759,7 +759,7 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
if (Dst.isReg()) { if (Dst.isReg()) {
++FinalSize; ++FinalSize;
unsigned RegNum = RI->getDwarfRegNum(Dst.getReg(), true); unsigned RegNum = RI->getDwarfRegNum(Dst.getReg(), true);
FinalSize += TargetAsmInfo::getULEB128Size(RegNum); FinalSize += MCAsmInfo::getULEB128Size(RegNum);
} else { } else {
llvm_unreachable("Machine move no supported yet."); llvm_unreachable("Machine move no supported yet.");
} }
@ -769,15 +769,15 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
if (Offset < 0) { if (Offset < 0) {
++FinalSize; ++FinalSize;
FinalSize += TargetAsmInfo::getULEB128Size(Reg); FinalSize += MCAsmInfo::getULEB128Size(Reg);
FinalSize += TargetAsmInfo::getSLEB128Size(Offset); FinalSize += MCAsmInfo::getSLEB128Size(Offset);
} else if (Reg < 64) { } else if (Reg < 64) {
++FinalSize; ++FinalSize;
FinalSize += TargetAsmInfo::getULEB128Size(Offset); FinalSize += MCAsmInfo::getULEB128Size(Offset);
} else { } else {
++FinalSize; ++FinalSize;
FinalSize += TargetAsmInfo::getULEB128Size(Reg); FinalSize += MCAsmInfo::getULEB128Size(Reg);
FinalSize += TargetAsmInfo::getULEB128Size(Offset); FinalSize += MCAsmInfo::getULEB128Size(Offset);
} }
} }
} }
@ -820,7 +820,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
for(std::vector<unsigned>::const_iterator I = FilterIds.begin(), for(std::vector<unsigned>::const_iterator I = FilterIds.begin(),
E = FilterIds.end(); I != E; ++I) { E = FilterIds.end(); I != E; ++I) {
FilterOffsets.push_back(Offset); FilterOffsets.push_back(Offset);
Offset -= TargetAsmInfo::getULEB128Size(*I); Offset -= MCAsmInfo::getULEB128Size(*I);
} }
// Compute the actions table and gather the first action index for each // Compute the actions table and gather the first action index for each
@ -845,10 +845,10 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size(); const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size();
assert(Actions.size()); assert(Actions.size());
PrevAction = &Actions.back(); PrevAction = &Actions.back();
SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) + SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
for (unsigned j = NumShared; j != SizePrevIds; ++j) { for (unsigned j = NumShared; j != SizePrevIds; ++j) {
SizeAction -= TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID); SizeAction -= MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
SizeAction += -PrevAction->NextAction; SizeAction += -PrevAction->NextAction;
PrevAction = PrevAction->Previous; PrevAction = PrevAction->Previous;
} }
@ -859,10 +859,10 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
int TypeID = TypeIds[I]; int TypeID = TypeIds[I];
assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID); unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction); SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
SizeSiteActions += SizeAction; SizeSiteActions += SizeAction;
ActionEntry Action = {ValueForTypeID, NextAction, PrevAction}; ActionEntry Action = {ValueForTypeID, NextAction, PrevAction};
@ -965,18 +965,18 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
sizeof(int32_t) + // Site length. sizeof(int32_t) + // Site length.
sizeof(int32_t)); // Landing pad. sizeof(int32_t)); // Landing pad.
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) for (unsigned i = 0, e = CallSites.size(); i < e; ++i)
SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action); SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize(); unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize();
unsigned TypeOffset = sizeof(int8_t) + // Call site format unsigned TypeOffset = sizeof(int8_t) + // Call site format
// Call-site table length // Call-site table length
TargetAsmInfo::getULEB128Size(SizeSites) + MCAsmInfo::getULEB128Size(SizeSites) +
SizeSites + SizeActions + SizeTypes; SizeSites + SizeActions + SizeTypes;
unsigned TotalSize = sizeof(int8_t) + // LPStart format unsigned TotalSize = sizeof(int8_t) + // LPStart format
sizeof(int8_t) + // TType format sizeof(int8_t) + // TType format
TargetAsmInfo::getULEB128Size(TypeOffset) + // TType base offset MCAsmInfo::getULEB128Size(TypeOffset) + // TType base offset
TypeOffset; TypeOffset;
unsigned SizeAlign = (4 - TotalSize) & 3; unsigned SizeAlign = (4 - TotalSize) & 3;
@ -1014,7 +1014,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
// Asm->EOL("Landing pad"); // Asm->EOL("Landing pad");
FinalSize += PointerSize; FinalSize += PointerSize;
FinalSize += TargetAsmInfo::getULEB128Size(S.Action); FinalSize += MCAsmInfo::getULEB128Size(S.Action);
// Asm->EOL("Action"); // Asm->EOL("Action");
} }
@ -1023,9 +1023,9 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
ActionEntry &Action = Actions[I]; ActionEntry &Action = Actions[I];
//Asm->EOL("TypeInfo index"); //Asm->EOL("TypeInfo index");
FinalSize += TargetAsmInfo::getSLEB128Size(Action.ValueForTypeID); FinalSize += MCAsmInfo::getSLEB128Size(Action.ValueForTypeID);
//Asm->EOL("Next action"); //Asm->EOL("Next action");
FinalSize += TargetAsmInfo::getSLEB128Size(Action.NextAction); FinalSize += MCAsmInfo::getSLEB128Size(Action.NextAction);
} }
// Emit the type ids. // Emit the type ids.
@ -1037,7 +1037,7 @@ JITDwarfEmitter::GetExceptionTableSizeInBytes(MachineFunction* MF) const {
// Emit the filter typeids. // Emit the filter typeids.
for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) { for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) {
unsigned TypeID = FilterIds[j]; unsigned TypeID = FilterIds[j];
FinalSize += TargetAsmInfo::getULEB128Size(TypeID); FinalSize += MCAsmInfo::getULEB128Size(TypeID);
//Asm->EOL("Filter TypeInfo index"); //Asm->EOL("Filter TypeInfo index");
} }

View File

@ -14,7 +14,7 @@
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h" #include "llvm/MC/MCValue.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h" #include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
@ -24,10 +24,10 @@ namespace {
class MCAsmStreamer : public MCStreamer { class MCAsmStreamer : public MCStreamer {
raw_ostream &OS; raw_ostream &OS;
const TargetAsmInfo &TAI; const MCAsmInfo &TAI;
AsmPrinter *Printer; AsmPrinter *Printer;
public: public:
MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const TargetAsmInfo &tai, MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const MCAsmInfo &tai,
AsmPrinter *_AsmPrinter) AsmPrinter *_AsmPrinter)
: MCStreamer(Context), OS(_OS), TAI(tai), Printer(_AsmPrinter) {} : MCStreamer(Context), OS(_OS), TAI(tai), Printer(_AsmPrinter) {}
~MCAsmStreamer() {} ~MCAsmStreamer() {}
@ -314,6 +314,6 @@ void MCAsmStreamer::Finish() {
} }
MCStreamer *llvm::createAsmStreamer(MCContext &Context, raw_ostream &OS, MCStreamer *llvm::createAsmStreamer(MCContext &Context, raw_ostream &OS,
const TargetAsmInfo &TAI, AsmPrinter *AP) { const MCAsmInfo &TAI, AsmPrinter *AP) {
return new MCAsmStreamer(Context, OS, TAI, AP); return new MCAsmStreamer(Context, OS, TAI, AP);
} }

View File

@ -9,7 +9,7 @@
#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSection.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
using namespace llvm; using namespace llvm;
@ -29,7 +29,7 @@ Create(const StringRef &Name, bool IsDirective, SectionKind K, MCContext &Ctx) {
return new (Ctx) MCSectionCOFF(Name, IsDirective, K); return new (Ctx) MCSectionCOFF(Name, IsDirective, K);
} }
void MCSectionCOFF::PrintSwitchToSection(const TargetAsmInfo &TAI, void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const { raw_ostream &OS) const {
if (isDirective()) { if (isDirective()) {

View File

@ -10,7 +10,7 @@
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
using namespace llvm; using namespace llvm;
@ -23,7 +23,7 @@ Create(const StringRef &Section, unsigned Type, unsigned Flags,
// ShouldOmitSectionDirective - Decides whether a '.section' directive // ShouldOmitSectionDirective - Decides whether a '.section' directive
// should be printed before the section name // should be printed before the section name
bool MCSectionELF::ShouldOmitSectionDirective(const char *Name, bool MCSectionELF::ShouldOmitSectionDirective(const char *Name,
const TargetAsmInfo &TAI) const { const MCAsmInfo &TAI) const {
// FIXME: Does .section .bss/.data/.text work everywhere?? // FIXME: Does .section .bss/.data/.text work everywhere??
if (strcmp(Name, ".text") == 0 || if (strcmp(Name, ".text") == 0 ||
@ -44,7 +44,7 @@ bool MCSectionELF::ShouldPrintSectionType(unsigned Ty) const {
return true; return true;
} }
void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI, void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const { raw_ostream &OS) const {
if (ShouldOmitSectionDirective(SectionName.c_str(), TAI)) { if (ShouldOmitSectionDirective(SectionName.c_str(), TAI)) {

View File

@ -72,7 +72,7 @@ Create(const StringRef &Segment, const StringRef &Section,
Reserved2, K); Reserved2, K);
} }
void MCSectionMachO::PrintSwitchToSection(const TargetAsmInfo &TAI, void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const { raw_ostream &OS) const {
OS << "\t.section\t" << getSegmentName() << ',' << getSectionName(); OS << "\t.section\t" << getSegmentName() << ',' << getSectionName();

View File

@ -21,7 +21,7 @@
#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
using namespace llvm; using namespace llvm;
@ -405,7 +405,7 @@ static unsigned getNumJTEntries(const std::vector<MachineJumpTableEntry> &JT,
unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
const MachineBasicBlock &MBB = *MI->getParent(); const MachineBasicBlock &MBB = *MI->getParent();
const MachineFunction *MF = MBB.getParent(); const MachineFunction *MF = MBB.getParent();
const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo(); const MCAsmInfo *TAI = MF->getTarget().getMCAsmInfo();
// Basic size info comes from the TSFlags field. // Basic size info comes from the TSFlags field.
const TargetInstrDesc &TID = MI->getDesc(); const TargetInstrDesc &TID = MI->getDesc();

View File

@ -21,7 +21,7 @@
#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
using namespace llvm; using namespace llvm;

View File

@ -1,4 +1,4 @@
//===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===// //===-- ARMMCAsmInfo.cpp - ARM asm properties -------------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,11 +7,11 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the ARMTargetAsmInfo properties. // This file contains the declarations of the ARMMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "ARMTargetAsmInfo.h" #include "ARMMCAsmInfo.h"
using namespace llvm; using namespace llvm;
static const char *const arm_asm_table[] = { static const char *const arm_asm_table[] = {
@ -40,7 +40,7 @@ static const char *const arm_asm_table[] = {
0,0 0,0
}; };
ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() { ARMDarwinMCAsmInfo::ARMDarwinMCAsmInfo() {
AsmTransCBE = arm_asm_table; AsmTransCBE = arm_asm_table;
Data64bitsDirective = 0; Data64bitsDirective = 0;
CommentString = "@"; CommentString = "@";
@ -52,7 +52,7 @@ ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
AbsoluteEHSectionOffsets = false; AbsoluteEHSectionOffsets = false;
} }
ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() { ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
AlignmentIsInBytes = false; AlignmentIsInBytes = false;
Data64bitsDirective = 0; Data64bitsDirective = 0;
CommentString = "@"; CommentString = "@";

View File

@ -1,4 +1,4 @@
//=====-- ARMTargetAsmInfo.h - ARM asm properties -------------*- C++ -*--====// //=====-- ARMMCAsmInfo.h - ARM asm properties -------------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,23 +7,23 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the ARMTargetAsmInfo class. // This file contains the declaration of the ARMMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LLVM_ARMTARGETASMINFO_H #ifndef LLVM_ARMTARGETASMINFO_H
#define LLVM_ARMTARGETASMINFO_H #define LLVM_ARMTARGETASMINFO_H
#include "llvm/Target/DarwinTargetAsmInfo.h" #include "llvm/MC/MCAsmInfoDarwin.h"
namespace llvm { namespace llvm {
struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo { struct ARMDarwinMCAsmInfo : public DarwinMCAsmInfo {
explicit ARMDarwinTargetAsmInfo(); explicit ARMDarwinMCAsmInfo();
}; };
struct ARMELFTargetAsmInfo : public TargetAsmInfo { struct ARMELFMCAsmInfo : public MCAsmInfo {
explicit ARMELFTargetAsmInfo(); explicit ARMELFMCAsmInfo();
}; };
} // namespace llvm } // namespace llvm

View File

@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "ARMTargetMachine.h" #include "ARMTargetMachine.h"
#include "ARMTargetAsmInfo.h" #include "ARMMCAsmInfo.h"
#include "ARMFrameInfo.h" #include "ARMFrameInfo.h"
#include "ARM.h" #include "ARM.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
@ -27,14 +27,14 @@ static cl::opt<bool> DisableLdStOpti("disable-arm-loadstore-opti", cl::Hidden,
static cl::opt<bool> DisableIfConversion("disable-arm-if-conversion",cl::Hidden, static cl::opt<bool> DisableIfConversion("disable-arm-if-conversion",cl::Hidden,
cl::desc("Disable if-conversion pass")); cl::desc("Disable if-conversion pass"));
static const TargetAsmInfo *createTargetAsmInfo(const Target &T, static const MCAsmInfo *createMCAsmInfo(const Target &T,
const StringRef &TT) { const StringRef &TT) {
Triple TheTriple(TT); Triple TheTriple(TT);
switch (TheTriple.getOS()) { switch (TheTriple.getOS()) {
case Triple::Darwin: case Triple::Darwin:
return new ARMDarwinTargetAsmInfo(); return new ARMDarwinMCAsmInfo();
default: default:
return new ARMELFTargetAsmInfo(); return new ARMELFMCAsmInfo();
} }
} }
@ -45,8 +45,8 @@ extern "C" void LLVMInitializeARMTarget() {
RegisterTargetMachine<ThumbTargetMachine> Y(TheThumbTarget); RegisterTargetMachine<ThumbTargetMachine> Y(TheThumbTarget);
// Register the target asm info. // Register the target asm info.
RegisterAsmInfoFn A(TheARMTarget, createTargetAsmInfo); RegisterAsmInfoFn A(TheARMTarget, createMCAsmInfo);
RegisterAsmInfoFn B(TheThumbTarget, createTargetAsmInfo); RegisterAsmInfoFn B(TheThumbTarget, createMCAsmInfo);
} }
/// TargetMachine ctor - Create an ARM architecture model. /// TargetMachine ctor - Create an ARM architecture model.

View File

@ -29,7 +29,7 @@
#include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -111,7 +111,7 @@ namespace {
bool InCPMode; bool InCPMode;
public: public:
explicit ARMAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit ARMAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL), : AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL),
InCPMode(false) { InCPMode(false) {
Subtarget = &TM.getSubtarget<ARMSubtarget>(); Subtarget = &TM.getSubtarget<ARMSubtarget>();
@ -423,7 +423,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
} }
static void printSOImm(formatted_raw_ostream &O, int64_t V, bool VerboseAsm, static void printSOImm(formatted_raw_ostream &O, int64_t V, bool VerboseAsm,
const TargetAsmInfo *TAI) { const MCAsmInfo *TAI) {
// Break it up into two parts that make up a shifter immediate. // Break it up into two parts that make up a shifter immediate.
V = ARM_AM::getSOImmVal(V); V = ARM_AM::getSOImmVal(V);
assert(V != -1 && "Not a valid so_imm value!"); assert(V != -1 && "Not a valid so_imm value!");

View File

@ -17,7 +17,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
using namespace llvm; using namespace llvm;
namespace { namespace {

View File

@ -1,4 +1,4 @@
//===-- AlphaTargetAsmInfo.cpp - Alpha asm properties -----------*- C++ -*-===// //===-- AlphaMCAsmInfo.cpp - Alpha asm properties ---------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,14 +7,14 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the AlphaTargetAsmInfo properties. // This file contains the declarations of the AlphaMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "AlphaTargetAsmInfo.h" #include "AlphaMCAsmInfo.h"
using namespace llvm; using namespace llvm;
AlphaTargetAsmInfo::AlphaTargetAsmInfo(const Target &T, const StringRef &TT) { AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false; AlignmentIsInBytes = false;
PrivateGlobalPrefix = "$"; PrivateGlobalPrefix = "$";
PICJumpTableDirective = ".gprel32"; PICJumpTableDirective = ".gprel32";

View File

@ -1,4 +1,4 @@
//=====-- AlphaTargetAsmInfo.h - Alpha asm properties ---------*- C++ -*--====// //=====-- AlphaMCAsmInfo.h - Alpha asm properties -------------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,21 +7,21 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the AlphaTargetAsmInfo class. // This file contains the declaration of the AlphaMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef ALPHATARGETASMINFO_H #ifndef ALPHATARGETASMINFO_H
#define ALPHATARGETASMINFO_H #define ALPHATARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
struct AlphaTargetAsmInfo : public TargetAsmInfo { struct AlphaMCAsmInfo : public MCAsmInfo {
explicit AlphaTargetAsmInfo(const Target &T, const StringRef &TT); explicit AlphaMCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -12,7 +12,7 @@
#include "Alpha.h" #include "Alpha.h"
#include "AlphaJITInfo.h" #include "AlphaJITInfo.h"
#include "AlphaTargetAsmInfo.h" #include "AlphaMCAsmInfo.h"
#include "AlphaTargetMachine.h" #include "AlphaTargetMachine.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
@ -22,7 +22,7 @@ using namespace llvm;
extern "C" void LLVMInitializeAlphaTarget() { extern "C" void LLVMInitializeAlphaTarget() {
// Register the target. // Register the target.
RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget); RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
RegisterAsmInfo<AlphaTargetAsmInfo> Y(TheAlphaTarget); RegisterAsmInfo<AlphaMCAsmInfo> Y(TheAlphaTarget);
} }
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT, AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,

View File

@ -22,7 +22,7 @@
#include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h" #include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -41,7 +41,7 @@ namespace {
/// ///
explicit AlphaAsmPrinter(formatted_raw_ostream &o, TargetMachine &tm, explicit AlphaAsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: AsmPrinter(o, tm, T, V) {} : AsmPrinter(o, tm, T, V) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -24,7 +24,7 @@
#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -40,7 +40,7 @@ namespace {
class VISIBILITY_HIDDEN BlackfinAsmPrinter : public AsmPrinter { class VISIBILITY_HIDDEN BlackfinAsmPrinter : public AsmPrinter {
public: public:
BlackfinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, BlackfinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *TAI, bool V) const MCAsmInfo *TAI, bool V)
: AsmPrinter(O, TM, TAI, V) {} : AsmPrinter(O, TM, TAI, V) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -1,4 +1,4 @@
//===-- BlackfinTargetAsmInfo.cpp - Blackfin asm properties -----*- C++ -*-===// //===-- BlackfinMCAsmInfo.cpp - Blackfin asm properties -------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,16 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the BlackfinTargetAsmInfo properties. // This file contains the declarations of the BlackfinMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "BlackfinTargetAsmInfo.h" #include "BlackfinMCAsmInfo.h"
using namespace llvm; using namespace llvm;
BlackfinTargetAsmInfo::BlackfinTargetAsmInfo(const Target &T, BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) {
const StringRef &TT) {
GlobalPrefix = "_"; GlobalPrefix = "_";
CommentString = "//"; CommentString = "//";
} }

View File

@ -1,4 +1,4 @@
//===-- BlackfinTargetAsmInfo.h - Blackfin asm properties -----*- C++ -*--====// //===-- BlackfinMCAsmInfo.h - Blackfin asm properties ---------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,21 +7,21 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the BlackfinTargetAsmInfo class. // This file contains the declaration of the BlackfinMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef BLACKFINTARGETASMINFO_H #ifndef BLACKFINTARGETASMINFO_H
#define BLACKFINTARGETASMINFO_H #define BLACKFINTARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
struct BlackfinTargetAsmInfo : public TargetAsmInfo { struct BlackfinMCAsmInfo : public MCAsmInfo {
explicit BlackfinTargetAsmInfo(const Target &T, const StringRef &TT); explicit BlackfinMCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -12,7 +12,7 @@
#include "BlackfinTargetMachine.h" #include "BlackfinTargetMachine.h"
#include "Blackfin.h" #include "Blackfin.h"
#include "BlackfinTargetAsmInfo.h" #include "BlackfinMCAsmInfo.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -20,7 +20,7 @@ using namespace llvm;
extern "C" void LLVMInitializeBlackfinTarget() { extern "C" void LLVMInitializeBlackfinTarget() {
RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget); RegisterTargetMachine<BlackfinTargetMachine> X(TheBlackfinTarget);
RegisterAsmInfo<BlackfinTargetAsmInfo> Y(TheBlackfinTarget); RegisterAsmInfo<BlackfinMCAsmInfo> Y(TheBlackfinTarget);
} }

View File

@ -33,7 +33,7 @@
#include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/CallSite.h" #include "llvm/Support/CallSite.h"
@ -86,7 +86,7 @@ namespace {
Mangler *Mang; Mangler *Mang;
LoopInfo *LI; LoopInfo *LI;
const Module *TheModule; const Module *TheModule;
const TargetAsmInfo* TAsm; const MCAsmInfo* TAsm;
const TargetData* TD; const TargetData* TD;
std::map<const Type *, std::string> TypeNames; std::map<const Type *, std::string> TypeNames;
std::map<const ConstantFP *, unsigned> FPConstantMap; std::map<const ConstantFP *, unsigned> FPConstantMap;
@ -3239,7 +3239,7 @@ std::string CWriter::InterpretASMConstraint(InlineAsm::ConstraintInfo& c) {
const char *const *table = 0; const char *const *table = 0;
// Grab the translation table from TargetAsmInfo if it exists. // Grab the translation table from MCAsmInfo if it exists.
if (!TAsm) { if (!TAsm) {
std::string Triple = TheModule->getTargetTriple(); std::string Triple = TheModule->getTargetTriple();
if (Triple.empty()) if (Triple.empty())

View File

@ -1,4 +1,4 @@
//===-- COFFTargetAsmInfo.cpp - COFF asm properties -------------*- C++ -*-===// //===-- COFFMCAsmInfo.cpp - COFF asm properties -----------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -12,11 +12,11 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Target/COFFTargetAsmInfo.h" #include "llvm/MC/MCAsmInfoCOFF.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
using namespace llvm; using namespace llvm;
COFFTargetAsmInfo::COFFTargetAsmInfo() { COFFMCAsmInfo::COFFMCAsmInfo() {
GlobalPrefix = "_"; GlobalPrefix = "_";
LCOMMDirective = "\t.lcomm\t"; LCOMMDirective = "\t.lcomm\t";
COMMDirectiveTakesAlignment = false; COMMDirectiveTakesAlignment = false;

View File

@ -26,7 +26,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
@ -53,7 +53,7 @@ namespace {
std::set<std::string> FnStubs, GVStubs; std::set<std::string> FnStubs, GVStubs;
public: public:
explicit SPUAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit SPUAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) : const MCAsmInfo *T, bool V) :
AsmPrinter(O, TM, T, V) {} AsmPrinter(O, TM, T, V) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {
@ -290,7 +290,7 @@ namespace {
DwarfWriter *DW; DwarfWriter *DW;
public: public:
explicit LinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit LinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: SPUAsmPrinter(O, TM, T, V), DW(0) {} : SPUAsmPrinter(O, TM, T, V), DW(0) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -1,4 +1,4 @@
//===-- SPUTargetAsmInfo.cpp - Cell SPU asm properties ----------*- C++ -*-===// //===-- SPUMCAsmInfo.cpp - Cell SPU asm properties ------------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,14 +7,14 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the SPUTargetAsmInfo properties. // This file contains the declarations of the SPUMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "SPUTargetAsmInfo.h" #include "SPUMCAsmInfo.h"
using namespace llvm; using namespace llvm;
SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const Target &T, const StringRef &TT) { SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) {
ZeroDirective = "\t.space\t"; ZeroDirective = "\t.space\t";
SetDirective = "\t.set"; SetDirective = "\t.set";
Data64bitsDirective = "\t.quad\t"; Data64bitsDirective = "\t.quad\t";

View File

@ -1,4 +1,4 @@
//===-- SPUTargetAsmInfo.h - Cell SPU asm properties -----------*- C++ -*--===// //===-- SPUMCAsmInfo.h - Cell SPU asm properties ---------------*- C++ -*--===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,21 +7,21 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the SPUTargetAsmInfo class. // This file contains the declaration of the SPUMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef SPUTARGETASMINFO_H #ifndef SPUTARGETASMINFO_H
#define SPUTARGETASMINFO_H #define SPUTARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
struct SPULinuxTargetAsmInfo : public TargetAsmInfo { struct SPULinuxMCAsmInfo : public MCAsmInfo {
explicit SPULinuxTargetAsmInfo(const Target &T, const StringRef &TT); explicit SPULinuxMCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -13,7 +13,7 @@
#include "SPU.h" #include "SPU.h"
#include "SPURegisterNames.h" #include "SPURegisterNames.h"
#include "SPUTargetAsmInfo.h" #include "SPUMCAsmInfo.h"
#include "SPUTargetMachine.h" #include "SPUTargetMachine.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/CodeGen/RegAllocRegistry.h" #include "llvm/CodeGen/RegAllocRegistry.h"
@ -25,7 +25,7 @@ using namespace llvm;
extern "C" void LLVMInitializeCellSPUTarget() { extern "C" void LLVMInitializeCellSPUTarget() {
// Register the target. // Register the target.
RegisterTargetMachine<SPUTargetMachine> X(TheCellSPUTarget); RegisterTargetMachine<SPUTargetMachine> X(TheCellSPUTarget);
RegisterAsmInfo<SPULinuxTargetAsmInfo> Y(TheCellSPUTarget); RegisterAsmInfo<SPULinuxMCAsmInfo> Y(TheCellSPUTarget);
} }
const std::pair<unsigned, int> * const std::pair<unsigned, int> *

View File

@ -1,4 +1,4 @@
//===-- DarwinTargetAsmInfo.cpp - Darwin asm properties ---------*- C++ -*-===// //===-- MCAsmInfoDarwin.cpp - Darwin asm properties -------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -12,10 +12,10 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Target/DarwinTargetAsmInfo.h" #include "llvm/MC/MCAsmInfoDarwin.h"
using namespace llvm; using namespace llvm;
DarwinTargetAsmInfo::DarwinTargetAsmInfo() { DarwinMCAsmInfo::DarwinMCAsmInfo() {
// Common settings for all Darwin targets. // Common settings for all Darwin targets.
// Syntax: // Syntax:
GlobalPrefix = "_"; GlobalPrefix = "_";

View File

@ -15,7 +15,7 @@
#define DEBUG_TYPE "asm-printer" #define DEBUG_TYPE "asm-printer"
#include "MSP430.h" #include "MSP430.h"
#include "MSP430InstrInfo.h" #include "MSP430InstrInfo.h"
#include "MSP430TargetAsmInfo.h" #include "MSP430MCAsmInfo.h"
#include "MSP430TargetMachine.h" #include "MSP430TargetMachine.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
@ -44,7 +44,7 @@ namespace {
class VISIBILITY_HIDDEN MSP430AsmPrinter : public AsmPrinter { class VISIBILITY_HIDDEN MSP430AsmPrinter : public AsmPrinter {
public: public:
MSP430AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, MSP430AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *TAI, bool V) const MCAsmInfo *TAI, bool V)
: AsmPrinter(O, TM, TAI, V) {} : AsmPrinter(O, TM, TAI, V) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -1,4 +1,4 @@
//===-- MSP430TargetAsmInfo.cpp - MSP430 asm properties -------------------===// //===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,13 +7,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the MSP430TargetAsmInfo properties. // This file contains the declarations of the MSP430MCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MSP430TargetAsmInfo.h" #include "MSP430MCAsmInfo.h"
using namespace llvm; using namespace llvm;
MSP430TargetAsmInfo::MSP430TargetAsmInfo(const Target &T, const StringRef &TT) { MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false; AlignmentIsInBytes = false;
} }

View File

@ -1,4 +1,4 @@
//=====-- MSP430TargetAsmInfo.h - MSP430 asm properties -------*- C++ -*--====// //=====-- MSP430MCAsmInfo.h - MSP430 asm properties -----------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,20 +7,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the MSP430TargetAsmInfo class. // This file contains the declaration of the MSP430MCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MSP430TARGETASMINFO_H #ifndef MSP430TARGETASMINFO_H
#define MSP430TARGETASMINFO_H #define MSP430TARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
struct MSP430TargetAsmInfo : public TargetAsmInfo { struct MSP430MCAsmInfo : public MCAsmInfo {
explicit MSP430TargetAsmInfo(const Target &T, const StringRef &TT); explicit MSP430MCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -12,18 +12,18 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MSP430.h" #include "MSP430.h"
#include "MSP430TargetAsmInfo.h" #include "MSP430MCAsmInfo.h"
#include "MSP430TargetMachine.h" #include "MSP430TargetMachine.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
using namespace llvm; using namespace llvm;
extern "C" void LLVMInitializeMSP430Target() { extern "C" void LLVMInitializeMSP430Target() {
// Register the target. // Register the target.
RegisterTargetMachine<MSP430TargetMachine> X(TheMSP430Target); RegisterTargetMachine<MSP430TargetMachine> X(TheMSP430Target);
RegisterAsmInfo<MSP430TargetAsmInfo> Z(TheMSP430Target); RegisterAsmInfo<MSP430MCAsmInfo> Z(TheMSP430Target);
} }
MSP430TargetMachine::MSP430TargetMachine(const Target &T, MSP430TargetMachine::MSP430TargetMachine(const Target &T,

View File

@ -29,7 +29,7 @@
#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -54,7 +54,7 @@ namespace {
const MipsSubtarget *Subtarget; const MipsSubtarget *Subtarget;
public: public:
explicit MipsAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit MipsAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V) { : AsmPrinter(O, TM, T, V) {
Subtarget = &TM.getSubtarget<MipsSubtarget>(); Subtarget = &TM.getSubtarget<MipsSubtarget>();
} }

View File

@ -1,4 +1,4 @@
//===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===// //===-- MipsMCAsmInfo.cpp - Mips asm properties ---------------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,14 +7,14 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the MipsTargetAsmInfo properties. // This file contains the declarations of the MipsMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MipsTargetAsmInfo.h" #include "MipsMCAsmInfo.h"
using namespace llvm; using namespace llvm;
MipsTargetAsmInfo::MipsTargetAsmInfo(const Target &T, const StringRef &TT) { MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false; AlignmentIsInBytes = false;
COMMDirectiveTakesAlignment = true; COMMDirectiveTakesAlignment = true;
Data16bitsDirective = "\t.half\t"; Data16bitsDirective = "\t.half\t";

View File

@ -1,4 +1,4 @@
//=====-- MipsTargetAsmInfo.h - Mips asm properties -----------*- C++ -*--====// //=====-- MipsMCAsmInfo.h - Mips asm properties ---------------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,22 +7,22 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the MipsTargetAsmInfo class. // This file contains the declaration of the MipsMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef MIPSTARGETASMINFO_H #ifndef MIPSTARGETASMINFO_H
#define MIPSTARGETASMINFO_H #define MIPSTARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
class MipsTargetAsmInfo : public TargetAsmInfo { class MipsMCAsmInfo : public MCAsmInfo {
public: public:
explicit MipsTargetAsmInfo(const Target &T, const StringRef &TT); explicit MipsMCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "Mips.h" #include "Mips.h"
#include "MipsTargetAsmInfo.h" #include "MipsMCAsmInfo.h"
#include "MipsTargetMachine.h" #include "MipsTargetMachine.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -22,8 +22,8 @@ extern "C" void LLVMInitializeMipsTarget() {
// Register the target. // Register the target.
RegisterTargetMachine<MipsTargetMachine> X(TheMipsTarget); RegisterTargetMachine<MipsTargetMachine> X(TheMipsTarget);
RegisterTargetMachine<MipselTargetMachine> Y(TheMipselTarget); RegisterTargetMachine<MipselTargetMachine> Y(TheMipselTarget);
RegisterAsmInfo<MipsTargetAsmInfo> A(TheMipsTarget); RegisterAsmInfo<MipsMCAsmInfo> A(TheMipsTarget);
RegisterAsmInfo<MipsTargetAsmInfo> B(TheMipselTarget); RegisterAsmInfo<MipsMCAsmInfo> B(TheMipselTarget);
} }
// DataLayout --> Big-endian, 32-bit pointer/ABI/alignment // DataLayout --> Big-endian, 32-bit pointer/ABI/alignment

View File

@ -14,7 +14,7 @@
#include "PIC16AsmPrinter.h" #include "PIC16AsmPrinter.h"
#include "MCSectionPIC16.h" #include "MCSectionPIC16.h"
#include "PIC16TargetAsmInfo.h" #include "PIC16MCAsmInfo.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/Function.h" #include "llvm/Function.h"
#include "llvm/Module.h" #include "llvm/Module.h"
@ -34,10 +34,10 @@ using namespace llvm;
#include "PIC16GenAsmWriter.inc" #include "PIC16GenAsmWriter.inc"
PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V), DbgInfo(O, T) { : AsmPrinter(O, TM, T, V), DbgInfo(O, T) {
PTLI = static_cast<PIC16TargetLowering*>(TM.getTargetLowering()); PTLI = static_cast<PIC16TargetLowering*>(TM.getTargetLowering());
PTAI = static_cast<const PIC16TargetAsmInfo*>(T); PTAI = static_cast<const PIC16MCAsmInfo*>(T);
PTOF = (PIC16TargetObjectFile*)&PTLI->getObjFileLowering(); PTOF = (PIC16TargetObjectFile*)&PTLI->getObjFileLowering();
} }

View File

@ -18,12 +18,11 @@
#include "PIC16.h" #include "PIC16.h"
#include "PIC16TargetMachine.h" #include "PIC16TargetMachine.h"
#include "PIC16DebugInfo.h" #include "PIC16DebugInfo.h"
#include "PIC16MCAsmInfo.h"
#include "PIC16TargetObjectFile.h" #include "PIC16TargetObjectFile.h"
#include "llvm/Analysis/DebugInfo.h" #include "llvm/Analysis/DebugInfo.h"
#include "PIC16TargetAsmInfo.h"
#include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include <list> #include <list>
#include <string> #include <string>
@ -32,7 +31,7 @@ namespace llvm {
class VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { class VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter {
public: public:
explicit PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V); const MCAsmInfo *T, bool V);
private: private:
virtual const char *getPassName() const { virtual const char *getPassName() const {
return "PIC16 Assembly Printer"; return "PIC16 Assembly Printer";
@ -71,7 +70,7 @@ namespace llvm {
PIC16TargetObjectFile *PTOF; PIC16TargetObjectFile *PTOF;
PIC16TargetLowering *PTLI; PIC16TargetLowering *PTLI;
PIC16DbgInfo DbgInfo; PIC16DbgInfo DbgInfo;
const PIC16TargetAsmInfo *PTAI; const PIC16MCAsmInfo *PTAI;
std::list<const char *> LibcallDecls; // List of extern decls. std::list<const char *> LibcallDecls; // List of extern decls.
}; };
} // end of namespace } // end of namespace

View File

@ -32,7 +32,7 @@ namespace llvm {
static MCSectionPIC16 *Create(const StringRef &Name, static MCSectionPIC16 *Create(const StringRef &Name,
SectionKind K, MCContext &Ctx); SectionKind K, MCContext &Ctx);
virtual void PrintSwitchToSection(const TargetAsmInfo &TAI, virtual void PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const; raw_ostream &OS) const;
}; };

View File

@ -16,7 +16,7 @@
#include "llvm/Analysis/DebugInfo.h" #include "llvm/Analysis/DebugInfo.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include <map> #include <map>
namespace llvm { namespace llvm {
@ -94,7 +94,7 @@ namespace llvm {
class PIC16DbgInfo { class PIC16DbgInfo {
formatted_raw_ostream &O; formatted_raw_ostream &O;
const TargetAsmInfo *TAI; const MCAsmInfo *TAI;
std::string CurFile; std::string CurFile;
unsigned CurLine; unsigned CurLine;
@ -103,7 +103,7 @@ namespace llvm {
bool EmitDebugDirectives; bool EmitDebugDirectives;
public: public:
PIC16DbgInfo(formatted_raw_ostream &o, const TargetAsmInfo *T) PIC16DbgInfo(formatted_raw_ostream &o, const MCAsmInfo *T)
: O(o), TAI(T) { : O(o), TAI(T) {
CurFile = ""; CurFile = "";
CurLine = 0; CurLine = 0;

View File

@ -1,4 +1,4 @@
//===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===// //===-- PIC16MCAsmInfo.cpp - PIC16 asm properties -------------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,11 +7,11 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the PIC16TargetAsmInfo properties. // This file contains the declarations of the PIC16MCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "PIC16TargetAsmInfo.h" #include "PIC16MCAsmInfo.h"
// FIXME: Layering violation to get enums and static function, should be moved // FIXME: Layering violation to get enums and static function, should be moved
// to separate headers. // to separate headers.
@ -19,7 +19,7 @@
#include "PIC16ISelLowering.h" #include "PIC16ISelLowering.h"
using namespace llvm; using namespace llvm;
PIC16TargetAsmInfo::PIC16TargetAsmInfo(const Target &T, const StringRef &TT) { PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) {
CommentString = ";"; CommentString = ";";
GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL); GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
GlobalDirective = "\tglobal\t"; GlobalDirective = "\tglobal\t";
@ -43,8 +43,8 @@ PIC16TargetAsmInfo::PIC16TargetAsmInfo(const Target &T, const StringRef &TT) {
HasSingleParameterDotFile = false; HasSingleParameterDotFile = false;
} }
const char *PIC16TargetAsmInfo:: const char *PIC16MCAsmInfo::getDataASDirective(unsigned Size,
getDataASDirective(unsigned Size, unsigned AS) const { unsigned AS) const {
if (AS != PIC16ISD::ROM_SPACE) if (AS != PIC16ISD::ROM_SPACE)
return 0; return 0;

View File

@ -1,4 +1,4 @@
//=====-- PIC16TargetAsmInfo.h - PIC16 asm properties ---------*- C++ -*--====// //=====-- PIC16MCAsmInfo.h - PIC16 asm properties -------------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,25 +7,25 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the PIC16TargetAsmInfo class. // This file contains the declaration of the PIC16MCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef PIC16TARGETASMINFO_H #ifndef PIC16TARGETASMINFO_H
#define PIC16TARGETASMINFO_H #define PIC16TARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
class PIC16TargetAsmInfo : public TargetAsmInfo { class PIC16MCAsmInfo : public MCAsmInfo {
const char *RomData8bitsDirective; const char *RomData8bitsDirective;
const char *RomData16bitsDirective; const char *RomData16bitsDirective;
const char *RomData32bitsDirective; const char *RomData32bitsDirective;
public: public:
PIC16TargetAsmInfo(const Target &T, const StringRef &TT); PIC16MCAsmInfo(const Target &T, const StringRef &TT);
virtual const char *getDataASDirective(unsigned size, unsigned AS) const; virtual const char *getDataASDirective(unsigned size, unsigned AS) const;
}; };

View File

@ -22,7 +22,7 @@
#define DEBUG_TYPE "pic16-codegen" #define DEBUG_TYPE "pic16-codegen"
#include "PIC16.h" #include "PIC16.h"
#include "PIC16InstrInfo.h" #include "PIC16InstrInfo.h"
#include "PIC16TargetAsmInfo.h" #include "PIC16MCAsmInfo.h"
#include "PIC16TargetMachine.h" #include "PIC16TargetMachine.h"
#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h"

View File

@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "PIC16.h" #include "PIC16.h"
#include "PIC16TargetAsmInfo.h" #include "PIC16MCAsmInfo.h"
#include "PIC16TargetMachine.h" #include "PIC16TargetMachine.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/Passes.h"
@ -24,7 +24,7 @@ extern "C" void LLVMInitializePIC16Target() {
// Register the target. Curretnly the codegen works for // Register the target. Curretnly the codegen works for
// enhanced pic16 mid-range. // enhanced pic16 mid-range.
RegisterTargetMachine<PIC16TargetMachine> X(ThePIC16Target); RegisterTargetMachine<PIC16TargetMachine> X(ThePIC16Target);
RegisterAsmInfo<PIC16TargetAsmInfo> A(ThePIC16Target); RegisterAsmInfo<PIC16MCAsmInfo> A(ThePIC16Target);
} }

View File

@ -25,7 +25,7 @@ MCSectionPIC16 *MCSectionPIC16::Create(const StringRef &Name,
} }
void MCSectionPIC16::PrintSwitchToSection(const TargetAsmInfo &TAI, void MCSectionPIC16::PrintSwitchToSection(const MCAsmInfo &TAI,
raw_ostream &OS) const { raw_ostream &OS) const {
OS << getName() << '\n'; OS << getName() << '\n';
} }

View File

@ -33,7 +33,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetInstrInfo.h"
@ -87,7 +87,7 @@ namespace {
uint64_t LabelID; uint64_t LabelID;
public: public:
explicit PPCAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit PPCAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V), : AsmPrinter(O, TM, T, V),
Subtarget(TM.getSubtarget<PPCSubtarget>()), LabelID(0) {} Subtarget(TM.getSubtarget<PPCSubtarget>()), LabelID(0) {}
@ -346,7 +346,7 @@ namespace {
class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter { class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
public: public:
explicit PPCLinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit PPCLinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: PPCAsmPrinter(O, TM, T, V){} : PPCAsmPrinter(O, TM, T, V){}
virtual const char *getPassName() const { virtual const char *getPassName() const {
@ -372,7 +372,7 @@ namespace {
formatted_raw_ostream &OS; formatted_raw_ostream &OS;
public: public:
explicit PPCDarwinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit PPCDarwinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: PPCAsmPrinter(O, TM, T, V), OS(O) {} : PPCAsmPrinter(O, TM, T, V), OS(O) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {
@ -1151,7 +1151,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
/// ///
static AsmPrinter *createPPCAsmPrinterPass(formatted_raw_ostream &o, static AsmPrinter *createPPCAsmPrinterPass(formatted_raw_ostream &o,
TargetMachine &tm, TargetMachine &tm,
const TargetAsmInfo *tai, const MCAsmInfo *tai,
bool verbose) { bool verbose) {
const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>(); const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();

View File

@ -22,7 +22,7 @@
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
using namespace llvm; using namespace llvm;
extern cl::opt<bool> EnablePPC32RS; // FIXME (64-bit): See PPCRegisterInfo.cpp. extern cl::opt<bool> EnablePPC32RS; // FIXME (64-bit): See PPCRegisterInfo.cpp.
@ -768,7 +768,7 @@ unsigned PPCInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
case PPC::INLINEASM: { // Inline Asm: Variable size. case PPC::INLINEASM: { // Inline Asm: Variable size.
const MachineFunction *MF = MI->getParent()->getParent(); const MachineFunction *MF = MI->getParent()->getParent();
const char *AsmStr = MI->getOperand(0).getSymbolName(); const char *AsmStr = MI->getOperand(0).getSymbolName();
return getInlineAsmLength(AsmStr, *MF->getTarget().getTargetAsmInfo()); return getInlineAsmLength(AsmStr, *MF->getTarget().getMCAsmInfo());
} }
case PPC::DBG_LABEL: case PPC::DBG_LABEL:
case PPC::EH_LABEL: case PPC::EH_LABEL:

View File

@ -1,4 +1,4 @@
//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===// //===-- PPCMCAsmInfo.cpp - PPC asm properties -------------------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,14 +7,14 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the DarwinTargetAsmInfo properties. // This file contains the declarations of the DarwinMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "PPCTargetAsmInfo.h" #include "PPCMCAsmInfo.h"
using namespace llvm; using namespace llvm;
PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) { PPCDarwinMCAsmInfo::PPCDarwinMCAsmInfo(bool is64Bit) {
PCSymbol = "."; PCSymbol = ".";
CommentString = ";"; CommentString = ";";
ExceptionsType = ExceptionHandling::Dwarf; ExceptionsType = ExceptionHandling::Dwarf;
@ -24,7 +24,7 @@ PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
AssemblerDialect = 1; // New-Style mnemonics. AssemblerDialect = 1; // New-Style mnemonics.
} }
PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) { PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
CommentString = "#"; CommentString = "#";
GlobalPrefix = ""; GlobalPrefix = "";
PrivateGlobalPrefix = ".L"; PrivateGlobalPrefix = ".L";

View File

@ -1,4 +1,4 @@
//=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====// //=====-- PPCMCAsmInfo.h - PPC asm properties -----------------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,24 +7,23 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the DarwinTargetAsmInfo class. // This file contains the declaration of the DarwinMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef PPCTARGETASMINFO_H #ifndef PPCTARGETASMINFO_H
#define PPCTARGETASMINFO_H #define PPCTARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfoDarwin.h"
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm { namespace llvm {
struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo { struct PPCDarwinMCAsmInfo : public DarwinMCAsmInfo {
explicit PPCDarwinTargetAsmInfo(bool is64Bit); explicit PPCDarwinMCAsmInfo(bool is64Bit);
}; };
struct PPCLinuxTargetAsmInfo : public TargetAsmInfo { struct PPCLinuxMCAsmInfo : public MCAsmInfo {
explicit PPCLinuxTargetAsmInfo(bool is64Bit); explicit PPCLinuxMCAsmInfo(bool is64Bit);
}; };
} // namespace llvm } // namespace llvm

View File

@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "PPC.h" #include "PPC.h"
#include "PPCTargetAsmInfo.h" #include "PPCMCAsmInfo.h"
#include "PPCTargetMachine.h" #include "PPCTargetMachine.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
@ -20,13 +20,13 @@
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
using namespace llvm; using namespace llvm;
static const TargetAsmInfo *createTargetAsmInfo(const Target &T, static const MCAsmInfo *createMCAsmInfo(const Target &T,
const StringRef &TT) { const StringRef &TT) {
Triple TheTriple(TT); Triple TheTriple(TT);
bool isPPC64 = TheTriple.getArch() == Triple::ppc64; bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
if (TheTriple.getOS() == Triple::Darwin) if (TheTriple.getOS() == Triple::Darwin)
return new PPCDarwinTargetAsmInfo(isPPC64); return new PPCDarwinMCAsmInfo(isPPC64);
return new PPCLinuxTargetAsmInfo(isPPC64); return new PPCLinuxMCAsmInfo(isPPC64);
} }
@ -35,8 +35,8 @@ extern "C" void LLVMInitializePowerPCTarget() {
RegisterTargetMachine<PPC32TargetMachine> A(ThePPC32Target); RegisterTargetMachine<PPC32TargetMachine> A(ThePPC32Target);
RegisterTargetMachine<PPC64TargetMachine> B(ThePPC64Target); RegisterTargetMachine<PPC64TargetMachine> B(ThePPC64Target);
RegisterAsmInfoFn C(ThePPC32Target, createTargetAsmInfo); RegisterAsmInfoFn C(ThePPC32Target, createMCAsmInfo);
RegisterAsmInfoFn D(ThePPC64Target, createTargetAsmInfo); RegisterAsmInfoFn D(ThePPC64Target, createMCAsmInfo);
} }

View File

@ -25,7 +25,7 @@
#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
@ -53,7 +53,7 @@ namespace {
unsigned BBNumber; unsigned BBNumber;
public: public:
explicit SparcAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, explicit SparcAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V) const MCAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V), BBNumber(0) {} : AsmPrinter(O, TM, T, V), BBNumber(0) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -1,4 +1,4 @@
//===-- SparcTargetAsmInfo.cpp - Sparc asm properties ---------------------===// //===-- SparcMCAsmInfo.cpp - Sparc asm properties -------------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,16 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the SparcTargetAsmInfo properties. // This file contains the declarations of the SparcMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "SparcTargetAsmInfo.h" #include "SparcMCAsmInfo.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
using namespace llvm; using namespace llvm;
SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const Target &T, SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) {
const StringRef &TT) {
Data16bitsDirective = "\t.half\t"; Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t"; Data32bitsDirective = "\t.word\t";
Data64bitsDirective = 0; // .xword is only supported by V9. Data64bitsDirective = 0; // .xword is only supported by V9.

View File

@ -1,4 +1,4 @@
//=====-- SparcTargetAsmInfo.h - Sparc asm properties ---------*- C++ -*--====// //=====-- SparcMCAsmInfo.h - Sparc asm properties -------------*- C++ -*--====//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,20 +7,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the SparcTargetAsmInfo class. // This file contains the declaration of the SparcMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef SPARCTARGETASMINFO_H #ifndef SPARCTARGETASMINFO_H
#define SPARCTARGETASMINFO_H #define SPARCTARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
struct SparcELFTargetAsmInfo : public TargetAsmInfo { struct SparcELFMCAsmInfo : public MCAsmInfo {
explicit SparcELFTargetAsmInfo(const Target &T, const StringRef &TT); explicit SparcELFMCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -10,7 +10,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "SparcTargetAsmInfo.h" #include "SparcMCAsmInfo.h"
#include "SparcTargetMachine.h" #include "SparcTargetMachine.h"
#include "Sparc.h" #include "Sparc.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
@ -20,7 +20,7 @@ using namespace llvm;
extern "C" void LLVMInitializeSparcTarget() { extern "C" void LLVMInitializeSparcTarget() {
// Register the target. // Register the target.
RegisterTargetMachine<SparcTargetMachine> X(TheSparcTarget); RegisterTargetMachine<SparcTargetMachine> X(TheSparcTarget);
RegisterAsmInfo<SparcELFTargetAsmInfo> Y(TheSparcTarget); RegisterAsmInfo<SparcELFMCAsmInfo> Y(TheSparcTarget);
} }

View File

@ -27,7 +27,7 @@
#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -44,7 +44,7 @@ namespace {
class VISIBILITY_HIDDEN SystemZAsmPrinter : public AsmPrinter { class VISIBILITY_HIDDEN SystemZAsmPrinter : public AsmPrinter {
public: public:
SystemZAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, SystemZAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *TAI, bool V) const MCAsmInfo *TAI, bool V)
: AsmPrinter(O, TM, TAI, V) {} : AsmPrinter(O, TM, TAI, V) {}
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -1,4 +1,4 @@
//===-- SystemZTargetAsmInfo.cpp - SystemZ asm properties -----------------===// //===-- SystemZMCAsmInfo.cpp - SystemZ asm properties ---------------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,15 +7,14 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declarations of the SystemZTargetAsmInfo properties. // This file contains the declarations of the SystemZMCAsmInfo properties.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "SystemZTargetAsmInfo.h" #include "SystemZMCAsmInfo.h"
using namespace llvm; using namespace llvm;
SystemZTargetAsmInfo::SystemZTargetAsmInfo(const Target &T, SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) {
const StringRef &TT) {
AlignmentIsInBytes = true; AlignmentIsInBytes = true;
PrivateGlobalPrefix = ".L"; PrivateGlobalPrefix = ".L";

View File

@ -1,4 +1,4 @@
//====-- SystemZTargetAsmInfo.h - SystemZ asm properties -------*- C++ -*--===// //====-- SystemZMCAsmInfo.h - SystemZ asm properties -----------*- C++ -*--===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,21 +7,21 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the SystemZTargetAsmInfo class. // This file contains the declaration of the SystemZMCAsmInfo class.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef SystemZTARGETASMINFO_H #ifndef SystemZTARGETASMINFO_H
#define SystemZTARGETASMINFO_H #define SystemZTARGETASMINFO_H
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class StringRef;
struct SystemZTargetAsmInfo : public TargetAsmInfo { struct SystemZMCAsmInfo : public MCAsmInfo {
explicit SystemZTargetAsmInfo(const Target &T, const StringRef &TT); explicit SystemZMCAsmInfo(const Target &T, const StringRef &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@ -7,7 +7,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "SystemZTargetAsmInfo.h" #include "SystemZMCAsmInfo.h"
#include "SystemZTargetMachine.h" #include "SystemZTargetMachine.h"
#include "SystemZ.h" #include "SystemZ.h"
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
@ -17,7 +17,7 @@ using namespace llvm;
extern "C" void LLVMInitializeSystemZTarget() { extern "C" void LLVMInitializeSystemZTarget() {
// Register the target. // Register the target.
RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget); RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
RegisterAsmInfo<SystemZTargetAsmInfo> Y(TheSystemZTarget); RegisterAsmInfo<SystemZMCAsmInfo> Y(TheSystemZTarget);
} }
/// SystemZTargetMachine ctor - Create an ILP64 architecture model /// SystemZTargetMachine ctor - Create an ILP64 architecture model

View File

@ -1,4 +1,4 @@
//===-- TargetAsmInfo.cpp - Asm Info ---------------------------------------==// //===-- MCAsmInfo.cpp - Asm Info -------------------------------------------==//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -12,12 +12,12 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include <cctype> #include <cctype>
#include <cstring> #include <cstring>
using namespace llvm; using namespace llvm;
TargetAsmInfo::TargetAsmInfo() { MCAsmInfo::MCAsmInfo() {
ZeroFillDirective = 0; ZeroFillDirective = 0;
NonexecutableStackDirective = 0; NonexecutableStackDirective = 0;
NeedsSet = false; NeedsSet = false;
@ -85,11 +85,11 @@ TargetAsmInfo::TargetAsmInfo() {
AsmTransCBE = 0; AsmTransCBE = 0;
} }
TargetAsmInfo::~TargetAsmInfo() { MCAsmInfo::~MCAsmInfo() {
} }
unsigned TargetAsmInfo::getULEB128Size(unsigned Value) { unsigned MCAsmInfo::getULEB128Size(unsigned Value) {
unsigned Size = 0; unsigned Size = 0;
do { do {
Value >>= 7; Value >>= 7;
@ -98,7 +98,7 @@ unsigned TargetAsmInfo::getULEB128Size(unsigned Value) {
return Size; return Size;
} }
unsigned TargetAsmInfo::getSLEB128Size(int Value) { unsigned MCAsmInfo::getSLEB128Size(int Value) {
unsigned Size = 0; unsigned Size = 0;
int Sign = Value >> (8 * sizeof(Value) - 1); int Sign = Value >> (8 * sizeof(Value) - 1);
bool IsMore; bool IsMore;

View File

@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
using namespace llvm; using namespace llvm;
@ -73,7 +73,7 @@ bool TargetInstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {
/// Variable-length instructions are not handled here; this function /// Variable-length instructions are not handled here; this function
/// may be overloaded in the target code to do that. /// may be overloaded in the target code to do that.
unsigned TargetInstrInfo::getInlineAsmLength(const char *Str, unsigned TargetInstrInfo::getInlineAsmLength(const char *Str,
const TargetAsmInfo &TAI) const { const MCAsmInfo &TAI) const {
// Count the number of instructions in the asm. // Count the number of instructions in the asm.

View File

@ -11,7 +11,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"

View File

@ -19,7 +19,7 @@
#include "X86COFF.h" #include "X86COFF.h"
#include "X86MachineFunctionInfo.h" #include "X86MachineFunctionInfo.h"
#include "X86TargetMachine.h" #include "X86TargetMachine.h"
#include "X86TargetAsmInfo.h" #include "X86MCAsmInfo.h"
#include "llvm/CallingConv.h" #include "llvm/CallingConv.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/Module.h" #include "llvm/Module.h"
@ -37,7 +37,7 @@
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h" #include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
using namespace llvm; using namespace llvm;

Some files were not shown because too many files have changed in this diff Show More