Issue 140495
Summary Dead code in `MCAsmStreamer.cpp`
Labels code-cleanup
Assignees
Reporter abhishek-kaushik22
    In [MCAsmStreamer.cpp](https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCAsmStreamer.cpp#L75-L85)

```
public:
 MCAsmStreamer(MCContext &Context, std::unique_ptr<formatted_raw_ostream> os,
                std::unique_ptr<MCInstPrinter> printer,
 std::unique_ptr<MCCodeEmitter> emitter,
 std::unique_ptr<MCAsmBackend> asmbackend)
      : MCStreamer(Context), OSOwner(std::move(os)), OS(*OSOwner),
        MAI(Context.getAsmInfo()), InstPrinter(std::move(printer)),
 Assembler(std::make_unique<MCAssembler>(
            Context, std::move(asmbackend), std::move(emitter),
            (asmbackend) ? asmbackend->createObjectWriter(NullStream)
                         : nullptr))
```
`asmbackend` is moved making it null, and later null checked making the check redundant.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to