From 82967c0bcd89c5211d46a3c031e6d535c833988d Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Fri, 22 May 2015 05:33:54 +0000 Subject: [PATCH] Revert "unique_ptrify LoadedObjectInfo::clone" This reverts commit r237976, which seems to break existing gcc 4.7 buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237996 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo/DIContext.h | 7 +++++-- include/llvm/ExecutionEngine/RuntimeDyld.h | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index da1b5e985d8..d8830da56b5 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -22,7 +22,6 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/DataTypes.h" #include -#include namespace llvm { @@ -166,7 +165,11 @@ public: virtual bool getLoadedSectionContents(StringRef Name, StringRef &Data) const { return false; } - virtual std::unique_ptr clone() const = 0; + + /// Obtain a copy of this LoadedObjectInfo. + /// + /// The caller is responsible for deallocation once the copy is no longer required. + virtual LoadedObjectInfo *clone() const = 0; }; } diff --git a/include/llvm/ExecutionEngine/RuntimeDyld.h b/include/llvm/ExecutionEngine/RuntimeDyld.h index b882f133adb..ac0151aa7ec 100644 --- a/include/llvm/ExecutionEngine/RuntimeDyld.h +++ b/include/llvm/ExecutionEngine/RuntimeDyld.h @@ -16,7 +16,6 @@ #include "JITSymbolFlags.h" #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/Support/Memory.h" #include "llvm/DebugInfo/DIContext.h" #include @@ -81,8 +80,8 @@ public: LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, unsigned BeginIdx, unsigned EndIdx) : LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {} - std::unique_ptr clone() const override { - return llvm::make_unique(static_cast(*this)); + llvm::LoadedObjectInfo *clone() const override { + return new Derived(static_cast(*this)); } }; -- 2.34.1