Commit Graph

4291 Commits

Author SHA1 Message Date
Vassil Vassilev
6eca8bd693 Revert "Silence cling test error until after the break."
This reverts commit 16b0a0b8bb2aa4415a9a40138b70406f4c2b6c20.

The error seems to be fixed but we forgot to update the test.
2018-03-08 22:44:15 +01:00
Vassil Vassilev
3a5d26ebf0 Enable ROOT's builtin_llvm=Off
This patch allows ROOT to be built against compatible external llvm (5.0
or 5.0.1). Note that we still need to build clang (eg. we require
builtin_clang=On) due to the ROOT-specific patches which are not yet
upstream.

Since we have externally installed llvm, we configure and build clang as
a standalone project. The configuration relies on finding llvm-config-5.0
and uses an adapted version of the standard clang standalone build
procedure.

Clang provides dependencies such as FileCheck and not which are used by
cling's testsuite and are not being installed with the standard llvm
package.

Cling (which depends on llvm and clang) is built as a clang tool to avoid
unresolved dependencies to clang and complicating further the already
complicated cmake setup.

This patch intends a minimal change and follows the initial (suboptimal)
design to configure and build llvm, clang and cling as part of ROOT. An
ultimate solution would be to have llvm, clang and cling built as separate
standalone projects (following the recommended way by the LLVM cmake
developers).
2018-02-20 13:44:05 +01:00
Vassil Vassilev
75b9ee317f Fix typo. 2018-02-20 13:44:05 +01:00
Vassil Vassilev
e9c073dbd0 Remove outdated and commented cmake arg. 2018-02-20 13:44:05 +01:00
Vassil Vassilev
53c9768f20 Remove redundant dependency 'count'. 2018-02-20 13:44:05 +01:00
Vassil Vassilev
c2a28b097f Remove redundant include. 2018-02-20 13:44:05 +01:00
Vassil Vassilev
0fa6cbe4f7 Use the standard cmake variables showing the include path. 2018-02-20 13:44:05 +01:00
Bertrand Bellenot
52028886df remove -fno-threadsafe-statics
this will have to be investigated/fixed in the JIT
2018-02-20 13:29:03 +01:00
Bertrand Bellenot
619d59ca32 Add comment
Windows requires std::ifstream::binary to properly handle
 CRLF and LF line endings
2018-02-20 13:29:03 +01:00
Bertrand Bellenot
67fc6cba13 inconditionally provide the std::ifstream::binary flag 2018-02-20 13:29:03 +01:00
Bertrand Bellenot
7c3649035f Several fixes for Windows
in CIFactory:
- Add -fno-threadsafe-statics flag (for Windows only), to prevent potential unresolved symbols at run-time

in MetaProcessor::readInputFromFile:
- add required std::ifstream::binary flag when opening the std::ifstream
- add missing backslashes

in PlatformWin:
- properly format error messages
- in IsDLL(): check and return false if the file size is 0
- fix _CxxThrowException symbol name (not fully understood - to be reviewed)
- filter out a couple of system dlls when looking for symbols
2018-02-20 13:29:03 +01:00
Vassil Vassilev
47aa5c23ef Find clang's binary include paths.
In cases where we do not have 'installed' clang we should try to find the
relevant include directories.
2018-02-20 10:59:12 +01:00
Vassil Vassilev
bfb4168dc9 Implement basic plugin support in cling.
We rely on clang's plugin infrastructure for loading, argument processing
and unloading plugins.

This patch teaches cling to work with clang plugins such as clad -- a
clang plugin implementing automatic differentiation facilities.
2018-02-20 10:59:12 +01:00
Vassil Vassilev
988ebf7be1 Adjust comment. 2018-02-20 10:59:12 +01:00
Vassil Vassilev
e13c60a010 Reduce extra char -> llvm::StringRef conversions. 2018-02-17 11:44:06 +01:00
Vassil Vassilev
847d280aac Use the regular lookup mechanisms in cling.
TClingClassInfo has a constructor that is supposed to be used for TU
scope lookups. However, it iterates over decls and causes lots of
deserializations. It does not respect the C++ lookup rules because it
returns the first decl with the name it finds.

This patch tries to keep the original behavior by first trying to do
a regular lookup and if the result is unambigious it returns the found
decl. If the result was ambiguous we try to disambiguate it (by turning
off the using directives) and return the found result.
2018-02-15 22:29:11 +01:00
Vassil Vassilev
d9babce973 Forward declare the class in the correct namespace. 2018-01-29 15:29:26 +01:00
Vassil Vassilev
3a82a25051 Do not rely on getSpecializations.
The getSpecialization interface now deserializes lazily template
specializations. While unloading we trigger creation of new specializations
which does not make sense.
2018-01-21 09:14:46 +01:00
Houkime
51acb456a1 Add "language" field to kernel.json 2018-01-15 17:14:05 +01:00
Axel Naumann
3848d29556 Fix exception if cling is not found.
See https://stackoverflow.com/questions/48244332/c-jupyter-kernel-death
2018-01-15 15:59:58 +01:00
Dheepak Krishnamurthy
bf88ee12d3 Get correct path for cling
Required for Mac with `brew install cling`
2018-01-15 12:59:47 +01:00
Dheepak Krishnamurthy
f9db95721e Check in libexec folder as well
Required for Mac brew install
2018-01-15 12:59:47 +01:00
Axel Naumann
b302a6bcfe Silence cling test error until after the break. 2017-12-21 10:48:27 +01:00
Guilherme Amadio
50a795610f Match declarations of at_quick_exit and __cxa_atexit symbols for libc++ and C++17
On Linux, the same adjustments are needed as for libstdc++ and libc++,
so turn the condition into just #ifdef __linux__. However, since the
__cxa_atexit function is declared as extern "C" in libc++, we cannot
add "noexcept" to it, as is done for libstdc++.
2017-12-09 11:59:37 +01:00
Axel Naumann
9168e7d9ab Move enum attributes after "enum class X: int" (ROOT-9114).
With the attribute after "enum" and before the name, the name itself gets annotated
and subsequent lookups fail to identify the front-end token.
By moving the attribute behind the decl, the identifier is unmodified.
2017-12-07 17:00:35 +01:00
Axel Naumann
1193463c6f Revert "Address ROOT-9114 (Issues with dictionary's enum forward decl)"
This reverts commit 59c69dc2ce449eff8cabcf73405b04b07aaf9eb3.
Let's try to find the underlying issue...
2017-12-07 17:00:35 +01:00
Axel Naumann
2264e8c66f Mark compiler include paths as -cxx-isystem (ROOT-8991). 2017-12-06 15:29:30 +01:00
Axel Naumann
b55066ffea Claim #include <auto-parse-hdr> to remember the full path (ROOT-8863). 2017-12-06 05:59:06 +01:00
Axel Naumann
88edc07e65 Adjust after increased fp precision. 2017-12-05 15:40:37 +01:00
Axel Naumann
56b0e8e184 Print float with number of signif digits, double with 8. 2017-12-05 15:40:37 +01:00
Axel Naumann
1ac9f65512 Update to new output format. Use CHECK-NEXT. 2017-12-05 15:40:37 +01:00
Axel Naumann
25849d68c4 Update ref to include <invalid memory address> 2017-12-05 15:40:37 +01:00
Axel Naumann
a662db9c4c Adapt to new=old value printer: "1.000000" for a double 1 instead of "1".
Revert "Adapt to format changes in floating point value printing."

This reverts commit a15ef54fb4c5152eeff740cc1f3be6249ede26e6.
2017-12-05 15:40:37 +01:00
Axel Naumann
582af5e250 Print "1.000000" for a double 1 instead of "1", as in 6.10.
Uses the # modifier to printf using the "alternate form".
2017-12-05 15:40:37 +01:00
Vassil Vassilev
fdca86db1d Set the SourceManager flag to enable -fmodules-embed-all-files.
This marks all files in the PCH/PCM transient. This allows clang to
stream them back within the zip in the PCH rather than requiring the
files to be physically present on disk.

This should resolve an introduced regression which materializes if
the files are moved/deleted after the generation of the PCH.
2017-11-30 14:52:08 +01:00
Bertrand Bellenot
92213e719a Switch object format from ELF to COFF and fix symbols lookup
- Switch object format from ELF (Linux) to COFF (Windows)
- Fix mangled symbols lookup on Windows: remove leading '_' and use malloc to simulate __imp_ variables (that are indirection pointers)
2017-11-29 22:30:07 +01:00
vagrant
54dbb830b3 Disable module file validation.
We need to disable the validation of PCM files because rootcling
serializes what it sees. For instance, we even serialize in the PCM
file some temporary lookup buffers and the contents of the module maps.

We disable the PCH validation but that is not sufficient for PCM. The
TCling code `fInterpreter->getCI()->getPreprocessorOpts().DisablePCHValidation = true`
is not enough because we rely more on the clang driver to setup correctly
our modules-aware interpreter.

This patch just uses the correct flag when setting up cling.

A proper fix to this issue is thoroughly described in RE-0003 (rootcling
refactor proposal).
2017-11-20 17:14:55 +01:00
Philippe Canal
8ca438b0d1 Address ROOT-9114 (Issues with dictionary's enum forward decl)
For now, do not decorate enums, this leads to some errors, likely
due to incorrect merging.  See https://sft.its.cern.ch/jira/browse/ROOT-9114

Note: that passing the set of forward declare and then actual declaration
to clang (both official and ROOT's custom version), there is no problem
seen.
2017-11-18 01:06:27 +01:00
Vassil Vassilev
c513776350 Fix typo, we want to suppress diag not enable it. 2017-11-14 04:13:43 +01:00
Vassil Vassilev
5abbe64ffd Work around an issue being resolved in PR1306. 2017-11-12 14:31:56 +01:00
Axel Naumann
315dfad70e Adapt to new default opt level.
As the default opt level decides which user-set opt levels cling will complain about, "control flow" changes were needed for the tests.
2017-11-07 19:44:33 +01:00
Axel Naumann
a9808afd40 Adapt to format changes in floating point value printing. 2017-11-07 19:44:33 +01:00
Raphael Isemann
c41a49dabb Multiplex the ExternalASTSource in cling
We need to respect the existing ExternalASTSource when setting up the
interpreter. Otherwise the ASTReader (which is the existing source)
doesn't receive the required callbacks to properly load C++ modules.

This patch now creates a multiplexer that contains our new
ASTSource and the existing one if it's necessary. We also
no longer attach the existing sema source which seemingly
was only a workaround that only works for the special case
were the external sema source and the external AST source
are the same object.
2017-11-07 05:39:07 +01:00
Raphael Isemann
62eac4d1d2 Fix formatting of the TLS commit 2017-11-07 03:57:48 +01:00
Raphael Isemann
89c6351e3a Fix thread local storage in the cling JIT
TLS is currently not suppored in the JIT on some platforms.

However, it's possible to enable emulated TLS support in LLVM
which means that we now support TLS across many architectures.
The performance downsides of this are the overhead of accessing
the variable due to the additional indirection by the emulation.

However, this overhead is minimal and shouldn't affect most
programs. It also can be easily worked around from the user side.
This can be donefFor example by wrapping TLS variables into a single
TLS struct variable that then contains the other variables. Or just
minimizing referencing the TLS variable and use a normal copy of
the variable instead and write it back later.

Patch created with a lot of help from Lang Hames and Pavel Labath!
2017-11-07 03:57:48 +01:00
Axel Naumann
3bf7bc1a48 Use %g instead of %f, to preserve precision. 2017-11-06 21:20:19 +01:00
Vassil Vassilev
c912c9437d Switch back to O0.
We have a suboptimal behavior in the way cling optimizes code in O2 mode.
Disable it until the issue is understood and fixed.
2017-11-03 16:19:32 +01:00
Axel Naumann
3256a1dc1f Spelling. 2017-11-02 20:14:18 +01:00
Vassil Vassilev
e488ba8466 Rely on Azog to allocate the memory in an exception-aware manner. 2017-11-02 17:59:25 +01:00
Vassil Vassilev
985b2c8740 LLVM 5.0 comes with special library lookup ordering options.
Force using the old behavior and explain why it is not so good idea.
2017-11-02 17:59:25 +01:00