mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -20,7 +20,6 @@ add_llvm_target(PowerPCCodeGen
|
||||
PPCISelLowering.cpp
|
||||
PPCFrameLowering.cpp
|
||||
PPCJITInfo.cpp
|
||||
PPCMCAsmInfo.cpp
|
||||
PPCMCCodeEmitter.cpp
|
||||
PPCMCInstLower.cpp
|
||||
PPCPredicates.cpp
|
||||
|
@@ -1 +1,4 @@
|
||||
add_llvm_library(LLVMPowerPCDesc PPCMCTargetDesc.cpp)
|
||||
add_llvm_library(LLVMPowerPCDesc
|
||||
PPCMCTargetDesc.cpp
|
||||
PPCMCAsmInfo.cpp
|
||||
)
|
||||
|
@@ -12,6 +12,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "PPCMCTargetDesc.h"
|
||||
#include "PPCMCAsmInfo.h"
|
||||
#include "llvm/MC/MCInstrInfo.h"
|
||||
#include "llvm/MC/MCRegisterInfo.h"
|
||||
#include "llvm/MC/MCSubtargetInfo.h"
|
||||
@@ -28,7 +29,7 @@
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
MCInstrInfo *createPPCMCInstrInfo() {
|
||||
static MCInstrInfo *createPPCMCInstrInfo() {
|
||||
MCInstrInfo *X = new MCInstrInfo();
|
||||
InitPPCMCInstrInfo(X);
|
||||
return X;
|
||||
@@ -40,8 +41,8 @@ extern "C" void LLVMInitializePowerPCMCInstrInfo() {
|
||||
}
|
||||
|
||||
|
||||
MCSubtargetInfo *createPPCMCSubtargetInfo(StringRef TT, StringRef CPU,
|
||||
StringRef FS) {
|
||||
static MCSubtargetInfo *createPPCMCSubtargetInfo(StringRef TT, StringRef CPU,
|
||||
StringRef FS) {
|
||||
MCSubtargetInfo *X = new MCSubtargetInfo();
|
||||
InitPPCMCSubtargetInfo(X, TT, CPU, FS);
|
||||
return X;
|
||||
@@ -53,3 +54,17 @@ extern "C" void LLVMInitializePowerPCMCSubtargetInfo() {
|
||||
TargetRegistry::RegisterMCSubtargetInfo(ThePPC64Target,
|
||||
createPPCMCSubtargetInfo);
|
||||
}
|
||||
|
||||
static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
|
||||
if (TheTriple.isOSDarwin())
|
||||
return new PPCMCAsmInfoDarwin(isPPC64);
|
||||
return new PPCLinuxMCAsmInfo(isPPC64);
|
||||
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializePowerPCMCAsmInfo() {
|
||||
RegisterMCAsmInfoFn C(ThePPC32Target, createMCAsmInfo);
|
||||
RegisterMCAsmInfoFn D(ThePPC64Target, createMCAsmInfo);
|
||||
}
|
||||
|
@@ -12,7 +12,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "PPC.h"
|
||||
#include "PPCMCAsmInfo.h"
|
||||
#include "PPCTargetMachine.h"
|
||||
#include "llvm/PassManager.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
@@ -21,15 +20,6 @@
|
||||
#include "llvm/Support/FormattedStream.h"
|
||||
using namespace llvm;
|
||||
|
||||
static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
|
||||
if (TheTriple.isOSDarwin())
|
||||
return new PPCMCAsmInfoDarwin(isPPC64);
|
||||
return new PPCLinuxMCAsmInfo(isPPC64);
|
||||
|
||||
}
|
||||
|
||||
// This is duplicated code. Refactor this.
|
||||
static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
@@ -48,9 +38,6 @@ extern "C" void LLVMInitializePowerPCTarget() {
|
||||
RegisterTargetMachine<PPC32TargetMachine> A(ThePPC32Target);
|
||||
RegisterTargetMachine<PPC64TargetMachine> B(ThePPC64Target);
|
||||
|
||||
RegisterAsmInfoFn C(ThePPC32Target, createMCAsmInfo);
|
||||
RegisterAsmInfoFn D(ThePPC64Target, createMCAsmInfo);
|
||||
|
||||
// Register the MC Code Emitter
|
||||
TargetRegistry::RegisterCodeEmitter(ThePPC32Target, createPPCMCCodeEmitter);
|
||||
TargetRegistry::RegisterCodeEmitter(ThePPC64Target, createPPCMCCodeEmitter);
|
||||
|
Reference in New Issue
Block a user