aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-04-14Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini1-15/+9
At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
2016-03-03[RuntimeDyld] Fix '_' stripping in ↵Lang Hames1-19/+7
RTDyldMemoryManager::getSymbolAddressInProcess. The RTDyldMemoryManager::getSymbolAddressInProcess method accepts a linker-mangled symbol name, but it calls through to dlsym to do the lookup (via DynamicLibrary::SearchForAddressOfSymbol), and dlsym expects an unmangled symbol name. Historically we've attempted to "demangle" by removing leading '_'s on all platforms, and fallen back to an extra search if that failed. That's broken, as it can cause symbols to resolve incorrectly on platforms that don't do mangling if you query '_foo' and the process also happens to contain a 'foo'. Fix this by demangling conditionally based on the host platform. That's safe here because this function is specifically for symbols in the host process, so the usual cross-process JIT looking concerns don't apply. M unittests/ExecutionEngine/ExecutionEngineTest.cpp M lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp llvm-svn: 262657
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko1-1/+1
The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
2015-03-31[ExecutionEngine] Fix MCJIT::addGlobalMapping.Lang Hames1-0/+1
This patch fixes MCJIT::addGlobalMapping by changing the implementation of the ExecutionEngineState class. The new implementation maintains a bidirectional mapping between symbol names (std::strings) and addresses (uint64_ts), rather than a mapping between Value*s and void*s. This has fix has been made for backwards compatibility, however the strongly preferred way to resolve unknown symbols is by writing a custom RuntimeDyld::SymbolResolver (formerly RTDyldMemoryManager) and overriding the findSymbol method. The addGlobalMapping method is a hangover from the legacy JIT (which has was removed in 3.6), and may be deprecated in a future release as part of a clean-up of the ExecutionEngine interface. Patch by Murat Bolat. Thanks Murat! llvm-svn: 233747
2015-03-01Add missing includes. make_unique proliferated everywhere.Benjamin Kramer1-0/+1
llvm-svn: 230909
2014-10-01[MCJIT] Turn the getSymbolAddress free function created in r218626 into a staticLang Hames1-3/+6
member of RTDyldMemoryManager (and rename to getSymbolAddressInProcess). The functionality this provides is very specific to RTDyldMemoryManager, so it makes sense to keep it in that class to avoid accidental re-use. No functional change. llvm-svn: 218741
2014-09-29Unit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior ↵David Blaikie1-0/+30
favor mangled lookup over unmangled lookup. The contract of this function seems problematic (fallback in either direction seems like it could produce bugs in one client or another), but here's some tests for its current behavior, at least. See the commit/review thread of r218187 for more discussion. llvm-svn: 218626
2014-09-23Rework r218304, "ExecutionEngineTests: Call llvm_shutdown() on exit for ↵NAKAMURA Takumi1-2/+3
ManagedStatic introduced in r218151." r218304 caused crash on msvc builder. llvm-svn: 218308
2014-09-23ExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic ↵NAKAMURA Takumi1-0/+3
introduced in r218151. llvm-svn: 218304
2014-08-19Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola1-5/+6
llvm-svn: 215967
2014-06-08[C++11] Use 'nullptr'.Craig Topper1-11/+11
llvm-svn: 210442
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-2/+1
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth1-4/+4
into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
2012-12-04Sort the #include lines for unittest/...Chandler Carruth1-2/+2
llvm-svn: 169250
2011-12-02unittests: add ErrorStr to ExecutionEngine testDylan Noblesmith1-3/+5
Makes failures more self-explanatory. llvm-svn: 145704
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner1-1/+1
llvm-svn: 135375
2009-10-13Make the ExecutionEngine automatically remove global mappings on when theirJeffrey Yasskin1-0/+13
GlobalValue is destroyed. Function destruction still leaks machine code and can crash on leaked stubs, but this is some progress. llvm-svn: 83987
2009-10-09ExecutionEngine::clearGlobalMappingsFromModule failed to remove reverseJeffrey Yasskin1-0/+20
mappings, which could cause errors and assert-failures. This patch fixes that, adds a test, and refactors the global-mapping-removal code into a single place. llvm-svn: 83678
2009-08-13Push LLVMContexts through the IntegerType APIs.Owen Anderson1-4/+8
llvm-svn: 78948
2009-08-04Make ExecutionEngine::updateGlobalMapping(GV, NULL) properly remove GV's oldJeffrey Yasskin1-0/+92
address from the reverse mapping, and add a test that this works now. llvm-svn: 78127