diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp index 421a797..d2dbda3 100644 --- a/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +++ b/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp @@ -139,6 +139,18 @@ public: // limit the parser? } }; + +class PPCTargetMACHOStreamer : public PPCTargetStreamer { +public: + PPCTargetMACHOStreamer(MCStreamer &S) : PPCTargetStreamer(S) {} + virtual void emitTCEntry(const MCSymbol &S) { + // Does nothing on Darwin, perhaps a diagnostic would be useful. + } + virtual void emitMachine(StringRef CPU) { + // FIXME: We need to update the CPUType, CPUSubType in the Object file if + // the new values are different from the defaults. + } +}; } // This is duplicated code. Refactor this. @@ -149,8 +161,11 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT, const MCSubtargetInfo &STI, bool RelaxAll, bool NoExecStack) { - if (Triple(TT).isOSDarwin()) - return createMachOStreamer(Ctx, MAB, OS, Emitter, RelaxAll); + if (Triple(TT).isOSDarwin()) { + MCStreamer *S = createMachOStreamer(Ctx, MAB, OS, Emitter, RelaxAll); + new PPCTargetMACHOStreamer(*S); + return S; + } MCStreamer *S = createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll, NoExecStack);