From ce7d2f59b432083ea9047bb8cd040d8916c4d5f7 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 19 Jul 2017 23:34:59 +0000 Subject: [PATCH] Remove some leftover DWARFContextInMemory. Not sure how I missed these on the previous commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308550 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/DWARF/DWARFContext.cpp | 14 -------------- .../IntelJITEvents/IntelJITEventListener.cpp | 2 +- .../fuzzer/llvm-dwarfdump-fuzzer.cpp | 2 +- unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | 3 +-- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/lib/DebugInfo/DWARF/DWARFContext.cpp b/lib/DebugInfo/DWARF/DWARFContext.cpp index c91bd27c91a..a117a99e0e4 100644 --- a/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -783,20 +783,6 @@ DWARFContext::getInliningInfoForAddress(uint64_t Address, return InliningInfo; } -/// DWARFContextInMemory is the simplest possible implementation of a -/// DWARFContext. It assumes all content is available in memory and stores -/// pointers to it. -class DWARFContextInMemory : public DWARFContext { -public: - DWARFContextInMemory( - const object::ObjectFile &Obj, const LoadedObjectInfo *L = nullptr, - function_ref HandleError = defaultErrorHandler); - - DWARFContextInMemory(const StringMap> &Sections, - uint8_t AddrSize, - bool isLittleEndian = sys::IsLittleEndianHost); -}; - std::shared_ptr DWARFContext::getDWOContext(StringRef AbsolutePath) { if (auto S = DWP.lock()) { diff --git a/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp b/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp index a7b1fe206f1..cb6dd5e5728 100644 --- a/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp +++ b/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp @@ -104,7 +104,7 @@ void IntelJITEventListener::NotifyObjectEmitted( // Get the address of the object image for use as a unique identifier const void* ObjData = DebugObj.getData().data(); - DIContext* Context = new DWARFContextInMemory(DebugObj); + std::unique_ptr Context = DWARFContext::create(DebugObj); MethodAddressVector Functions; // Use symbol info to iterate functions in the object. diff --git a/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp b/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp index 32e173f9d1f..12ed77f6da6 100644 --- a/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp +++ b/tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp @@ -31,6 +31,6 @@ extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { return; } ObjectFile &Obj = *ObjOrErr.get(); - std::unique_ptr DICtx(new DWARFContextInMemory(Obj)); + std::unique_ptr DICtx = DWARFContext::create(Obj); DICtx->dump(nulls(), DIDT_All); } diff --git a/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp index 0bb5cebe9c8..1a81d5543b8 100644 --- a/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp +++ b/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp @@ -2169,8 +2169,7 @@ TEST(DWARFDebugInfo, TestErrorReportingPolicy) { EXPECT_TRUE((bool)Obj); // Case 1: error handler handles all errors. That allows - // DWARFContextInMemory - // to parse whole file and find both two errors we know about. + // DWARFContext to parse whole file and find both two errors we know about. int Errors = 0; std::unique_ptr Ctx1 = DWARFContext::create(**Obj, nullptr, [&](Error E) { -- 2.50.1