[llvm] [RISCV] Use the MCStreamer reference passed to RISCVAsmPrinter::EmitToStreamer. NFCI (PR #111607)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 16:46:33 PDT 2024


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/111607

We passed a MCStreamer to the function but hardcoded *OutStreamer instead of using it. It's very likely that OutStreamer is the only streamer used, but lets not assume that without doing the audit.

>From 750a669db1cbe958a582e1573610d5f846e75d6f Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Tue, 8 Oct 2024 16:36:48 -0700
Subject: [PATCH] [RISCV] Use the MCStreamer reference passed to
 RISCVAsmPrinter::EmitToStreamer. NFCI

We passed a MCStreamer but hardcoded *OutStreamer. It's very likely
that OutStreamer is the only streamer used, but lets not assume that
without doing the audit.
---
 llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp b/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
index 52d0a70d335e97..3bed8c4349dac0 100644
--- a/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
+++ b/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
@@ -247,7 +247,7 @@ bool RISCVAsmPrinter::EmitToStreamer(MCStreamer &S, const MCInst &Inst) {
   bool Res = RISCVRVC::compress(CInst, Inst, *STI);
   if (Res)
     ++RISCVNumInstrsCompressed;
-  AsmPrinter::EmitToStreamer(*OutStreamer, Res ? CInst : Inst);
+  AsmPrinter::EmitToStreamer(S, Res ? CInst : Inst);
   return Res;
 }
 



More information about the llvm-commits mailing list