/// to that file format or custom semantics expected by the object writer
/// implementation.
class MCObjectStreamer : public MCStreamer {
- MCAssembler *Assembler;
+ std::unique_ptr<MCAssembler> Assembler;
MCSection::iterator CurInsertionPoint;
bool EmitEHFrame;
bool EmitDebugFrame;
raw_pwrite_stream &OS,
MCCodeEmitter *Emitter_)
: MCStreamer(Context),
- Assembler(new MCAssembler(Context, TAB, *Emitter_,
- *TAB.createObjectWriter(OS))),
+ Assembler(llvm::make_unique<MCAssembler>(Context, TAB, *Emitter_,
+ *TAB.createObjectWriter(OS))),
EmitEHFrame(true), EmitDebugFrame(false) {}
MCObjectStreamer::~MCObjectStreamer() {
delete &Assembler->getBackend();
delete &Assembler->getEmitter();
delete &Assembler->getWriter();
- delete Assembler;
}
void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) {