summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
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-dwarfdump/llvm-dwarfdump.cpp
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-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index ec5e554d4f5..62235af31cd 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -94,7 +94,7 @@ static void error(StringRef Filename, std::error_code EC) {
}
static void DumpObjectFile(ObjectFile &Obj, Twine Filename) {
- std::unique_ptr<DIContext> DICtx(new DWARFContextInMemory(Obj));
+ std::unique_ptr<DIContext> DICtx = DWARFContext::create(Obj);
outs() << Filename.str() << ":\tfile format " << Obj.getFileFormatName()
<< "\n\n";
@@ -131,8 +131,8 @@ static void DumpInput(StringRef Filename) {
}
static bool VerifyObjectFile(ObjectFile &Obj, Twine Filename) {
- std::unique_ptr<DIContext> DICtx(new DWARFContextInMemory(Obj));
-
+ std::unique_ptr<DIContext> DICtx = DWARFContext::create(Obj);
+
// Verify the DWARF and exit with non-zero exit status if verification
// fails.
raw_ostream &stream = Quiet ? nulls() : outs();
OpenPOWER on IntegriCloud