Commit Graph

1766 Commits

Author SHA1 Message Date
Axel Naumann
080ec79f0d Update CMake to orcjit. 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
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
b59de8a40a Adapt to clang/llvm changes (mostly ownership). 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
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
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
2ee6383c36 Remove inline asm boost hack: not needed for MCJIT. 2015-02-11 10:57:35 +01:00
Axel Naumann
baf51f6b04 Create a new llvm::Module per codegen'ed transaction.
MCJIT needs to finalize modules. To simplify the interface with MCJIT, each
transaction now has its own module. It gets created when the previous module
gets passed to the execution engine; the first one is created by
clang::CreateLLVMCodeGen(). CodeGen now releases the module such that it can be
added to the execution engine.

This enables simple use cases of cling with MCJIT; most notably cross-module
linking is still missing.
2015-02-11 10:57:34 +01:00
Philippe Canal
39c7e56770 typo 2015-02-05 17:25:25 +01:00
Axel Naumann
5cbc3fec0f Keep default args once there is a template definition (ROOT-7037). 2015-02-05 16:57:37 +01:00
Axel Naumann
e1bc2a432a Document crucial data member. 2015-02-05 16:57:36 +01:00
Axel Naumann
e49e187721 Protect from nullptr deref. 2015-01-29 14:24:29 +01:00
Axel Naumann
cf466c8d13 Request _ZN9__gnu_cxxL27__exchange_and_add_dispatchEPii, missing on some SLC6.
When building with RedHat's devtoolset the system's libstdc++.so is used. Missing
symbols are patched in to the binary through a static archive. We need to pull
more symbols from the archive to make them available to cling. This list will
possibly need to grow...
2015-01-29 10:55:32 +01:00
Axel Naumann
899a5dde32 Use the end of the latest memory buffer as Diag pop point.
We might have a memory buffer taht causes the creation of other memory
buffers - which hang from our parent memory buffer, and get parsed before
we pop the diagnostics. The pop location must thus not be the end of our
memory buffer - because those later memory buffers might have created
later DiagStorePoints. Simply use the end location of the last memory
buffer - there cannot be any later Diag pop than that within our call.
2015-01-23 16:24:14 +01:00
Axel Naumann
e34dec8664 Move Diag suppression to IncrementalParser.
This gets rid of the messy pulling-SourceLocations-out-of-thin-air and instead simply
uses begin and end of the relevant memory buffer where diags are meant to be suppressed.
2015-01-23 16:24:13 +01:00
Axel Naumann
ee2ba35e0f Unsuppressed the warnings once done! 2015-01-23 16:24:13 +01:00
Axel Naumann
5ff794a175 Prevent re-parse of "#include \"RuntimeUniverse.h\"". 2015-01-23 16:24:12 +01:00
Axel Naumann
e7a9c01eb0 Combine declare()s into one. 2015-01-23 16:24:11 +01:00
Axel Naumann
c86be214cb Fix doxygen warning. 2015-01-22 11:26:03 +01:00
Axel Naumann
7e981e541c Factor out unload point creation. 2015-01-21 16:59:05 +01:00
Axel Naumann
4f217d95b3 Veto fwd decl of complex template default argument expressions.
Works around issue with ATLAS forward decl of

namespace Eigen{
  namespace internal{
    template <typename T, int Size, int MatrixOrArrayOptions,
              int Alignment = (MatrixOrArrayOptions & DontAlign) ? 0 : (((Size * sizeof(T)) % 16) == 0) ? 16 : 0>
    struct plain_array;
}}
2015-01-09 16:23:11 +01:00
Axel Naumann
cb18d9bc09 Also store Parser paren numbers; likely fixes ROOT-6976:
The parser (or rather the BalancedDelimiterTracker) was doing a Parser::cutOffParsing() because
of an overflow of open ( - because we never reset the count.
2015-01-08 18:36:10 +01:00
Danilo Piparo
4dd0bb94ea Add protection in case no file is associated to the decl 2014-12-17 18:35:14 +01:00
Bertrand Bellenot
76d6fff7c9 Disable exceptions on Windows (until they are properly supported by clang) 2014-12-17 14:06:04 +01:00
Axel Naumann
3e25ce86e0 Refactor, do not touch disk if coming from PCH (slc6->slc7). 2014-12-16 16:39:06 +01:00
Axel Naumann
46aca4b23e InstantiationDependent is dependent, too; fix logic. (ROOT-6650) 2014-12-16 10:34:17 +01:00
Axel Naumann
3d4398f54a Remove leftover variable. 2014-12-16 10:34:16 +01:00
Axel Naumann
5bf6da8e73 Use Module::getNamedValue() to check for existing symbols (ROOT-6909). 2014-12-15 15:40:05 +01:00
Axel Naumann
dc9fbe901a Use the newly serialized tokens instead of hitting disk (ROOT-6942). 2014-12-15 15:40:04 +01:00