[llvm] r229799 - MC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Feb 19 07:19:57 PST 2015
Awesome. Thanks!
On 18 February 2015 at 19:45, Peter Collingbourne <peter at pcc.me.uk> wrote:
> Author: pcc
> Date: Wed Feb 18 18:45:07 2015
> New Revision: 229799
>
> URL: http://llvm.org/viewvc/llvm-project?rev=229799&view=rev
> Log:
> MC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.
>
> Modified:
> llvm/trunk/include/llvm/Support/TargetRegistry.h
> llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
> llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
> llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
> llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
>
> Modified: llvm/trunk/include/llvm/Support/TargetRegistry.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TargetRegistry.h?rev=229799&r1=229798&r2=229799&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/TargetRegistry.h (original)
> +++ llvm/trunk/include/llvm/Support/TargetRegistry.h Wed Feb 18 18:45:07 2015
> @@ -139,7 +139,6 @@ namespace llvm {
> MCCodeEmitter *CE,
> MCAsmBackend *TAB,
> bool ShowInst);
> - typedef MCStreamer *(*NullStreamerCtorTy)(MCContext &Ctx);
> typedef MCTargetStreamer *(*NullTargetStreamerCtorTy)(MCStreamer &S);
> typedef MCRelocationInfo *(*MCRelocationInfoCtorTy)(StringRef TT,
> MCContext &Ctx);
> @@ -225,10 +224,6 @@ namespace llvm {
> /// AsmStreamer, if registered (default = llvm::createAsmStreamer).
> AsmStreamerCtorTy AsmStreamerCtorFn;
>
> - /// Construction function for this target's NullStreamer, if registered
> - /// (default = llvm::createNullStreamer).
> - NullStreamerCtorTy NullStreamerCtorFn;
> -
> /// Construction function for this target's null TargetStreamer, if
> /// registered (default = nullptr).
> NullTargetStreamerCtorTy NullTargetStreamerCtorFn;
> @@ -243,8 +238,8 @@ namespace llvm {
>
> public:
> Target()
> - : AsmStreamerCtorFn(nullptr), NullStreamerCtorFn(nullptr),
> - MCRelocationInfoCtorFn(nullptr), MCSymbolizerCtorFn(nullptr) {}
> + : AsmStreamerCtorFn(nullptr), MCRelocationInfoCtorFn(nullptr),
> + MCSymbolizerCtorFn(nullptr) {}
>
> /// @name Target Information
> /// @{
> @@ -454,9 +449,9 @@ namespace llvm {
> }
>
> MCStreamer *createNullStreamer(MCContext &Ctx) const {
> - if (NullStreamerCtorFn)
> - return NullStreamerCtorFn(Ctx);
> - return llvm::createNullStreamer(Ctx);
> + MCStreamer *S = llvm::createNullStreamer(Ctx);
> + createNullTargetStreamer(*S);
> + return S;
> }
>
> MCTargetStreamer *createNullTargetStreamer(MCStreamer &S) const {
> @@ -791,10 +786,6 @@ namespace llvm {
> T.AsmStreamerCtorFn = Fn;
> }
>
> - static void RegisterNullStreamer(Target &T, Target::NullStreamerCtorTy Fn) {
> - T.NullStreamerCtorFn = Fn;
> - }
> -
> static void
> RegisterNullTargetStreamer(Target &T, Target::NullTargetStreamerCtorTy Fn) {
> T.NullTargetStreamerCtorFn = Fn;
>
> Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=229799&r1=229798&r2=229799&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Wed Feb 18 18:45:07 2015
> @@ -1354,12 +1354,6 @@ MCStreamer *createMCAsmStreamer(MCContex
> return S;
> }
>
> -MCStreamer *createARMNullStreamer(MCContext &Ctx) {
> - MCStreamer *S = llvm::createNullStreamer(Ctx);
> - new ARMTargetStreamer(*S);
> - return S;
> -}
> -
> MCTargetStreamer *createARMNullTargetStreamer(MCStreamer &S) {
> return new ARMTargetStreamer(S);
> }
>
> Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=229799&r1=229798&r2=229799&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp Wed Feb 18 18:45:07 2015
> @@ -455,12 +455,6 @@ extern "C" void LLVMInitializeARMTargetM
> TargetRegistry::RegisterAsmStreamer(TheThumbLETarget, createMCAsmStreamer);
> TargetRegistry::RegisterAsmStreamer(TheThumbBETarget, createMCAsmStreamer);
>
> - // Register the null streamer.
> - TargetRegistry::RegisterNullStreamer(TheARMLETarget, createARMNullStreamer);
> - TargetRegistry::RegisterNullStreamer(TheARMBETarget, createARMNullStreamer);
> - TargetRegistry::RegisterNullStreamer(TheThumbLETarget, createARMNullStreamer);
> - TargetRegistry::RegisterNullStreamer(TheThumbBETarget, createARMNullStreamer);
> -
> // Register the null TargetStreamer.
> TargetRegistry::RegisterNullTargetStreamer(TheARMLETarget,
> createARMNullTargetStreamer);
>
> Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h?rev=229799&r1=229798&r2=229799&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h (original)
> +++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h Wed Feb 18 18:45:07 2015
> @@ -52,8 +52,6 @@ MCStreamer *createMCAsmStreamer(MCContex
> MCInstPrinter *InstPrint, MCCodeEmitter *CE,
> MCAsmBackend *TAB, bool ShowInst);
>
> -MCStreamer *createARMNullStreamer(MCContext &Ctx);
> -
> MCTargetStreamer *createARMNullTargetStreamer(MCStreamer &S);
>
> MCCodeEmitter *createARMLEMCCodeEmitter(const MCInstrInfo &MCII,
>
> Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp?rev=229799&r1=229798&r2=229799&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp Wed Feb 18 18:45:07 2015
> @@ -130,10 +130,8 @@ createMCAsmStreamer(MCContext &Ctx, form
> return S;
> }
>
> -static MCStreamer *createMipsNullStreamer(MCContext &Ctx) {
> - MCStreamer *S = llvm::createNullStreamer(Ctx);
> - new MipsTargetStreamer(*S);
> - return S;
> +static MCTargetStreamer *createMipsNullTargetStreamer(MCStreamer &S) {
> + return new MipsTargetStreamer(S);
> }
>
> extern "C" void LLVMInitializeMipsTargetMC() {
> @@ -190,11 +188,14 @@ extern "C" void LLVMInitializeMipsTarget
> TargetRegistry::RegisterAsmStreamer(TheMips64Target, createMCAsmStreamer);
> TargetRegistry::RegisterAsmStreamer(TheMips64elTarget, createMCAsmStreamer);
>
> - TargetRegistry::RegisterNullStreamer(TheMipsTarget, createMipsNullStreamer);
> - TargetRegistry::RegisterNullStreamer(TheMipselTarget, createMipsNullStreamer);
> - TargetRegistry::RegisterNullStreamer(TheMips64Target, createMipsNullStreamer);
> - TargetRegistry::RegisterNullStreamer(TheMips64elTarget,
> - createMipsNullStreamer);
> + TargetRegistry::RegisterNullTargetStreamer(TheMipsTarget,
> + createMipsNullTargetStreamer);
> + TargetRegistry::RegisterNullTargetStreamer(TheMipselTarget,
> + createMipsNullTargetStreamer);
> + TargetRegistry::RegisterNullTargetStreamer(TheMips64Target,
> + createMipsNullTargetStreamer);
> + TargetRegistry::RegisterNullTargetStreamer(TheMips64elTarget,
> + createMipsNullTargetStreamer);
>
> // Register the asm backend.
> TargetRegistry::RegisterMCAsmBackend(TheMipsTarget,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list