From f72611b4d2ec130886a736fec7558b335e3eb953 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Fri, 17 Aug 2018 04:38:41 +0000 Subject: [PATCH] [llvm-mc-assemble-fuzzer] Update API - Pass MCObjectWriter instead of a stream Fixes build breakage of llvm-mc-assemble-fuzzer introduced by r332749. Fix provided by pbhatu (Pratik Bhatu) llvm-svn: 339981 --- .../llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp index 8aad6ab67423..8731cf60fca8 100644 --- a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -18,6 +18,7 @@ #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCObjectFileInfo.h" +#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCParser/AsmLexer.h" #include "llvm/MC/MCParser/MCTargetAsmParser.h" #include "llvm/MC/MCRegisterInfo.h" @@ -230,9 +231,9 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) { MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( - TheTriple, Ctx, std::unique_ptr(MAB), *OS, - std::unique_ptr(CE), *STI, MCOptions.MCRelaxAll, - MCOptions.MCIncrementalLinkerCompatible, + TheTriple, Ctx, std::unique_ptr(MAB), + MAB->createObjectWriter(*OS), std::unique_ptr(CE), *STI, + MCOptions.MCRelaxAll, MCOptions.MCIncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ false)); } const int Res = AssembleInput(ProgName, TheTarget, SrcMgr, Ctx, *Str, *MAI, *STI,