summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-07-19 22:27:28 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-07-19 22:27:28 +0000
commitc398e67fedaf2d0bdd7e1ad39e52e5200cecd577 (patch)
treefa77355e93d01080ffd34cc23a8d7c39c7e584b4 /llvm/tools/llvm-objdump
parent967d4aa7a0a1da8b5a18a0a9a65af1b79e205041 (diff)
downloadbcm5719-llvm-c398e67fedaf2d0bdd7e1ad39e52e5200cecd577.tar.gz
bcm5719-llvm-c398e67fedaf2d0bdd7e1ad39e52e5200cecd577.zip
Use delegation instead of inheritance.
This changes DwarfContext to delegate to DwarfObject instead of having pure virtual methods. With this DwarfContextInMemory is replaced with an implementation of DwarfObject that is local to a .cpp file. llvm-svn: 308543
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp4
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 05c2c3f7c4c..3bab94d681a 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -1275,7 +1275,7 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
printWeakBindTable(MachOOF);
if (DwarfDumpType != DIDT_Null) {
- std::unique_ptr<DIContext> DICtx(new DWARFContextInMemory(*MachOOF));
+ std::unique_ptr<DIContext> DICtx = DWARFContext::create(*MachOOF);
// Dump the complete DWARF structure.
DIDumpOptions DumpOpts;
DumpOpts.DumpType = DwarfDumpType;
@@ -6594,7 +6594,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
}
// Setup the DIContext
- diContext.reset(new DWARFContextInMemory(*DbgObj));
+ diContext = DWARFContext::create(*DbgObj);
}
if (FilterSections.size() == 0)
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index d54b45515f0..c772204a8ed 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -62,8 +62,8 @@
#include <cctype>
#include <cstring>
#include <system_error>
-#include <utility>
#include <unordered_map>
+#include <utility>
using namespace llvm;
using namespace object;
@@ -2081,7 +2081,7 @@ static void DumpObject(ObjectFile *o, const Archive *a = nullptr) {
if (PrintFaultMaps)
printFaultMaps(o);
if (DwarfDumpType != DIDT_Null) {
- std::unique_ptr<DIContext> DICtx(new DWARFContextInMemory(*o));
+ std::unique_ptr<DIContext> DICtx = DWARFContext::create(*o);
// Dump the complete DWARF structure.
DIDumpOptions DumpOpts;
DumpOpts.DumpType = DwarfDumpType;
OpenPOWER on IntegriCloud