return new PPCTargetAsmStreamer(S, OS);
}
+static MCTargetStreamer *createNullTargetStreamer(MCStreamer &S) {
+ return new PPCTargetStreamer(S);
+}
+
static MCTargetStreamer *
createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
const Triple &TT = STI.getTargetTriple();
// Register the asm target streamer.
TargetRegistry::RegisterAsmTargetStreamer(*T, createAsmTargetStreamer);
+ // Register the null target streamer.
+ TargetRegistry::RegisterNullTargetStreamer(*T, createNullTargetStreamer);
+
// Register the MCInstPrinter.
TargetRegistry::RegisterMCInstPrinter(*T, createPPCMCInstPrinter);
}
if (static_cast<const PPCTargetMachine &>(TM).isELFv2ABI()) {
PPCTargetStreamer *TS =
static_cast<PPCTargetStreamer *>(OutStreamer->getTargetStreamer());
-
- if (TS)
- TS->emitAbiVersion(2);
+ TS->emitAbiVersion(2);
}
if (static_cast<const PPCTargetMachine &>(TM).isPPC64() ||
MCSymbol *const TOCEntryLabel = TOCMapPair.second;
OutStreamer->emitLabel(TOCEntryLabel);
- if (isPPC64 && TS != nullptr)
+ if (isPPC64)
TS->emitTCEntry(*TOCEntryTarget, TOCMapPair.first.second);
else
OutStreamer->emitSymbolValue(TOCEntryTarget, 4);
PPCTargetStreamer *TS =
static_cast<PPCTargetStreamer *>(OutStreamer->getTargetStreamer());
-
- if (TS)
- TS->emitLocalEntry(cast<MCSymbolELF>(CurrentFnSym), LocalOffsetExp);
+ TS->emitLocalEntry(cast<MCSymbolELF>(CurrentFnSym), LocalOffsetExp);
} else if (Subtarget->isUsingPCRelativeCalls()) {
// When generating the entry point for a function we have a few scenarios
// based on whether or not that function uses R2 and whether or not that
MF->hasInlineAsm() || (!PPCFI->usesTOCBasePtr() && UsesX2OrR2)) {
PPCTargetStreamer *TS =
static_cast<PPCTargetStreamer *>(OutStreamer->getTargetStreamer());
- if (TS)
- TS->emitLocalEntry(cast<MCSymbolELF>(CurrentFnSym),
- MCConstantExpr::create(1, OutContext));
+ TS->emitLocalEntry(cast<MCSymbolELF>(CurrentFnSym),
+ MCConstantExpr::create(1, OutContext));
}
}
}
OutStreamer->switchSection(TCEntry);
OutStreamer->emitLabel(I.second);
- if (TS != nullptr)
- TS->emitTCEntry(*I.first.first, I.first.second);
+ TS->emitTCEntry(*I.first.first, I.first.second);
}
for (const auto *GV : TOCDataGlobalVars)
~PPCTargetStreamer() override;
virtual void emitTCEntry(const MCSymbol &S,
- MCSymbolRefExpr::VariantKind Kind) = 0;
- virtual void emitMachine(StringRef CPU) = 0;
- virtual void emitAbiVersion(int AbiVersion) = 0;
- virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) = 0;
+ MCSymbolRefExpr::VariantKind Kind){};
+ virtual void emitMachine(StringRef CPU){};
+ virtual void emitAbiVersion(int AbiVersion){};
+ virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset){};
};
} // end namespace llvm