Skip to content

Commit 51a15d9

Browse files
committed
[RISCV] Simplify createRISCVELFStreamer registration
1 parent 88ff607 commit 51a15d9

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,10 @@ void RISCVELFStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
186186
MCELFStreamer::emitValueImpl(Value, Size, Loc);
187187
}
188188

189-
namespace llvm {
190-
MCELFStreamer *createRISCVELFStreamer(MCContext &C,
191-
std::unique_ptr<MCAsmBackend> MAB,
192-
std::unique_ptr<MCObjectWriter> MOW,
193-
std::unique_ptr<MCCodeEmitter> MCE) {
194-
RISCVELFStreamer *S =
195-
new RISCVELFStreamer(C, std::move(MAB), std::move(MOW), std::move(MCE));
196-
return S;
197-
}
198-
} // namespace llvm
189+
MCStreamer *llvm::createRISCVELFStreamer(const Triple &, MCContext &C,
190+
std::unique_ptr<MCAsmBackend> &&MAB,
191+
std::unique_ptr<MCObjectWriter> &&MOW,
192+
std::unique_ptr<MCCodeEmitter> &&MCE) {
193+
return new RISCVELFStreamer(C, std::move(MAB), std::move(MOW),
194+
std::move(MCE));
195+
}

llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ class RISCVTargetELFStreamer : public RISCVTargetStreamer {
6969
void finish() override;
7070
};
7171

72-
MCELFStreamer *createRISCVELFStreamer(MCContext &C,
73-
std::unique_ptr<MCAsmBackend> MAB,
74-
std::unique_ptr<MCObjectWriter> MOW,
75-
std::unique_ptr<MCCodeEmitter> MCE);
72+
MCStreamer *createRISCVELFStreamer(const Triple &, MCContext &C,
73+
std::unique_ptr<MCAsmBackend> &&MAB,
74+
std::unique_ptr<MCObjectWriter> &&MOW,
75+
std::unique_ptr<MCCodeEmitter> &&MCE);
7676
} // namespace llvm
7777

7878
#endif // LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVELFSTREAMER_H

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,6 @@ static MCInstrAnalysis *createRISCVInstrAnalysis(const MCInstrInfo *Info) {
340340
return new RISCVMCInstrAnalysis(Info);
341341
}
342342

343-
namespace {
344-
MCStreamer *createRISCVELFStreamer(const Triple &T, MCContext &Context,
345-
std::unique_ptr<MCAsmBackend> &&MAB,
346-
std::unique_ptr<MCObjectWriter> &&MOW,
347-
std::unique_ptr<MCCodeEmitter> &&MCE) {
348-
return createRISCVELFStreamer(Context, std::move(MAB), std::move(MOW),
349-
std::move(MCE));
350-
}
351-
} // end anonymous namespace
352-
353343
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVTargetMC() {
354344
for (Target *T : {&getTheRISCV32Target(), &getTheRISCV64Target()}) {
355345
TargetRegistry::RegisterMCAsmInfo(*T, createRISCVMCAsmInfo);

0 commit comments

Comments
 (0)