mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-14 22:38:03 +00:00
unique_ptrify LoadedObjectInfo::clone
As noted in the original review, this is unused in tree & is used by Julia... that's problematic. This API coudl easily be deleted/modified by accident without any validation that it remains correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a89d43a2ce
commit
fcf7993d4a
@ -22,6 +22,7 @@
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@ -165,11 +166,7 @@ public:
|
||||
virtual bool getLoadedSectionContents(StringRef Name, StringRef &Data) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// 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;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "JITSymbolFlags.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/Support/Memory.h"
|
||||
#include "llvm/DebugInfo/DIContext.h"
|
||||
#include <memory>
|
||||
@ -80,8 +81,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));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user