Replace string GNU Triples with llvm::Triple in MCAsmInfo subclasses and create*AsmInfo(). NFC.

Summary:
This is the first of several patches to eliminate StringRef forms of GNU
triples from the internals of LLVM. After this is complete, GNU triples
will be replaced by a more authoratitive representation in the form of
an LLVM TargetTuple.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: ted, llvm-commits, rengolin, jholewinski

Differential Revision: http://reviews.llvm.org/D10236


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239036 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Sanders
2015-06-04 13:12:25 +00:00
parent 545c30e82c
commit 6ff6fc6055
32 changed files with 66 additions and 70 deletions

View File

@@ -91,7 +91,7 @@ public:
typedef bool (*ArchMatchFnTy)(Triple::ArchType Arch); typedef bool (*ArchMatchFnTy)(Triple::ArchType Arch);
typedef MCAsmInfo *(*MCAsmInfoCtorFnTy)(const MCRegisterInfo &MRI, typedef MCAsmInfo *(*MCAsmInfoCtorFnTy)(const MCRegisterInfo &MRI,
StringRef TT); const Triple &TT);
typedef MCCodeGenInfo *(*MCCodeGenInfoCtorFnTy)(StringRef TT, Reloc::Model RM, typedef MCCodeGenInfo *(*MCCodeGenInfoCtorFnTy)(StringRef TT, Reloc::Model RM,
CodeModel::Model CM, CodeModel::Model CM,
CodeGenOpt::Level OL); CodeGenOpt::Level OL);
@@ -287,15 +287,15 @@ public:
/// createMCAsmInfo - Create a MCAsmInfo implementation for the specified /// createMCAsmInfo - Create a MCAsmInfo implementation for the specified
/// target triple. /// target triple.
/// ///
/// \param Triple This argument is used to determine the target machine /// \param TheTriple 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.
MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI, MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI,
StringRef Triple) const { StringRef TheTriple) const {
if (!MCAsmInfoCtorFn) if (!MCAsmInfoCtorFn)
return nullptr; return nullptr;
return MCAsmInfoCtorFn(MRI, Triple); return MCAsmInfoCtorFn(MRI, Triple(TheTriple));
} }
/// createMCCodeGenInfo - Create a MCCodeGenInfo implementation. /// createMCCodeGenInfo - Create a MCCodeGenInfo implementation.
@@ -889,7 +889,8 @@ template <class MCAsmInfoImpl> struct RegisterMCAsmInfo {
} }
private: private:
static MCAsmInfo *Allocator(const MCRegisterInfo & /*MRI*/, StringRef TT) { static MCAsmInfo *Allocator(const MCRegisterInfo & /*MRI*/,
const Triple &TT) {
return new MCAsmInfoImpl(TT); return new MCAsmInfoImpl(TT);
} }
}; };

View File

@@ -69,8 +69,7 @@ const MCExpr *AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(
return MCBinaryExpr::createSub(Res, PC, Context); return MCBinaryExpr::createSub(Res, PC, Context);
} }
AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(StringRef TT) { AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(const Triple &T) {
Triple T(TT);
if (T.getArch() == Triple::aarch64_be) if (T.getArch() == Triple::aarch64_be)
IsLittleEndian = false; IsLittleEndian = false;

View File

@@ -18,9 +18,10 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class Target;
class StringRef;
class MCStreamer; class MCStreamer;
class Target;
class Triple;
struct AArch64MCAsmInfoDarwin : public MCAsmInfoDarwin { struct AArch64MCAsmInfoDarwin : public MCAsmInfoDarwin {
explicit AArch64MCAsmInfoDarwin(); explicit AArch64MCAsmInfoDarwin();
const MCExpr * const MCExpr *
@@ -29,7 +30,7 @@ struct AArch64MCAsmInfoDarwin : public MCAsmInfoDarwin {
}; };
struct AArch64MCAsmInfoELF : public MCAsmInfoELF { struct AArch64MCAsmInfoELF : public MCAsmInfoELF {
explicit AArch64MCAsmInfoELF(StringRef TT); explicit AArch64MCAsmInfoELF(const Triple &T);
}; };
} // namespace llvm } // namespace llvm

View File

@@ -58,15 +58,13 @@ static MCRegisterInfo *createAArch64MCRegisterInfo(StringRef Triple) {
} }
static MCAsmInfo *createAArch64MCAsmInfo(const MCRegisterInfo &MRI, static MCAsmInfo *createAArch64MCAsmInfo(const MCRegisterInfo &MRI,
StringRef TT) { const Triple &TheTriple) {
Triple TheTriple(TT);
MCAsmInfo *MAI; MCAsmInfo *MAI;
if (TheTriple.isOSDarwin()) if (TheTriple.isOSDarwin())
MAI = new AArch64MCAsmInfoDarwin(); MAI = new AArch64MCAsmInfoDarwin();
else { else {
assert(TheTriple.isOSBinFormatELF() && "Only expect Darwin or ELF"); assert(TheTriple.isOSBinFormatELF() && "Only expect Darwin or ELF");
MAI = new AArch64MCAsmInfoELF(TT); MAI = new AArch64MCAsmInfoELF(TheTriple);
} }
// Initial state of the frame pointer is SP. // Initial state of the frame pointer is SP.

View File

@@ -19,8 +19,7 @@ using namespace llvm;
void ARMMCAsmInfoDarwin::anchor() { } void ARMMCAsmInfoDarwin::anchor() { }
ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(StringRef TT) { ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) {
Triple TheTriple(TT);
if ((TheTriple.getArch() == Triple::armeb) || if ((TheTriple.getArch() == Triple::armeb) ||
(TheTriple.getArch() == Triple::thumbeb)) (TheTriple.getArch() == Triple::thumbeb))
IsLittleEndian = false; IsLittleEndian = false;
@@ -41,8 +40,7 @@ ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(StringRef TT) {
void ARMELFMCAsmInfo::anchor() { } void ARMELFMCAsmInfo::anchor() { }
ARMELFMCAsmInfo::ARMELFMCAsmInfo(StringRef TT) { ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
Triple TheTriple(TT);
if ((TheTriple.getArch() == Triple::armeb) || if ((TheTriple.getArch() == Triple::armeb) ||
(TheTriple.getArch() == Triple::thumbeb)) (TheTriple.getArch() == Triple::thumbeb))
IsLittleEndian = false; IsLittleEndian = false;

View File

@@ -19,18 +19,19 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class Triple;
class ARMMCAsmInfoDarwin : public MCAsmInfoDarwin { class ARMMCAsmInfoDarwin : public MCAsmInfoDarwin {
virtual void anchor(); virtual void anchor();
public: public:
explicit ARMMCAsmInfoDarwin(StringRef TT); explicit ARMMCAsmInfoDarwin(const Triple &TheTriple);
}; };
class ARMELFMCAsmInfo : public MCAsmInfoELF { class ARMELFMCAsmInfo : public MCAsmInfoELF {
void anchor() override; void anchor() override;
public: public:
explicit ARMELFMCAsmInfo(StringRef TT); explicit ARMELFMCAsmInfo(const Triple &TT);
void setUseIntegratedAssembler(bool Value) override; void setUseIntegratedAssembler(bool Value) override;
}; };

View File

@@ -277,18 +277,17 @@ static MCRegisterInfo *createARMMCRegisterInfo(StringRef Triple) {
return X; return X;
} }
static MCAsmInfo *createARMMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT) { static MCAsmInfo *createARMMCAsmInfo(const MCRegisterInfo &MRI,
Triple TheTriple(TT); const Triple &TheTriple) {
MCAsmInfo *MAI; MCAsmInfo *MAI;
if (TheTriple.isOSDarwin() || TheTriple.isOSBinFormatMachO()) if (TheTriple.isOSDarwin() || TheTriple.isOSBinFormatMachO())
MAI = new ARMMCAsmInfoDarwin(TT); MAI = new ARMMCAsmInfoDarwin(TheTriple);
else if (TheTriple.isWindowsItaniumEnvironment()) else if (TheTriple.isWindowsItaniumEnvironment())
MAI = new ARMCOFFMCAsmInfoGNU(); MAI = new ARMCOFFMCAsmInfoGNU();
else if (TheTriple.isWindowsMSVCEnvironment()) else if (TheTriple.isWindowsMSVCEnvironment())
MAI = new ARMCOFFMCAsmInfoMicrosoft(); MAI = new ARMCOFFMCAsmInfoMicrosoft();
else else
MAI = new ARMELFMCAsmInfo(TT); MAI = new ARMELFMCAsmInfo(TheTriple);
unsigned Reg = MRI.getDwarfRegNum(ARM::SP, true); unsigned Reg = MRI.getDwarfRegNum(ARM::SP, true);
MAI->addInitialFrameState(MCCFIInstruction::createDefCfa(nullptr, Reg, 0)); MAI->addInitialFrameState(MCCFIInstruction::createDefCfa(nullptr, Reg, 0));

View File

@@ -19,10 +19,11 @@
namespace llvm { namespace llvm {
class Target; class Target;
class Triple;
class BPFMCAsmInfo : public MCAsmInfo { class BPFMCAsmInfo : public MCAsmInfo {
public: public:
explicit BPFMCAsmInfo(StringRef TT) { explicit BPFMCAsmInfo(const Triple &TT) {
PrivateGlobalPrefix = ".L"; PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t"; WeakRefDirective = "\t.weak\t";

View File

@@ -18,7 +18,7 @@ using namespace llvm;
// Pin the vtable to this file. // Pin the vtable to this file.
void HexagonMCAsmInfo::anchor() {} void HexagonMCAsmInfo::anchor() {}
HexagonMCAsmInfo::HexagonMCAsmInfo(StringRef TT) { HexagonMCAsmInfo::HexagonMCAsmInfo(const Triple &TT) {
Data16bitsDirective = "\t.half\t"; Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t"; Data32bitsDirective = "\t.word\t";
Data64bitsDirective = nullptr; // .xword is only supported by V9. Data64bitsDirective = nullptr; // .xword is only supported by V9.

View File

@@ -18,10 +18,12 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class Triple;
class HexagonMCAsmInfo : public MCAsmInfoELF { class HexagonMCAsmInfo : public MCAsmInfoELF {
void anchor() override; void anchor() override;
public: public:
explicit HexagonMCAsmInfo(StringRef TT); explicit HexagonMCAsmInfo(const Triple &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@@ -55,7 +55,7 @@ createHexagonMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS) {
} }
static MCAsmInfo *createHexagonMCAsmInfo(const MCRegisterInfo &MRI, static MCAsmInfo *createHexagonMCAsmInfo(const MCRegisterInfo &MRI,
StringRef TT) { const Triple &TT) {
MCAsmInfo *MAI = new HexagonMCAsmInfo(TT); MCAsmInfo *MAI = new HexagonMCAsmInfo(TT);
// VirtualFP = (R30 + #0). // VirtualFP = (R30 + #0).

View File

@@ -19,5 +19,5 @@
type = Library type = Library
name = MSP430Desc name = MSP430Desc
parent = MSP430 parent = MSP430
required_libraries = MC MSP430AsmPrinter MSP430Info required_libraries = MC MSP430AsmPrinter MSP430Info Support
add_to_library_groups = MSP430 add_to_library_groups = MSP430

View File

@@ -12,12 +12,11 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MSP430MCAsmInfo.h" #include "MSP430MCAsmInfo.h"
#include "llvm/ADT/StringRef.h"
using namespace llvm; using namespace llvm;
void MSP430MCAsmInfo::anchor() { } void MSP430MCAsmInfo::anchor() { }
MSP430MCAsmInfo::MSP430MCAsmInfo(StringRef TT) { MSP430MCAsmInfo::MSP430MCAsmInfo(const Triple &TT) {
PointerSize = CalleeSaveStackSlotSize = 2; PointerSize = CalleeSaveStackSlotSize = 2;
CommentString = ";"; CommentString = ";";

View File

@@ -17,12 +17,12 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class StringRef; class Triple;
class MSP430MCAsmInfo : public MCAsmInfoELF { class MSP430MCAsmInfo : public MCAsmInfoELF {
void anchor() override; void anchor() override;
public: public:
explicit MSP430MCAsmInfo(StringRef TT); explicit MSP430MCAsmInfo(const Triple &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@@ -18,8 +18,7 @@ using namespace llvm;
void MipsMCAsmInfo::anchor() { } void MipsMCAsmInfo::anchor() { }
MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) { MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
Triple TheTriple(TT);
if ((TheTriple.getArch() == Triple::mips) || if ((TheTriple.getArch() == Triple::mips) ||
(TheTriple.getArch() == Triple::mips64)) (TheTriple.getArch() == Triple::mips64))
IsLittleEndian = false; IsLittleEndian = false;

View File

@@ -17,12 +17,12 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class StringRef; class Triple;
class MipsMCAsmInfo : public MCAsmInfoELF { class MipsMCAsmInfo : public MCAsmInfoELF {
void anchor() override; void anchor() override;
public: public:
explicit MipsMCAsmInfo(StringRef TT); explicit MipsMCAsmInfo(const Triple &TheTriple);
}; };
} // namespace llvm } // namespace llvm

View File

@@ -75,7 +75,8 @@ static MCSubtargetInfo *createMipsMCSubtargetInfo(StringRef TT, StringRef CPU,
return X; return X;
} }
static MCAsmInfo *createMipsMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT) { static MCAsmInfo *createMipsMCAsmInfo(const MCRegisterInfo &MRI,
const Triple &TT) {
MCAsmInfo *MAI = new MipsMCAsmInfo(TT); MCAsmInfo *MAI = new MipsMCAsmInfo(TT);
unsigned SP = MRI.getDwarfRegNum(Mips::SP, true); unsigned SP = MRI.getDwarfRegNum(Mips::SP, true);

View File

@@ -25,8 +25,7 @@ static cl::opt<bool> CompileForDebugging("debug-compile",
void NVPTXMCAsmInfo::anchor() {} void NVPTXMCAsmInfo::anchor() {}
NVPTXMCAsmInfo::NVPTXMCAsmInfo(StringRef TT) { NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) {
Triple TheTriple(TT);
if (TheTriple.getArch() == Triple::nvptx64) { if (TheTriple.getArch() == Triple::nvptx64) {
PointerSize = CalleeSaveStackSlotSize = 8; PointerSize = CalleeSaveStackSlotSize = 8;
} }

View File

@@ -18,12 +18,12 @@
namespace llvm { namespace llvm {
class Target; class Target;
class StringRef; class Triple;
class NVPTXMCAsmInfo : public MCAsmInfo { class NVPTXMCAsmInfo : public MCAsmInfo {
virtual void anchor(); virtual void anchor();
public: public:
explicit NVPTXMCAsmInfo(StringRef TT); explicit NVPTXMCAsmInfo(const Triple &TheTriple);
}; };
} // namespace llvm } // namespace llvm

View File

@@ -69,8 +69,8 @@ static MCSubtargetInfo *createPPCMCSubtargetInfo(StringRef TT, StringRef CPU,
return X; return X;
} }
static MCAsmInfo *createPPCMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT) { static MCAsmInfo *createPPCMCAsmInfo(const MCRegisterInfo &MRI,
Triple TheTriple(TT); const Triple &TheTriple) {
bool isPPC64 = (TheTriple.getArch() == Triple::ppc64 || bool isPPC64 = (TheTriple.getArch() == Triple::ppc64 ||
TheTriple.getArch() == Triple::ppc64le); TheTriple.getArch() == Triple::ppc64le);

View File

@@ -11,7 +11,7 @@
#include "AMDGPUMCAsmInfo.h" #include "AMDGPUMCAsmInfo.h"
using namespace llvm; using namespace llvm;
AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfoELF() { AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT) : MCAsmInfoELF() {
HasSingleParameterDotFile = false; HasSingleParameterDotFile = false;
//===------------------------------------------------------------------===// //===------------------------------------------------------------------===//
MaxInstLength = 16; MaxInstLength = 16;

View File

@@ -17,7 +17,7 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class StringRef; class Triple;
// If you need to create another MCAsmInfo class, which inherits from MCAsmInfo, // If you need to create another MCAsmInfo class, which inherits from MCAsmInfo,
// you will need to make sure your new class sets PrivateGlobalPrefix to // you will need to make sure your new class sets PrivateGlobalPrefix to
@@ -26,7 +26,7 @@ class StringRef;
// with 'L' as a local symbol. // with 'L' as a local symbol.
class AMDGPUMCAsmInfo : public MCAsmInfoELF { class AMDGPUMCAsmInfo : public MCAsmInfoELF {
public: public:
explicit AMDGPUMCAsmInfo(StringRef &TT); explicit AMDGPUMCAsmInfo(const Triple &TT);
}; };
} // namespace llvm } // namespace llvm
#endif #endif

View File

@@ -20,8 +20,7 @@ using namespace llvm;
void SparcELFMCAsmInfo::anchor() {} void SparcELFMCAsmInfo::anchor() {}
SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) { SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Triple &TheTriple) {
Triple TheTriple(TT);
bool isV9 = (TheTriple.getArch() == Triple::sparcv9); bool isV9 = (TheTriple.getArch() == Triple::sparcv9);
IsLittleEndian = (TheTriple.getArch() == Triple::sparcel); IsLittleEndian = (TheTriple.getArch() == Triple::sparcel);

View File

@@ -17,12 +17,12 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class StringRef; class Triple;
class SparcELFMCAsmInfo : public MCAsmInfoELF { class SparcELFMCAsmInfo : public MCAsmInfoELF {
void anchor() override; void anchor() override;
public: public:
explicit SparcELFMCAsmInfo(StringRef TT); explicit SparcELFMCAsmInfo(const Triple &TheTriple);
const MCExpr* const MCExpr*
getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding,
MCStreamer &Streamer) const override; MCStreamer &Streamer) const override;

View File

@@ -34,7 +34,7 @@ using namespace llvm;
#include "SparcGenRegisterInfo.inc" #include "SparcGenRegisterInfo.inc"
static MCAsmInfo *createSparcMCAsmInfo(const MCRegisterInfo &MRI, static MCAsmInfo *createSparcMCAsmInfo(const MCRegisterInfo &MRI,
StringRef TT) { const Triple &TT) {
MCAsmInfo *MAI = new SparcELFMCAsmInfo(TT); MCAsmInfo *MAI = new SparcELFMCAsmInfo(TT);
unsigned Reg = MRI.getDwarfRegNum(SP::O6, true); unsigned Reg = MRI.getDwarfRegNum(SP::O6, true);
MCCFIInstruction Inst = MCCFIInstruction::createDefCfa(nullptr, Reg, 0); MCCFIInstruction Inst = MCCFIInstruction::createDefCfa(nullptr, Reg, 0);
@@ -43,7 +43,7 @@ static MCAsmInfo *createSparcMCAsmInfo(const MCRegisterInfo &MRI,
} }
static MCAsmInfo *createSparcV9MCAsmInfo(const MCRegisterInfo &MRI, static MCAsmInfo *createSparcV9MCAsmInfo(const MCRegisterInfo &MRI,
StringRef TT) { const Triple &TT) {
MCAsmInfo *MAI = new SparcELFMCAsmInfo(TT); MCAsmInfo *MAI = new SparcELFMCAsmInfo(TT);
unsigned Reg = MRI.getDwarfRegNum(SP::O6, true); unsigned Reg = MRI.getDwarfRegNum(SP::O6, true);
MCCFIInstruction Inst = MCCFIInstruction::createDefCfa(nullptr, Reg, 2047); MCCFIInstruction Inst = MCCFIInstruction::createDefCfa(nullptr, Reg, 2047);

View File

@@ -13,7 +13,7 @@
using namespace llvm; using namespace llvm;
SystemZMCAsmInfo::SystemZMCAsmInfo(StringRef TT) { SystemZMCAsmInfo::SystemZMCAsmInfo(const Triple &TT) {
PointerSize = 8; PointerSize = 8;
CalleeSaveStackSlotSize = 8; CalleeSaveStackSlotSize = 8;
IsLittleEndian = false; IsLittleEndian = false;

View File

@@ -14,11 +14,11 @@
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
namespace llvm { namespace llvm {
class StringRef; class Triple;
class SystemZMCAsmInfo : public MCAsmInfoELF { class SystemZMCAsmInfo : public MCAsmInfoELF {
public: public:
explicit SystemZMCAsmInfo(StringRef TT); explicit SystemZMCAsmInfo(const Triple &TT);
}; };
} // end namespace llvm } // end namespace llvm

View File

@@ -132,7 +132,7 @@ unsigned SystemZMC::getFirstReg(unsigned Reg) {
} }
static MCAsmInfo *createSystemZMCAsmInfo(const MCRegisterInfo &MRI, static MCAsmInfo *createSystemZMCAsmInfo(const MCRegisterInfo &MRI,
StringRef TT) { const Triple &TT) {
MCAsmInfo *MAI = new SystemZMCAsmInfo(TT); MCAsmInfo *MAI = new SystemZMCAsmInfo(TT);
MCCFIInstruction Inst = MCCFIInstruction Inst =
MCCFIInstruction::createDefCfa(nullptr, MCCFIInstruction::createDefCfa(nullptr,

View File

@@ -115,8 +115,8 @@ static MCRegisterInfo *createX86MCRegisterInfo(StringRef TT) {
return X; return X;
} }
static MCAsmInfo *createX86MCAsmInfo(const MCRegisterInfo &MRI, StringRef TT) { static MCAsmInfo *createX86MCAsmInfo(const MCRegisterInfo &MRI,
Triple TheTriple(TT); const Triple &TheTriple) {
bool is64Bit = TheTriple.getArch() == Triple::x86_64; bool is64Bit = TheTriple.getArch() == Triple::x86_64;
MCAsmInfo *MAI; MCAsmInfo *MAI;

View File

@@ -8,12 +8,11 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "XCoreMCAsmInfo.h" #include "XCoreMCAsmInfo.h"
#include "llvm/ADT/StringRef.h"
using namespace llvm; using namespace llvm;
void XCoreMCAsmInfo::anchor() { } void XCoreMCAsmInfo::anchor() { }
XCoreMCAsmInfo::XCoreMCAsmInfo(StringRef TT) { XCoreMCAsmInfo::XCoreMCAsmInfo(const Triple &TT) {
SupportsDebugInformation = true; SupportsDebugInformation = true;
Data16bitsDirective = "\t.short\t"; Data16bitsDirective = "\t.short\t";
Data32bitsDirective = "\t.long\t"; Data32bitsDirective = "\t.long\t";

View File

@@ -17,13 +17,13 @@
#include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoELF.h"
namespace llvm { namespace llvm {
class StringRef; class Triple;
class Target;
class XCoreMCAsmInfo : public MCAsmInfoELF { class XCoreMCAsmInfo : public MCAsmInfoELF {
void anchor() override; void anchor() override;
public: public:
explicit XCoreMCAsmInfo(StringRef TT); explicit XCoreMCAsmInfo(const Triple &TT);
}; };
} // namespace llvm } // namespace llvm

View File

@@ -54,7 +54,7 @@ static MCSubtargetInfo *createXCoreMCSubtargetInfo(StringRef TT, StringRef CPU,
} }
static MCAsmInfo *createXCoreMCAsmInfo(const MCRegisterInfo &MRI, static MCAsmInfo *createXCoreMCAsmInfo(const MCRegisterInfo &MRI,
StringRef TT) { const Triple &TT) {
MCAsmInfo *MAI = new XCoreMCAsmInfo(TT); MCAsmInfo *MAI = new XCoreMCAsmInfo(TT);
// Initial state of the frame pointer is SP. // Initial state of the frame pointer is SP.