diff options
Diffstat (limited to 'tools/llvm-objdump/MachODump.cpp')
-rw-r--r-- | tools/llvm-objdump/MachODump.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 89b038f..3ca582f 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -17,6 +17,7 @@ #include "llvm/ADT/Triple.h" #include "llvm/DebugInfo/DIContext.h" #include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstPrinter.h" @@ -64,7 +65,7 @@ static const Target *GetTarget(const MachOObjectFile *MachOObj) { errs() << "llvm-objdump: error: unable to get target for '" << TripleName << "', see --version and --triple.\n"; - return 0; + return nullptr; } struct SymbolSorter { @@ -225,8 +226,9 @@ static void DisassembleInputMachO2(StringRef Filename, TheTarget->createMCAsmInfo(*MRI, TripleName)); std::unique_ptr<const MCSubtargetInfo> STI( TheTarget->createMCSubtargetInfo(TripleName, "", "")); + MCContext Ctx(AsmInfo.get(), MRI.get(), nullptr); std::unique_ptr<const MCDisassembler> DisAsm( - TheTarget->createMCDisassembler(*STI)); + TheTarget->createMCDisassembler(*STI, Ctx)); int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter( AsmPrinterVariant, *AsmInfo, *InstrInfo, *MRI, *STI)); @@ -419,9 +421,9 @@ static void DisassembleInputMachO2(StringRef Filename, DILineInfo dli = diContext->getLineInfoForAddress(SectAddress + Index); // Print valid line info if it changed. - if (dli != lastLine && dli.getLine() != 0) - outs() << "\t## " << dli.getFileName() << ':' - << dli.getLine() << ':' << dli.getColumn(); + if (dli != lastLine && dli.Line != 0) + outs() << "\t## " << dli.FileName << ':' << dli.Line << ':' + << dli.Column; lastLine = dli; } outs() << "\n"; |