Commit Graph

2500 Commits

Author SHA1 Message Date
Bertrand Bellenot
694c772e39 Fix crash (assertion failure) on Windows
Late parsed templates (Microsoft specific) can leave unswallowed "macro"-like tokens. They will seriously confuse the Parser when entering the next source file. So lex until we are EOF.
2015-02-13 16:53:13 +01:00
Axel Naumann
3419001b9a Improve "missing symbol" error messages (ROOT-6755). 2015-02-12 18:29:16 +01:00
Axel Naumann
678e3fbe40 Do not remove inlined functions: they might need to be inlined in a subsequent transaction. 2015-02-12 15:53:09 +01:00
Danilo Piparo
4ecc896170 Fix cmake compilation 2015-02-12 10:14:26 +01:00
Axel Naumann
99d8ab07a9 Also symbol lookup needs to remove the leading "_" on MacOS. 2015-02-11 22:05:21 +01:00
Axel Naumann
4bc5c13beb Add backend passes back in. Fixes (some of) MacOS.
Once clang BackendUtils become more relevant for our use case
we should switch to that, instead of simulating its behavior.
2015-02-11 22:05:21 +01:00
Axel Naumann
34c0e373dc Save JIT time. 2015-02-11 22:05:20 +01:00
Axel Naumann
1001c65f99 MacOS adds an extra "_" in front of symbol names. 2015-02-11 11:51:16 +01:00
Axel Naumann
ebacb03d18 Silence warning but keep code - we still need it. 2015-02-11 10:57:48 +01:00
Axel Naumann
080ec79f0d Update CMake to orcjit. 2015-02-11 10:57:48 +01:00
Axel Naumann
1dbd2590e4 Record llvm update. 2015-02-11 10:57:48 +01:00
Axel Naumann
32a244d8df Add OrcJIT. 2015-02-11 10:57:48 +01:00
Axel Naumann
ddaa27fe23 Link against MCJIT. 2015-02-11 10:57:48 +01:00
Axel Naumann
eb75ab36ef Add the transaction to define its lifetime.
This should be migrated to use unique_ptr in the interfaces instead
of relying on comments...
2015-02-11 10:57:48 +01:00
Axel Naumann
9bd2a08dd2 Cache unique_ptr value before move. 2015-02-11 10:57:47 +01:00
Axel Naumann
6fe605a69a Missing initialization. 2015-02-11 10:57:47 +01:00
Axel Naumann
93e44e7273 Use ~Transaction() to unload its JITed symbols. 2015-02-11 10:57:47 +01:00
Axel Naumann
8edeb7fbbe Whitespace. 2015-02-11 10:57:47 +01:00
Axel Naumann
bb966e8c8f First commit deserT, then T to resolve use.
Solves missing _ZN9__gnu_cxxL27__exchange_and_add_dispatchEPii in roottest.
2015-02-11 10:57:47 +01:00
Axel Naumann
16fe3f49dc Replace use of ExecutionEngine by OrcJIT. 2015-02-11 10:57:47 +01:00
Axel Naumann
d9a804df73 OrcJIT emits only call dependencies. 2015-02-11 10:57:47 +01:00
Axel Naumann
45056891ad Link against OrcJIT. 2015-02-11 10:57:46 +01:00
Axel Naumann
7e2955f8de Remove unused "remap symbols". 2015-02-11 10:57:46 +01:00
Axel Naumann
8efd56133d Implement getMissingSymbolAddress(). Take ref to IncrementalExecutor.
Weak symbols can be generated after getSymbolAddress(). Instead them "error" part
now needs to go through getMissingSymbolAddress().
2015-02-11 10:57:46 +01:00
Axel Naumann
d742271424 Follow interface change. 2015-02-11 10:57:46 +01:00
Axel Naumann
c44e538008 Follow interface change. 2015-02-11 10:57:46 +01:00
Axel Naumann
276ff16454 No DeclCollector in interface; much more efficient OnlyLex path. 2015-02-11 10:57:46 +01:00
Axel Naumann
ae0290a4fb Follow change in warning; add new warning. 2015-02-11 10:57:46 +01:00
Axel Naumann
020f962990 Follow interface change (unique_ptr). 2015-02-11 10:57:44 +01:00
Axel Naumann
b59de8a40a Adapt to clang/llvm changes (mostly ownership). 2015-02-11 10:57:43 +01:00
Axel Naumann
9b94d72ac3 No more old JIT. 2015-02-11 10:57:43 +01:00
Axel Naumann
b61128b376 Remove BackendPass; MCJIT happily uses those from the target. 2015-02-11 10:57:42 +01:00
Axel Naumann
0dec67dfe7 Follow interface change. 2015-02-11 10:57:42 +01:00
Axel Naumann
6b3843b2ba Implement new DeclCollectorPPAdapter.
As emitter objects now own their callback objects, DeclCollector has two owners.
Fix that by using an explicit bridge callback for the Preprocessor that it can own.
2015-02-11 10:57:41 +01:00
Axel Naumann
e10151e9d3 CGModule now prevents re-emission of "llvm.ident". 2015-02-11 10:57:41 +01:00
Axel Naumann
2deb711ce1 Make test more readable. 2015-02-11 10:57:41 +01:00
Axel Naumann
9c2d9fb700 Simplify interface: no need for the llvm::Module. 2015-02-11 10:57:41 +01:00
Axel Naumann
14a75773d6 Use getAddressOfGlobal(): assume the CFunc symbol exists if emitted. 2015-02-11 10:57:40 +01:00
Axel Naumann
46673943f8 MCJIT knows where to find things, do not rely on the module (which one?) 2015-02-11 10:57:40 +01:00
Axel Naumann
9c383fcef3 clang is built without rtti; no chance to find its typeinfo. 2015-02-11 10:57:39 +01:00
Axel Naumann
e4da5f2858 Error now comes during reloc (static init). 2015-02-11 10:57:39 +01:00
Axel Naumann
1e8f686cf2 Update location of "missing symbol" error:
The resolution now happens during relocation, not just at the call.
A failure thereof causes the transaction to be reverted which makes
bar() undeclared.
2015-02-11 10:57:38 +01:00
Axel Naumann
6d3ab3f10f Re-enable inliner now that we have nice incremental modules. 2015-02-11 10:57:38 +01:00
Axel Naumann
11947dcbf2 Return failure if Transaction was rolled back! 2015-02-11 10:57:38 +01:00
Axel Naumann
67a20fea53 Static init triggers relocation which can fail; roll back. 2015-02-11 10:57:37 +01:00
Axel Naumann
9bae38af55 Check for missing symbols found during relocations. 2015-02-11 10:57:37 +01:00
Axel Naumann
e919b241c8 Remove unused struct. 2015-02-11 10:57:36 +01:00
Axel Naumann
061cd37390 Provide __cxa_atexit replacement through custom MemoryManager.
On some platforms, global destructors are registered through a call to
__cxa_atexit(dtor, 0/*args*/, __dso_handle). While __cxa_atexit can be resolved
by the regular MemoryManager, __dso_handle (representing the "current shared
library" such that the corresponding atexit function can be called on its
dlclose) can not be resolved by MCJIT. Instead, we provide our own, poining to
the ExecutionEngine, which in turn holds a "current module" that corresponds in
spirit to the shared library handle.

__cxa_atexit, on the other hand, needs to be re-wired: the interpreter needs to
destruct globals upon its destruction, and those globals from a certain module
when that module is unloaded.

Both is done through a custom MemoryManager, significantly reducing the
complexity of the previous ("JIT without MC") implementation.

The custom MemoryManager also forwards in case of a unknown symbols to the LazyFunctionCreators instead of using the generic
ExecutionEngine::InstallLazyFunctionCreator() which has no effect with MCJIT.
2015-02-11 10:57:36 +01:00
Axel Naumann
9e68b58517 We will simply have to capture global dtors differently on Windows. 2015-02-11 10:57:35 +01:00
Axel Naumann
2ee6383c36 Remove inline asm boost hack: not needed for MCJIT. 2015-02-11 10:57:35 +01:00