summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-09-15 13:17:40 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2015-09-15 13:17:40 +0000
commit18d4b0dab73100607f6b772053c1fe1f1141b8b6 (patch)
tree8d9248b14bf00ccfd7e2cb5e376d1bf3045310ce /llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
parent1395253bf3964f48ed50ea23aa5cb9ef9b0575ff (diff)
downloadbcm5719-llvm-18d4b0dab73100607f6b772053c1fe1f1141b8b6.tar.gz
bcm5719-llvm-18d4b0dab73100607f6b772053c1fe1f1141b8b6.zip
Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247683
Diffstat (limited to 'llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
index 30f232a9a91..f6033df1bd5 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
@@ -51,9 +51,9 @@ static MCInstrInfo *createPPCMCInstrInfo() {
return X;
}
-static MCRegisterInfo *createPPCMCRegisterInfo(const Triple &TT) {
- bool isPPC64 =
- (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
+static MCRegisterInfo *createPPCMCRegisterInfo(const TargetTuple &TT) {
+ bool isPPC64 = (TT.getArch() == TargetTuple::ppc64 ||
+ TT.getArch() == TargetTuple::ppc64le);
unsigned Flavour = isPPC64 ? 0 : 1;
unsigned RA = isPPC64 ? PPC::LR8 : PPC::LR;
@@ -62,21 +62,21 @@ static MCRegisterInfo *createPPCMCRegisterInfo(const Triple &TT) {
return X;
}
-static MCSubtargetInfo *createPPCMCSubtargetInfo(const Triple &TT,
+static MCSubtargetInfo *createPPCMCSubtargetInfo(const TargetTuple &TT,
StringRef CPU, StringRef FS) {
return createPPCMCSubtargetInfoImpl(TT, CPU, FS);
}
static MCAsmInfo *createPPCMCAsmInfo(const MCRegisterInfo &MRI,
- const Triple &TheTriple) {
- bool isPPC64 = (TheTriple.getArch() == Triple::ppc64 ||
- TheTriple.getArch() == Triple::ppc64le);
+ const TargetTuple &TT) {
+ bool isPPC64 = (TT.getArch() == TargetTuple::ppc64 ||
+ TT.getArch() == TargetTuple::ppc64le);
MCAsmInfo *MAI;
- if (TheTriple.isOSDarwin())
- MAI = new PPCMCAsmInfoDarwin(isPPC64, TheTriple);
+ if (TT.isOSDarwin())
+ MAI = new PPCMCAsmInfoDarwin(isPPC64, TT);
else
- MAI = new PPCELFMCAsmInfo(isPPC64, TheTriple);
+ MAI = new PPCELFMCAsmInfo(isPPC64, TT);
// Initial state of the frame pointer is R1.
unsigned Reg = isPPC64 ? PPC::X1 : PPC::R1;
@@ -87,7 +87,8 @@ static MCAsmInfo *createPPCMCAsmInfo(const MCRegisterInfo &MRI,
return MAI;
}
-static MCCodeGenInfo *createPPCMCCodeGenInfo(const Triple &TT, Reloc::Model RM,
+static MCCodeGenInfo *createPPCMCCodeGenInfo(const TargetTuple &TT,
+ Reloc::Model RM,
CodeModel::Model CM,
CodeGenOpt::Level OL) {
MCCodeGenInfo *X = new MCCodeGenInfo();
@@ -99,8 +100,8 @@ static MCCodeGenInfo *createPPCMCCodeGenInfo(const Triple &TT, Reloc::Model RM,
RM = Reloc::Static;
}
if (CM == CodeModel::Default) {
- if (!TT.isOSDarwin() &&
- (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le))
+ if (!TT.isOSDarwin() && (TT.getArch() == TargetTuple::ppc64 ||
+ TT.getArch() == TargetTuple::ppc64le))
CM = CodeModel::Medium;
}
X->initMCCodeGenInfo(RM, CM, OL);
@@ -225,18 +226,18 @@ static MCTargetStreamer *createAsmTargetStreamer(MCStreamer &S,
static MCTargetStreamer *
createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
- const Triple &TT = STI.getTargetTriple();
+ const TargetTuple &TT = STI.getTargetTuple();
if (TT.isOSBinFormatELF())
return new PPCTargetELFStreamer(S);
return new PPCTargetMachOStreamer(S);
}
-static MCInstPrinter *createPPCMCInstPrinter(const Triple &T,
+static MCInstPrinter *createPPCMCInstPrinter(const TargetTuple &TT,
unsigned SyntaxVariant,
const MCAsmInfo &MAI,
const MCInstrInfo &MII,
const MCRegisterInfo &MRI) {
- return new PPCInstPrinter(MAI, MII, MRI, T.isOSDarwin());
+ return new PPCInstPrinter(MAI, MII, MRI, TT.isOSDarwin());
}
extern "C" void LLVMInitializePowerPCTargetMC() {
OpenPOWER on IntegriCloud