[llvm] r239091 - Re-unique_ptrify LoadedObjectInfo::clone after it was reverted due to some other changes that broke on GCC around the same time
David Blaikie
dblaikie at gmail.com
Thu Jun 4 13:54:32 PDT 2015
Author: dblaikie
Date: Thu Jun 4 15:54:32 2015
New Revision: 239091
URL: http://llvm.org/viewvc/llvm-project?rev=239091&view=rev
Log:
Re-unique_ptrify LoadedObjectInfo::clone after it was reverted due to some other changes that broke on GCC around the same time
Apparently this functionality isn't used in-tree (or I would go & make
the explicit unique_ptr constructions into implicit constructions to
make them more self documenting now that clone doesn't return a raw
owning pointer anymore) but only by the Julia frontend. This isn't
ideal.
Modified:
llvm/trunk/include/llvm/DebugInfo/DIContext.h
llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h
Modified: llvm/trunk/include/llvm/DebugInfo/DIContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DIContext.h?rev=239091&r1=239090&r2=239091&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DIContext.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DIContext.h Thu Jun 4 15:54:32 2015
@@ -169,7 +169,7 @@ public:
/// Obtain a copy of this LoadedObjectInfo.
///
/// The caller is responsible for deallocation once the copy is no longer required.
- virtual LoadedObjectInfo *clone() const = 0;
+ virtual std::unique_ptr<LoadedObjectInfo> clone() const = 0;
};
}
Modified: llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h?rev=239091&r1=239090&r2=239091&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h Thu Jun 4 15:54:32 2015
@@ -15,6 +15,7 @@
#define LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
#include "JITSymbolFlags.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Memory.h"
#include "llvm/DebugInfo/DIContext.h"
@@ -78,8 +79,8 @@ public:
LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, unsigned BeginIdx,
unsigned EndIdx)
: LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {}
- llvm::LoadedObjectInfo *clone() const override {
- return new Derived(static_cast<const Derived &>(*this));
+ std::unique_ptr<llvm::LoadedObjectInfo> clone() const override {
+ return llvm::make_unique<Derived>(static_cast<const Derived &>(*this));
}
};
More information about the llvm-commits
mailing list