Commit Graph

4315 Commits

Author SHA1 Message Date
Axel Naumann
b1e4381dd5 Use the result of find(). 2017-10-11 21:56:45 +02:00
Vassil Vassilev
2a4be7cd70 Simplify llvm::Module emission in the JIT.
This teaches again the IncrementalExecutor to emit only one module at a time.
In the old MCJIT days, the API worked with module sets and cling assumed llvm's
jit infrastructure is moving in this direction.

LLVM 5.0 moves away from this concept and works with single llvm::Modules. This
patch will make the upgrade to LLVM 5.0 smoother.
2017-10-10 18:32:58 +02:00
Vassil Vassilev
fca3ee5f64 Disable a little to restrictive assert.
We are not quite ready to control that precisely the ownership.
2017-10-05 22:31:07 +02:00
Bertrand Bellenot
6bfd18bbc4 formatting (clang-format) 2017-10-05 17:59:08 +02:00
Bertrand Bellenot
988e5b00f2 Fix the Visual Studio 2017 directory location (quick and dirty hack). To be reviewed
The Visual Studio 2017 path is very different than the previous versions, and even the registry entries are completely different, so for now let's try the trivial way first (using the %VCToolsInstallDir% environment variable)
2017-10-05 17:59:08 +02:00
Vassil Vassilev
dfc0e8a2d4 shared_ptr-ize the llvm::Module*.
This is in prepare for the upcoming llvm upgrade. The future orc jit compile
layer needs a std::shared_ptr<llvm::Module>. The current design passes a
llvm::Module* around and any conversions to a shared_ptr cause the
destruction of the llvm::Module which is a long-lived object in cling.
2017-10-05 17:59:08 +02:00
Vassil Vassilev
e409ca55bc Intent cling namespace content. 2017-10-05 17:59:08 +02:00
Raphael Isemann
b24a3f704c clang-formated ForwardDeclPrinter::prettyPrintAttributes 2017-10-02 11:27:19 +02:00
Raphael Isemann
5a45b2f93d Fix assert failure when printing fwd delcs
With C++ modules we fail here because we get this extra 'include '
text before the actual header. As the header itself is correct
it seems, we just skip this extra text with modules enabled as
this code is anyway supposed to be replaced with modules
functionality.
2017-10-02 11:27:19 +02:00
Raphael Isemann
016c1fd372 Use clang's method for checking if we are in std::* 2017-09-27 10:24:51 +02:00
Raphael Isemann
b7783cf7a9 Remove unnecessary assert
After some discussion with Axel we decided that there is no point to
assert here. This feature here is not related to C++ modules.
2017-09-25 10:29:21 +02:00
Danilo Piparo
6dbdd2ab18 Fix ROOT-8359: the first compiler we look for is the one the path
then the one that was used to build cling and finally the one
in the absolute path (e.g. usr/bin/g++)
2017-09-22 08:29:26 +02:00
Raphael Isemann
246ce867e6 Print stacktrace before aborting on a missing exception.
We will probably see an increasing amount of these failures with
C++ modules as we now deserialize all declarations instead of just
the PCH ones. To safe us a lot of debugging time on where to push
the needed transaction, let's directly print the stack trace here
in the rare case that we crash here.
2017-09-20 22:44:21 +02:00
Raphael Isemann
779e64646e Don't overrite the DeserializationListener.
With the module generation in rootcling Clang rlies on AST consumers
to do the module generation work for it. Right now this doesn't work
however with the interpreter, as we just overwrite the deserialization
listener that clang added which will cause strange errors during
the module generation (the most prompinent error is that the number
of recorded submodules will be incorrect, as this it the first thing
that Clang checks before writing a module and which is recorded by
an ASTDeserializationListener).

This patch just adds a multiplexer here that allows us to keep the
old listener while also adding the one we have.
2017-09-20 13:55:20 +02:00
Axel Naumann
e88b4a338b Use lambda to avoid default ction of Value (thanks, Philippe!) 2017-09-18 14:29:05 +02:00
Axel Naumann
48e0ed72fe Add note to future self on multiplexing synchonization callbacks. 2017-09-18 14:29:05 +02:00
Axel Naumann
f033d3024f RAII, not RTTI: rename class and #includes. 2017-09-18 14:29:05 +02:00
Axel Naumann
1cb22ab987 RAII, not RTTI: rename file. 2017-09-18 14:29:05 +02:00
Axel Naumann
363deeffa1 Use LockCompilationDuringUserCodeExecutionRAII when compiling during user code execution. 2017-09-18 14:29:05 +02:00
Axel Naumann
5a7c0d122c Add RAII for LockCompilationDuringUserCodeExecution. 2017-09-18 14:29:05 +02:00
Axel Naumann
f195e8f2fd Add (Un)LockCompilationDuringUserCodeExecution() callback. 2017-09-18 14:29:05 +02:00
Raphael Isemann
bfe05be443 Now configuring C++ modules in CIFactory on -fmodules.
This patch adds support for writing out modules to the CIFactory.
If the user has passed -fmodule-name and -fmodules, we start
extending the CI instance with support for C++ modules and also
optionally setup AST consumers for writing out modules files
alongside the interpreter.
2017-09-14 13:29:20 +02:00
Raphael Isemann
d9475011ca Extended InvocationOptions with C++ modules flags.
This makes it easier for cling to check if -fmodules and/or
-fmodule-name is passed so that we can act on these flags in the
CIFactory.
2017-09-14 13:29:20 +02:00
Axel Naumann
9f6e4d0ba0 Add test for "Also recognize templates as identifier." 2017-09-13 18:38:18 +02:00
Axel Naumann
eaa02cc638 Missing return statement! 2017-09-13 18:00:09 +02:00
Frederich Munch
da655d2e8e TextInput: Remove unused method. 2017-09-13 17:16:13 +02:00
Axel Naumann
bb161feccb Also recognize templates as identifier. 2017-09-13 17:14:08 +02:00
Axel Naumann
7f105f4ad5 Assume valid pointers for declare(). 2017-09-13 13:14:06 +02:00
Axel Naumann
89a7a1ead0 Only disable ptr checker, not all AST transformers! 2017-09-13 13:14:06 +02:00
Axel Naumann
5baa770702 Throw an interpreter exception when encountering a dynamic expression error.
Without throwing cling cannot communicate to the caller that the code has failed,
as the user code is currently running when failing the dynamic expression evaluation.
Fixes gROOT->ProcessLine("doesNotExist", &res) not signalling any error through res.
Well, it still does not set res to an error - but at least it now throws.
2017-09-13 13:03:03 +02:00
Axel Naumann
54c413fc2f Remove stray "$". 2017-09-12 15:00:15 +02:00
Axel Naumann
f621b9eff4 Use CLING_VERSION as PROJECT_NUMBER (and thus $projectnumber in footer). 2017-09-10 21:14:11 +02:00
Axel Naumann
8b37b14dc0 Use PROJECT_NUMBER as "revision" info. 2017-09-10 21:14:11 +02:00
Axel Naumann
27bc8a0e1c Follow doxygen.cfg from clang; fixes long paths in file mentions. 2017-09-10 21:14:11 +02:00
Raphael Isemann
84e413a1cb Use unique_ptr to better display ownership in CIFactory::createCI. 2017-09-10 13:59:13 +02:00
Yuki Yamaura
38923cd710 Add support C++1z for Jupyter kernel
When run C++17 kernel in Jupyter notebook cause some errors
due to currently clang-5.0 in https://root.cern.ch/download/cling/ is not
support c++17.
So add support to C++1z for Jupyter kernel and we can try some new
features in Jupyter notebook.

for avoiding following error:

[I 05:46:38.253 NotebookApp] Kernel restarted:
d3413fa0-7046-4b63-912b-a286610eacc1
error: invalid value 'c++17' in '-std=c++17'
note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard
note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and
GNU extensions' standard
note: use 'c++11' for 'ISO C++ 2011 with amendments' standard
note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU
extensions' standard
note: use 'c++14' for 'ISO C++ 2014 with amendments' standard
note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU
extensions' standard
note: use 'c++1z' for 'Working draft for ISO C++ 2017' standard
note: use 'gnu++1z' for 'Working draft for ISO C++ 2017 with GNU
extensions' standard
2017-09-06 16:44:07 +02:00
Axel Naumann
4681e8014f Do not diagnose instantiation failures during function lookup.
Fixes an issue for ATLAS, where Property<string>::Property<string&> cannot be instantiated by ROOT.
ROOT is trying to do that because the function is templated, with all template parameters having defaults.
(This "let us instantiate if all template params have defaults" is needed e.g. to see pair::pair() which is sfinae protected.)
2017-09-05 10:59:25 +02:00
Raphael Isemann
7efc518a7e Refactor resource path code into own function.
This is a preparation because we want to ship module configuration
files in the future in the cling resource directory (Clang VFS overlay
files and modulemaps). This means that we will need to know this path
in a few other places (e.g. where we specify the -ivfsoverlayPATH
arguments and potential -fmodule-map-file=PATH args)

It also makes this giant function a bit easier on the eyes.
2017-09-01 18:47:47 +02:00
Axel Naumann
15a4056c56 Whitespace. 2017-08-31 08:44:16 +02:00
Axel Naumann
62bcd0aa3b Use local lock reset state instead of a global stack.
Fixes threading issues: multiple threads storing and restoring mutex state, the
stack being modified concurrently etc.
2017-08-31 08:44:16 +02:00
Axel Naumann
8cfa532b72 Interpreter callback is created after Interpreter ctor. 2017-08-31 08:44:15 +02:00
Axel Naumann
63e3937b23 Add new interface to MultiplexInterpreterCallbacks. 2017-08-31 08:44:15 +02:00
Axel Naumann
4f41d10b0c Inform callback upon invoking functions / static init. 2017-08-31 08:44:15 +02:00
Axel Naumann
2a0b7a6495 Wrap enter/leave user code into RAII. 2017-08-31 08:44:15 +02:00
Axel Naumann
83ba3f0a50 Add callbacks for when cling enters and leaves user code.
Useful for locking / unlocking cling when used in MT context.
2017-08-31 08:44:15 +02:00
Axel Naumann
0f8914316e Rename executeInitOrWrapper to jitInitOrWrapper: it does not execute. 2017-08-31 08:44:15 +02:00
Bertrand Bellenot
cf766f02ee Add comment for VS 2017 2017-08-29 15:21:36 +02:00
Bertrand Bellenot
5d4a7b51a7 Add support for Visual Studio 2017 2017-08-29 15:21:36 +02:00
Vassil Vassilev
9bba715590 Add missing header files. 2017-08-27 18:14:05 +02:00
Philippe Canal
f715135d1c Don't clang-format cling test script.
Since the test script is not a fully compliant C++ file, clang-format can not
(be expected to) follow its unusual conventions/requirements.
2017-08-24 18:59:04 +02:00