From c398e67fedaf2d0bdd7e1ad39e52e5200cecd577 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 19 Jul 2017 22:27:28 +0000 Subject: 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 --- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/tools/llvm-dwarfdump') 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 DICtx(new DWARFContextInMemory(Obj)); + std::unique_ptr 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 DICtx(new DWARFContextInMemory(Obj)); - + std::unique_ptr DICtx = DWARFContext::create(Obj); + // Verify the DWARF and exit with non-zero exit status if verification // fails. raw_ostream &stream = Quiet ? nulls() : outs(); -- cgit v1.2.3