Deleted Added
full compact
llvm-objdump.cpp (218885) llvm-objdump.cpp (221337)
1//===-- llvm-objdump.cpp - Object file dumping utility for llvm -----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 24 unchanged lines hidden (view full) ---

33#include "llvm/Support/ManagedStatic.h"
34#include "llvm/Support/MemoryBuffer.h"
35#include "llvm/Support/MemoryObject.h"
36#include "llvm/Support/PrettyStackTrace.h"
37#include "llvm/Support/Signals.h"
38#include "llvm/Support/SourceMgr.h"
39#include "llvm/Support/raw_ostream.h"
40#include "llvm/Support/system_error.h"
1//===-- llvm-objdump.cpp - Object file dumping utility for llvm -----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 24 unchanged lines hidden (view full) ---

33#include "llvm/Support/ManagedStatic.h"
34#include "llvm/Support/MemoryBuffer.h"
35#include "llvm/Support/MemoryObject.h"
36#include "llvm/Support/PrettyStackTrace.h"
37#include "llvm/Support/Signals.h"
38#include "llvm/Support/SourceMgr.h"
39#include "llvm/Support/raw_ostream.h"
40#include "llvm/Support/system_error.h"
41#include "llvm/Target/TargetMachine.h"
41#include "llvm/Target/TargetRegistry.h"
42#include "llvm/Target/TargetSelect.h"
43#include <algorithm>
44#include <cctype>
45#include <cerrno>
46#include <cstring>
42#include "llvm/Target/TargetRegistry.h"
43#include "llvm/Target/TargetSelect.h"
44#include <algorithm>
45#include <cctype>
46#include <cerrno>
47#include <cstring>
47#include <vector>
48using namespace llvm;
49using namespace object;
50
51namespace {
52 cl::list<std::string>
53 InputFilenames(cl::Positional, cl::desc("<input object files>"),
54 cl::ZeroOrMore);
55

--- 121 unchanged lines hidden (view full) ---

177 }
178
179 OwningPtr<const MCDisassembler> DisAsm(TheTarget->createMCDisassembler());
180 if (!DisAsm) {
181 errs() << "error: no disassembler for target " << TripleName << "\n";
182 return;
183 }
184
48using namespace llvm;
49using namespace object;
50
51namespace {
52 cl::list<std::string>
53 InputFilenames(cl::Positional, cl::desc("<input object files>"),
54 cl::ZeroOrMore);
55

--- 121 unchanged lines hidden (view full) ---

177 }
178
179 OwningPtr<const MCDisassembler> DisAsm(TheTarget->createMCDisassembler());
180 if (!DisAsm) {
181 errs() << "error: no disassembler for target " << TripleName << "\n";
182 return;
183 }
184
185 // FIXME: We shouldn't need to do this (and link in codegen).
186 // When we split this out, we should do it in a way that makes
187 // it straightforward to switch subtargets on the fly (.e.g,
188 // the .cpu and .code16 directives).
189 std::string FeaturesStr;
190 OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName,
191 FeaturesStr));
192 if (!TM) {
193 errs() << "error: could not create target for triple " << TripleName << "\n";
194 return;
195 }
196
185 int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
186 OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
197 int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
198 OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
187 AsmPrinterVariant, *AsmInfo));
199 *TM, AsmPrinterVariant, *AsmInfo));
188 if (!IP) {
189 errs() << "error: no instruction printer for target " << TripleName << '\n';
190 return;
191 }
192
193 StringRef Bytes = i->getContents();
194 StringRefMemoryObject memoryObject(Bytes);
195 uint64_t Size;

--- 60 unchanged lines hidden ---
200 if (!IP) {
201 errs() << "error: no instruction printer for target " << TripleName << '\n';
202 return;
203 }
204
205 StringRef Bytes = i->getContents();
206 StringRefMemoryObject memoryObject(Bytes);
207 uint64_t Size;

--- 60 unchanged lines hidden ---