llvm.org GIT mirror llvm / 07b637e
[Orc] Removing traces of takeOwnershipOfBuffers left after r251560. Patch by Joshua Gerrard. Thanks Joshua! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254919 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 3 years ago
3 changed file(s) with 0 addition(s) and 47 deletion(s). Raw diff Collapse all Expand all
8686 BaseLayer.mapSectionAddress(H, LocalAddress, TargetAddr);
8787 }
8888
89 // Ownership hack.
90 // FIXME: Remove this as soon as RuntimeDyldELF can apply relocations without
91 // referencing the original object.
92 template
93 void takeOwnershipOfBuffers(ObjSetHandleT H, OwningMBSet MBs) {
94 BaseLayer.takeOwnershipOfBuffers(H, std::move(MBs));
95 }
96
9789 /// @brief Access the transform functor directly.
9890 TransformFtor &getTransform() { return Transform; }
9991
387387 doPreallocation(MemMgr);
388388 RuntimeDyld Dyld(MemMgr, MemMgr);
389389
390 // FIXME: Preserve buffers until resolveRelocations time to work around a bug
391 // in RuntimeDyldELF.
392 // This fixme should be fixed ASAP. This is a very brittle workaround.
393 std::vector> InputBuffers;
394
395390 // If we don't have any input files, read from stdin.
396391 if (!InputFileList.size())
397392 InputFileList.push_back("-");
408403 return Error("unable to create object file: '" + EC.message() + "'");
409404
410405 ObjectFile &Obj = **MaybeObj;
411 InputBuffers.push_back(std::move(*InputBuffer));
412406
413407 // Load the object file
414408 Dyld.loadObject(Obj);
655649 RuntimeDyldChecker Checker(Dyld, Disassembler.get(), InstPrinter.get(),
656650 llvm::dbgs());
657651
658 // FIXME: Preserve buffers until resolveRelocations time to work around a bug
659 // in RuntimeDyldELF.
660 // This fixme should be fixed ASAP. This is a very brittle workaround.
661 std::vector> InputBuffers;
662
663652 // If we don't have any input files, read from stdin.
664653 if (!InputFileList.size())
665654 InputFileList.push_back("-");
678667 return Error("unable to create object file: '" + EC.message() + "'");
679668
680669 ObjectFile &Obj = **MaybeObj;
681 InputBuffers.push_back(std::move(*InputBuffer));
682670
683671 // Load the object file
684672 Dyld.loadObject(Obj);
156156 resetExpectations();
157157 }
158158
159 template
160 void takeOwnershipOfBuffers(ObjSetHandleT H, OwningMBSet MBs) {
161 EXPECT_EQ(MockObjSetHandle, H);
162 EXPECT_EQ(MockBufferSet, *MBs);
163 LastCalled = "takeOwnershipOfBuffers";
164 }
165 void expectTakeOwnershipOfBuffers(ObjSetHandleT H, MockMemoryBufferSet *MBs) {
166 MockObjSetHandle = H;
167 MockBufferSet = *MBs;
168 }
169 void verifyTakeOwnershipOfBuffers() {
170 EXPECT_EQ("takeOwnershipOfBuffers", LastCalled);
171 resetExpectations();
172 }
173
174159 private:
175160 // Backing fields for remembering parameter/return values
176161 std::string LastCalled;
274259 T1.mapSectionAddress(H, Buffer, MockAddress);
275260 M.verifyMapSectionAddress();
276261
277 // Test takeOwnershipOfBuffers, using unique pointer to buffer set
278 auto MockBufferSetPtr = llvm::make_unique(366);
279 M.expectTakeOwnershipOfBuffers(H, MockBufferSetPtr.get());
280 T2.takeOwnershipOfBuffers(H, std::move(MockBufferSetPtr));
281 M.verifyTakeOwnershipOfBuffers();
282
283 // Test takeOwnershipOfBuffers, using naked pointer to buffer set
284 MockMemoryBufferSet MockBufferSet = 266;
285 M.expectTakeOwnershipOfBuffers(H, &MockBufferSet);
286 T1.takeOwnershipOfBuffers(H, &MockBufferSet);
287 M.verifyTakeOwnershipOfBuffers();
288
289262 // Verify transform getter (non-const)
290263 MockObjectFile Mutatee = 277;
291264 MockObjectFile *Out = T2.getTransform()(&Mutatee);