mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
[Object] Modify OwningBinary's interface to separate inspection from ownership.
The getBinary and getBuffer method now return ordinary pointers of appropriate const-ness. Ownership is transferred by calling takeBinary(), which returns a pair of the Binary and a MemoryBuffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -109,8 +109,11 @@ void MCJIT::addObjectFile(std::unique_ptr<object::ObjectFile> Obj) {
|
||||
}
|
||||
|
||||
void MCJIT::addObjectFile(object::OwningBinary<object::ObjectFile> Obj) {
|
||||
addObjectFile(std::move(Obj.getBinary()));
|
||||
Buffers.push_back(std::move(Obj.getBuffer()));
|
||||
std::unique_ptr<object::ObjectFile> ObjFile;
|
||||
std::unique_ptr<MemoryBuffer> MemBuf;
|
||||
std::tie(ObjFile, MemBuf) = Obj.takeBinary();
|
||||
addObjectFile(std::move(ObjFile));
|
||||
Buffers.push_back(std::move(MemBuf));
|
||||
}
|
||||
|
||||
void MCJIT::addArchive(object::OwningBinary<object::Archive> A) {
|
||||
@ -290,7 +293,7 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name,
|
||||
return Addr;
|
||||
|
||||
for (object::OwningBinary<object::Archive> &OB : Archives) {
|
||||
object::Archive *A = OB.getBinary().get();
|
||||
object::Archive *A = OB.getBinary();
|
||||
// Look for our symbols in each Archive
|
||||
object::Archive::child_iterator ChildIt = A->findSym(Name);
|
||||
if (ChildIt != A->child_end()) {
|
||||
|
Reference in New Issue
Block a user