mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-20 03:17:48 +00:00
Split the object streamer callback in one per file format.
There are two main advantages to doing this * Targets that only need to handle one of the formats specially don't have to worry about the others. For example, x86 now only registers a constructor for the COFF streamer. * Changes to the arguments passed to one format constructor will not impact the other formats. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -108,14 +108,12 @@ static MCInstPrinter *createMipsMCInstPrinter(const Target &T,
|
||||
|
||||
static MCStreamer *createMCStreamer(const Triple &T, MCContext &Context,
|
||||
MCAsmBackend &MAB, raw_ostream &OS,
|
||||
MCCodeEmitter *Emitter,
|
||||
const MCSubtargetInfo &STI, bool RelaxAll) {
|
||||
MCCodeEmitter *Emitter, bool RelaxAll) {
|
||||
MCStreamer *S;
|
||||
if (!T.isOSNaCl())
|
||||
S = createMipsELFStreamer(Context, MAB, OS, Emitter, STI, RelaxAll);
|
||||
S = createMipsELFStreamer(Context, MAB, OS, Emitter, RelaxAll);
|
||||
else
|
||||
S = createMipsNaClELFStreamer(Context, MAB, OS, Emitter, STI, RelaxAll);
|
||||
new MipsTargetELFStreamer(*S, STI);
|
||||
S = createMipsNaClELFStreamer(Context, MAB, OS, Emitter, RelaxAll);
|
||||
return S;
|
||||
}
|
||||
|
||||
@@ -130,6 +128,11 @@ static MCTargetStreamer *createMipsNullTargetStreamer(MCStreamer &S) {
|
||||
return new MipsTargetStreamer(S);
|
||||
}
|
||||
|
||||
static MCTargetStreamer *
|
||||
createMipsObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
|
||||
return new MipsTargetELFStreamer(S, STI);
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMipsTargetMC() {
|
||||
for (Target *T : {&TheMipsTarget, &TheMipselTarget, &TheMips64Target,
|
||||
&TheMips64elTarget}) {
|
||||
@@ -145,8 +148,8 @@ extern "C" void LLVMInitializeMipsTargetMC() {
|
||||
// Register the MC register info.
|
||||
TargetRegistry::RegisterMCRegInfo(*T, createMipsMCRegisterInfo);
|
||||
|
||||
// Register the object streamer.
|
||||
TargetRegistry::RegisterMCObjectStreamer(*T, createMCStreamer);
|
||||
// Register the elf streamer.
|
||||
TargetRegistry::RegisterELFStreamer(*T, createMCStreamer);
|
||||
|
||||
// Register the asm target streamer.
|
||||
TargetRegistry::RegisterAsmTargetStreamer(*T, createMipsAsmTargetStreamer);
|
||||
@@ -159,6 +162,9 @@ extern "C" void LLVMInitializeMipsTargetMC() {
|
||||
|
||||
// Register the MCInstPrinter.
|
||||
TargetRegistry::RegisterMCInstPrinter(*T, createMipsMCInstPrinter);
|
||||
|
||||
TargetRegistry::RegisterObjectTargetStreamer(
|
||||
*T, createMipsObjectTargetStreamer);
|
||||
}
|
||||
|
||||
// Register the MC Code Emitter
|
||||
|
||||
Reference in New Issue
Block a user