[llvm] fbd00dd - [llvm-mc] Remove unused argument (NFC)
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 21:09:09 PDT 2023
Author: Jonas Devlieghere
Date: 2023-08-31T21:08:53-07:00
New Revision: fbd00dd1112868db9ed0f15b170082c4592be7e3
URL: https://github.com/llvm/llvm-project/commit/fbd00dd1112868db9ed0f15b170082c4592be7e3
DIFF: https://github.com/llvm/llvm-project/commit/fbd00dd1112868db9ed0f15b170082c4592be7e3.diff
LOG: [llvm-mc] Remove unused argument (NFC)
The disassembler prints to the formatted_raw_ostream passed to
createAsmStreamer. The Out stream argument is unused.
Added:
Modified:
llvm/tools/llvm-mc/Disassembler.cpp
llvm/tools/llvm-mc/Disassembler.h
llvm/tools/llvm-mc/llvm-mc.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-mc/Disassembler.cpp b/llvm/tools/llvm-mc/Disassembler.cpp
index 7456a2f2c9157a..a588058437ec9a 100644
--- a/llvm/tools/llvm-mc/Disassembler.cpp
+++ b/llvm/tools/llvm-mc/Disassembler.cpp
@@ -31,10 +31,8 @@ using namespace llvm;
typedef std::pair<std::vector<unsigned char>, std::vector<const char *>>
ByteArrayTy;
-static bool PrintInsts(const MCDisassembler &DisAsm,
- const ByteArrayTy &Bytes,
- SourceMgr &SM, raw_ostream &Out,
- MCStreamer &Streamer, bool InAtomicBlock,
+static bool PrintInsts(const MCDisassembler &DisAsm, const ByteArrayTy &Bytes,
+ SourceMgr &SM, MCStreamer &Streamer, bool InAtomicBlock,
const MCSubtargetInfo &STI) {
ArrayRef<uint8_t> Data(Bytes.first.data(), Bytes.first.size());
@@ -132,7 +130,7 @@ static bool ByteArrayFromString(ByteArrayTy &ByteArray,
int Disassembler::disassemble(const Target &T, const std::string &Triple,
MCSubtargetInfo &STI, MCStreamer &Streamer,
MemoryBuffer &Buffer, SourceMgr &SM,
- MCContext &Ctx, raw_ostream &Out,
+ MCContext &Ctx,
const MCTargetOptions &MCOptions) {
std::unique_ptr<const MCRegisterInfo> MRI(T.createMCRegInfo(Triple));
@@ -193,8 +191,8 @@ int Disassembler::disassemble(const Target &T, const std::string &Triple,
ErrorOccurred |= ByteArrayFromString(ByteArray, Str, SM);
if (!ByteArray.first.empty())
- ErrorOccurred |= PrintInsts(*DisAsm, ByteArray, SM, Out, Streamer,
- InAtomicBlock, STI);
+ ErrorOccurred |=
+ PrintInsts(*DisAsm, ByteArray, SM, Streamer, InAtomicBlock, STI);
}
if (InAtomicBlock) {
diff --git a/llvm/tools/llvm-mc/Disassembler.h b/llvm/tools/llvm-mc/Disassembler.h
index a1603e58498087..d0226abadc630a 100644
--- a/llvm/tools/llvm-mc/Disassembler.h
+++ b/llvm/tools/llvm-mc/Disassembler.h
@@ -32,7 +32,7 @@ class Disassembler {
static int disassemble(const Target &T, const std::string &Triple,
MCSubtargetInfo &STI, MCStreamer &Streamer,
MemoryBuffer &Buffer, SourceMgr &SM, MCContext &Ctx,
- raw_ostream &Out, const MCTargetOptions &MCOptions);
+ const MCTargetOptions &MCOptions);
};
} // namespace llvm
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index 572723afb79e71..deca358af56229 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -596,7 +596,7 @@ int main(int argc, char **argv) {
}
if (disassemble)
Res = Disassembler::disassemble(*TheTarget, TripleName, *STI, *Str, *Buffer,
- SrcMgr, Ctx, Out->os(), MCOptions);
+ SrcMgr, Ctx, MCOptions);
// Keep output if no errors.
if (Res == 0) {
More information about the llvm-commits
mailing list