summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ORC] Errorize the ORC APIs.Lang Hames2017-07-071-19/+27
| | | | | | | | This patch updates the ORC layers and utilities to return and propagate llvm::Errors where appropriate. This is necessary to allow ORC to safely handle error cases in cross-process and remote JITing. llvm-svn: 307350
* [Orc] Remove the memory manager argument to addModule, and de-templatize theLang Hames2017-07-041-34/+25
| | | | | | | | | | | | | | | | symbol resolver argument. De-templatizing the symbol resolver is part of the ongoing simplification of ORC layer API. Removing the memory management argument (and delegating construction of memory managers for RTDyldObjectLinkingLayer to a functor passed in to the constructor) allows us to build JITs whose base object layers need not be compatible with RTDyldObjectLinkingLayer's memory mangement scheme. For example, a 'remote object layer' that sends fully relocatable objects directly to the remote does not need a memory management scheme at all (that will be handled by the remote). llvm-svn: 307058
* [ORC] Re-apply r306166 and r306168 with fix for regression test.Lang Hames2017-06-231-1/+1
| | | | llvm-svn: 306182
* This reverts commit r306166 and r306168.Rafael Espindola2017-06-231-1/+1
| | | | | | | | | Revert "[ORC] Remove redundant semicolons from DEFINE_SIMPLE_CONVERSION_FUNCTIONS uses." Revert "[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the module type as std::shared_ptr<Module>." They broke ExecutionEngine/OrcMCJIT/test-global-ctors.ll on linux. llvm-svn: 306176
* [ORC] Move ORC IR layer interface from addModuleSet to addModule and fix theLang Hames2017-06-231-1/+1
| | | | | | module type as std::shared_ptr<Module>. llvm-svn: 306166
* [ORC] Switch the object layer API from addObjectSet to addObject (singular), andLang Hames2017-06-221-93/+82
| | | | | | | | | move the ObjectCache from the IRCompileLayer to SimpleCompiler. This is the first in a series of patches aimed at cleaning up and improving the robustness and performance of the ORC APIs. llvm-svn: 306058
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EHLang Hames2017-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frames. RuntimeDyld was previously responsible for tracking allocated EH frames, but it makes more sense to have the RuntimeDyld::MemoryManager track them (since the frames are allocated through the memory manager, and written to memory owned by the memory manager). This patch moves the frame tracking into RTDyldMemoryManager, and changes the deregisterFrames method on RuntimeDyld::MemoryManager from: void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size); to: void deregisterEHFrames(); Separating this responsibility will allow ORC to continue to throw the RuntimeDyld instances away post-link (saving a few dozen bytes per lazy function) while properly deregistering frames when modules are unloaded. This patch also updates ORC to call deregisterEHFrames when modules are unloaded. This fixes a bug where an exception that tears down the JIT can then unwind through dangling EH frames that have been deallocated but not deregistered, resulting in UB. For people using SectionMemoryManager this should be pretty much a no-op. For people with custom allocators that override registerEHFrames/deregisterEHFrames, you will now be responsible for tracking allocated EH frames. Reviewed in https://reviews.llvm.org/D32829 llvm-svn: 302589
* [Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer.Lang Hames2017-02-201-2/+2
| | | | | | | | | | The current ObjectLinkingLayer (now RTDyldObjectLinkingLayer) links objects in-process using MCJIT's RuntimeDyld class. In the near future I hope to add new object linking layers (e.g. a remote linking layer that links objects in the JIT target process, rather than the client), so I'm renaming this class to be more descriptive. llvm-svn: 295636
* [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.Lang Hames2016-08-011-14/+15
| | | | | | | | | | | | | | | | This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class that is capable of lazy materialization (i.e. the symbol definition needn't be emitted until the address is requested). This can be used to support common and weak symbols in the JIT (though this is not implemented in this patch). For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver. For space efficiency a new class, JITEvaluatedSymbol, is introduced that behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an address and symbol flags. Instances of JITEvaluatedSymbol can be used in symbol-tables to avoid paying the space cost of the materializer. llvm-svn: 277386
* Fix warning in ObjectTransformLayerTest.Justin Lebar2016-07-131-1/+2
| | | | | | | | | | | | | | Doing "I++" inside of an EXPECT_* triggers warning: expression with side effects has no effect in an unevaluated context because EXPECT_* partially expands to EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(MockObjects[I++] + 1)) == 1)> which is an unevaluated context. llvm-svn: 275293
* [Unittest] Clean up formatting, NFCJoseph Tremoulet2016-02-031-55/+54
| | | | | | | | | | | | | | Summary: Use an early return to reduce indentation. Remove unused local. Reviewers: dblaikie, lhames Subscribers: lhames, llvm-commits Differential Revision: http://reviews.llvm.org/D16513 llvm-svn: 259663
* ObjectTransformLayerTest.cpp: Rework r258633. [-Winconsistent-missing-override]NAKAMURA Takumi2016-01-231-1/+1
| | | | | | Sorry for the noise. llvm-svn: 258635
* ObjectTransformLayerTest.cpp: Fix a warning. [-Wredundant-move]NAKAMURA Takumi2016-01-231-1/+1
| | | | llvm-svn: 258634
* ObjectTransformLayerTest.cpp: Fix a warning. [-Winconsistent-missing-override]NAKAMURA Takumi2016-01-231-1/+1
| | | | llvm-svn: 258633
* [ORC] Update ObjectTransformLayer signatureJoseph Tremoulet2016-01-231-6/+69
| | | | | | | | | | | | | | | | | | | | Summary: Update ObjectTransformLayer::addObjectSet to take the object set by value rather than reference and pass it to the base layer with move semantics rather than copy, to match r258185's changes to ObjectLinkingLayer. Update the unit test to verify that ObjectTransformLayer's signature stays in sync with ObjectLinkingLayer's. Reviewers: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16414 llvm-svn: 258630
* [Orc] Removing traces of takeOwnershipOfBuffers left after r251560.Lang Hames2015-12-071-27/+0
| | | | | | Patch by Joshua Gerrard. Thanks Joshua! llvm-svn: 254919
* Don't use std::make_unique.Benjamin Kramer2015-06-251-8/+9
| | | | | | | We still have to support C++11 standard libraries, make_unique is a C++14 feature. llvm-svn: 240642
* [ORC] Add ObjectTransformLayerJoseph Tremoulet2015-06-251-0/+301
Summary: This is a utility for clients that want to insert a layer that modifies each ObjectFile and then passes it along to the next layer. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10456 llvm-svn: 240640
OpenPOWER on IntegriCloud