mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Pass a MCSubtargetInfo down to the TargetStreamer creation.
With this the target streamers will be able to know the target features that are in use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a81d9af293
commit
550d791907
@ -126,6 +126,7 @@ namespace llvm {
|
|||||||
MCAsmBackend &TAB,
|
MCAsmBackend &TAB,
|
||||||
raw_ostream &_OS,
|
raw_ostream &_OS,
|
||||||
MCCodeEmitter *_Emitter,
|
MCCodeEmitter *_Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack);
|
bool NoExecStack);
|
||||||
typedef MCStreamer *(*AsmStreamerCtorTy)(MCContext &Ctx,
|
typedef MCStreamer *(*AsmStreamerCtorTy)(MCContext &Ctx,
|
||||||
@ -418,11 +419,12 @@ namespace llvm {
|
|||||||
MCAsmBackend &TAB,
|
MCAsmBackend &TAB,
|
||||||
raw_ostream &_OS,
|
raw_ostream &_OS,
|
||||||
MCCodeEmitter *_Emitter,
|
MCCodeEmitter *_Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) const {
|
bool NoExecStack) const {
|
||||||
if (!MCObjectStreamerCtorFn)
|
if (!MCObjectStreamerCtorFn)
|
||||||
return 0;
|
return 0;
|
||||||
return MCObjectStreamerCtorFn(*this, TT, Ctx, TAB, _OS, _Emitter,
|
return MCObjectStreamerCtorFn(*this, TT, Ctx, TAB, _OS, _Emitter, STI,
|
||||||
RelaxAll, NoExecStack);
|
RelaxAll, NoExecStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,10 +204,9 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
|||||||
if (MCE == 0 || MAB == 0)
|
if (MCE == 0 || MAB == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
AsmStreamer.reset(getTarget().createMCObjectStreamer(getTargetTriple(),
|
AsmStreamer.reset(getTarget().createMCObjectStreamer(
|
||||||
*Context, *MAB, Out,
|
getTargetTriple(), *Context, *MAB, Out, MCE, STI, hasMCRelaxAll(),
|
||||||
MCE, hasMCRelaxAll(),
|
hasMCNoExecStack()));
|
||||||
hasMCNoExecStack()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CGFT_Null:
|
case CGFT_Null:
|
||||||
@ -278,10 +277,9 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
OwningPtr<MCStreamer> AsmStreamer;
|
OwningPtr<MCStreamer> AsmStreamer;
|
||||||
AsmStreamer.reset(getTarget().createMCObjectStreamer(getTargetTriple(), *Ctx,
|
AsmStreamer.reset(getTarget().createMCObjectStreamer(
|
||||||
*MAB, Out, MCE,
|
getTargetTriple(), *Ctx, *MAB, Out, MCE, STI, hasMCRelaxAll(),
|
||||||
hasMCRelaxAll(),
|
hasMCNoExecStack()));
|
||||||
hasMCNoExecStack()));
|
|
||||||
|
|
||||||
// Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
|
// Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
|
||||||
FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer);
|
FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer);
|
||||||
|
@ -97,6 +97,7 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
|||||||
MCContext &Ctx, MCAsmBackend &MAB,
|
MCContext &Ctx, MCAsmBackend &MAB,
|
||||||
raw_ostream &OS,
|
raw_ostream &OS,
|
||||||
MCCodeEmitter *Emitter,
|
MCCodeEmitter *Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) {
|
bool NoExecStack) {
|
||||||
Triple TheTriple(TT);
|
Triple TheTriple(TT);
|
||||||
|
@ -236,6 +236,7 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
|||||||
MCContext &Ctx, MCAsmBackend &MAB,
|
MCContext &Ctx, MCAsmBackend &MAB,
|
||||||
raw_ostream &OS,
|
raw_ostream &OS,
|
||||||
MCCodeEmitter *Emitter,
|
MCCodeEmitter *Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) {
|
bool NoExecStack) {
|
||||||
Triple TheTriple(TT);
|
Triple TheTriple(TT);
|
||||||
|
@ -130,6 +130,7 @@ static MCInstPrinter *createMipsMCInstPrinter(const Target &T,
|
|||||||
static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
||||||
MCContext &Context, MCAsmBackend &MAB,
|
MCContext &Context, MCAsmBackend &MAB,
|
||||||
raw_ostream &OS, MCCodeEmitter *Emitter,
|
raw_ostream &OS, MCCodeEmitter *Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll, bool NoExecStack) {
|
bool RelaxAll, bool NoExecStack) {
|
||||||
MCStreamer *S =
|
MCStreamer *S =
|
||||||
createELFStreamer(Context, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
createELFStreamer(Context, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
||||||
|
@ -146,6 +146,7 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
|||||||
MCContext &Ctx, MCAsmBackend &MAB,
|
MCContext &Ctx, MCAsmBackend &MAB,
|
||||||
raw_ostream &OS,
|
raw_ostream &OS,
|
||||||
MCCodeEmitter *Emitter,
|
MCCodeEmitter *Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) {
|
bool NoExecStack) {
|
||||||
if (Triple(TT).isOSDarwin())
|
if (Triple(TT).isOSDarwin())
|
||||||
|
@ -86,6 +86,7 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
|||||||
MCContext &Ctx, MCAsmBackend &MAB,
|
MCContext &Ctx, MCAsmBackend &MAB,
|
||||||
raw_ostream &_OS,
|
raw_ostream &_OS,
|
||||||
MCCodeEmitter *_Emitter,
|
MCCodeEmitter *_Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) {
|
bool NoExecStack) {
|
||||||
return createELFStreamer(Ctx, MAB, _OS, _Emitter, false, false);
|
return createELFStreamer(Ctx, MAB, _OS, _Emitter, false, false);
|
||||||
|
@ -104,7 +104,8 @@ static MCCodeGenInfo *createSparcV9MCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
|||||||
static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
||||||
MCContext &Context, MCAsmBackend &MAB,
|
MCContext &Context, MCAsmBackend &MAB,
|
||||||
raw_ostream &OS, MCCodeEmitter *Emitter,
|
raw_ostream &OS, MCCodeEmitter *Emitter,
|
||||||
bool RelaxAll, bool NoExecStack) {
|
const MCSubtargetInfo &STI, bool RelaxAll,
|
||||||
|
bool NoExecStack) {
|
||||||
MCStreamer *S =
|
MCStreamer *S =
|
||||||
createELFStreamer(Context, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
createELFStreamer(Context, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
||||||
new SparcTargetELFStreamer(*S);
|
new SparcTargetELFStreamer(*S);
|
||||||
|
@ -185,6 +185,7 @@ static MCStreamer *createSystemZMCObjectStreamer(const Target &T, StringRef TT,
|
|||||||
MCAsmBackend &MAB,
|
MCAsmBackend &MAB,
|
||||||
raw_ostream &OS,
|
raw_ostream &OS,
|
||||||
MCCodeEmitter *Emitter,
|
MCCodeEmitter *Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) {
|
bool NoExecStack) {
|
||||||
return createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
return createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
||||||
|
@ -361,6 +361,7 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
|||||||
MCContext &Ctx, MCAsmBackend &MAB,
|
MCContext &Ctx, MCAsmBackend &MAB,
|
||||||
raw_ostream &_OS,
|
raw_ostream &_OS,
|
||||||
MCCodeEmitter *_Emitter,
|
MCCodeEmitter *_Emitter,
|
||||||
|
const MCSubtargetInfo &STI,
|
||||||
bool RelaxAll,
|
bool RelaxAll,
|
||||||
bool NoExecStack) {
|
bool NoExecStack) {
|
||||||
Triple TheTriple(TT);
|
Triple TheTriple(TT);
|
||||||
|
@ -448,7 +448,7 @@ int main(int argc, char **argv) {
|
|||||||
MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);
|
MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);
|
||||||
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU);
|
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU);
|
||||||
Str.reset(TheTarget->createMCObjectStreamer(TripleName, Ctx, *MAB,
|
Str.reset(TheTarget->createMCObjectStreamer(TripleName, Ctx, *MAB,
|
||||||
FOS, CE, RelaxAll,
|
FOS, CE, *STI, RelaxAll,
|
||||||
NoExecStack));
|
NoExecStack));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user