Commit Graph

4285 Commits

Author SHA1 Message Date
Axel Naumann
2a60e2a750 Implicit array decay, some printValue-s need arrays! Fix value pointer calculation. 2018-04-30 16:29:42 +02:00
Axel Naumann
47dde3b27f Cache result of type transform. 2018-04-30 16:29:42 +02:00
Axel Naumann
855d7224ae cling can now print lamda-dependent types! 2018-04-30 16:29:42 +02:00
Axel Naumann
e39e1baf94 Do not rely on value printer to side-#include <string>. 2018-04-30 16:29:42 +02:00
Axel Naumann
ef2fc34520 Also allow char16, char32 for string value printing. 2018-04-26 12:14:31 +02:00
Axel Naumann
9d3e144814 Allow "same types" to be printed as const char*.
Fixes printing of std::string::c_str().
2018-04-26 12:14:31 +02:00
Axel Naumann
0793802867 Fix const char* printing, take 2. 2018-04-25 22:00:16 +02:00
Axel Naumann
edef97f368 Fix const char* printing! 2018-04-25 21:29:08 +02:00
Axel Naumann
9883aad403 Fix valgrind error in CIFactory/AddRuntimeIncludePaths. 2018-04-25 20:59:33 +02:00
Axel Naumann
ea4efd2a75 Generate the value string through AST manipulation (ROOT-8897). 2018-04-25 16:44:05 +02:00
Vassil Vassilev
c2ce10091f Fix the expected fully qualified type. 2018-04-21 16:14:23 +02:00
Vassil Vassilev
4a226ee47a Desugar auto types allowing to print the full qualification of a type. 2018-04-19 17:59:08 +02:00
Vassil Vassilev
f70caf92b4 Check if targets exist and then add a dependency on them.
Fixes -Dclingtest=On; make check-cling.
2018-04-19 14:29:07 +02:00
Vassil Vassilev
a53b0325db Complete the list of used libraries.
Fixes -Dbuiltin_clang=Off -Dclingtest=On builds.
2018-04-19 14:29:07 +02:00
Jason Detwiler
7085397376 Make cling copyArray loop var std::size_t (#1883)
Make cling copyArray loop var std::size_t

This avoids compiler warnings when compiling with option -Wsign-compare
2018-04-19 10:59:42 +02:00
Axel Naumann
452bafc917 Report failure for missing symbols! 2018-04-17 15:59:38 +02:00
Axel Naumann
febddd23bc Update test to follow new output. 2018-04-17 13:59:31 +02:00
Axel Naumann
697fd50363 Handle empty / unknown ABI version. 2018-04-17 13:59:31 +02:00
Axel Naumann
443bd1723f Relax stdlib ABI check; fix libc++ ABI check. 2018-04-11 21:29:05 +02:00
Yuka Takahashi
d16a653c3f Change DynamicExprInfo.h from forward decl to include
This was causing some test failures in cxx modules and in cling.
2018-04-11 12:14:06 +02:00
Bertrand Bellenot
4f2d4a8477 Initialize the token kind to "tok::eof" to prevent potential infinite loop 2018-04-11 09:59:09 +02:00
Bertrand Bellenot
119b70b8f8 From Axel: Empty token queue for late parsed templates also for pending instantiations.
Late parsed templated are parsed from a token chain, as if expanding a macro. This confuses subsequent parses. Make sure that the token quere is emptied, which is exactly what ParseInternal() does after parsing.
2018-04-11 09:59:09 +02:00
Wolf Behrenhoff
ace18e2b02 Add const& to foreach loops
In case of TProtoClass.cxx, all the loop was doing
is to copy the collection (loop body with comments
only - and those don't compile when removing the //.
Thus comment out the whole loop.

In TDFNodes.cxx remove the redundant get() as well.
2018-04-10 16:29:10 +02:00
Bertrand Bellenot
129e60ab4b Add comment referencing where the 0x2C value is coming from 2018-04-09 15:45:00 +02:00
Bertrand Bellenot
252dd842df Inject the "_tls_array" constant (0x2C) to avoid unresolved symbol error when JITting 2018-04-09 15:45:00 +02:00
Yuka Takahashi
09c4952325 Revert changing headers and inline functions 2018-04-03 16:14:39 +02:00
Yuka Takahashi
638e5969d8 ROOT start up time and memory optimization
There are some codes compiled at the start up time. For example,
    - #include \"cling/Interpreter/RuntimeUniverse.h\"
    - #include \"cling/Interpreter/DynamicLookupRuntimeUniverse.h\"
    - namespace cling { class Interpreter; namespace runtime { Interpreter* gCling }}}
    - PrintValue
  These are passed to Cling as string and initialized at the start up time.  So I think it makes sense to reduce top-level global variables, #includes and virtual functions.

  1. Global variables
    If we break at emitModule, we can get a list of global variables and functions which are actually deserialized. These include functions, variables, STL classes and all the functions derives from them.
 I tried to change them to for example constexpr, so that it's processed at compile time.
  2. Eagerly Deserialized decls
    Thanks to @Axel 's hint and tip, we could minimize eagerly deserialized decls deserialized in ASTReader::PassInterestingDeclsToConsumer. We already removed most of eagerly deserialized decls (Some are remaining to be removed, some are hard to remove and some don't cost a lot).

  So far, we got 9.2% of cpu time improvement and 8.8% of memory improvement at start up time in release build.

  - root.exe -q -l
    - master
      cpu time = 0.09186914285714286 sec (average of 7 times)
      res  memory = 142.008 Mbytes

    - HEAD
      cpu time = 0.08337842857142856 sec
      res  memory = 129.508 Mbytes

  - hsimple.C
  Improved by 13% of cpu time and 8.5% of memory
    - master
      cpu time = 0.0954708 sec (average)
      res  memory = 142.891 Mbytes

    - HEAD
      cpu time = 0.0833258 sec
      res  memory = 130.73 Mbytes

  With modules
    - Improvement by 17.7% in cputime and 2% in memory on root.exe -q -l
    (For memory, small improvement is because most of the memory is taken by LoadModules)
    - With this patch, modules is 11.2% slower in cpu time and 6% better in residential memory.
2018-04-03 16:14:39 +02:00
Vassil Vassilev
5367e13c15 Restore removed dependency.
For in-tree builds we need Options.inc to be tablegen-ed before
building clingInterpreter library.
2018-04-01 20:44:18 +02:00
Vassil Vassilev
6c74a386ba Enable ROOT to be built with prebuilt clang and llvm.
To do so one needs to pass -Dbuiltin_llvm=Off -Dbuiltin_clang=Off and the
PATH should contain the path to llvm-config.

Note this is not enabling ROOT to work with vanilla clang!

This patch allows ROOT to be built against a prebuilt clang and llvm from
https://root.cern.ch/git/{llvm.git,clang.git}. It allows to reduce ROOT's
build times (in cases when cmake decides to rebuild the in-tree llvm for
no good reason). It moves the common denominator of different ROOT builds
in one place to save space. It also allows easy switch between LLVM in
debug and release mode.

To build the external clang and llvm exactly in the same way as the
in-tree builds use:

CMAKE_FLAGS="\
            -DLLVM_ENABLE_WARNINGS=OFF                   \
            -DLLVM_INCLUDE_TESTS=OFF                     \
            -DCLANG_INCLUDE_TESTS=OFF                    \
            -DLLVM_INCLUDE_EXAMPLES=OFF                  \
            -DCLANG_BUILD_TOOLS=OFF                      \
            -DCLANG_TOOL_ARCMT_TEST_BUILD=OFF            \
            -DCLANG_TOOL_CLANG_CHECK_BUILD=OFF           \
            -DCLANG_TOOL_CLANG_FORMAT_BUILD=OFF          \
            -DCLANG_TOOL_CLANG_FORMAT_VS_BUILD=OFF       \
            -DCLANG_TOOL_CLANG_FUZZER_BUILD=OFF          \
            -DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF     \
            -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \
            -DCLANG_TOOL_CLANG_RENAME_BUILD=OFF          \
            -DCLANG_TOOL_C_ARCMT_TEST_BUILD=OFF          \
            -DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF          \
            -DCLANG_TOOL_DIAGTOOL_BUILD=OFF              \
            -DCLANG_TOOL_LIBCLANG_BUILD=OFF              \
            -DCLANG_TOOL_SCAN_BUILD_BUILD=OFF            \
            -DCLANG_TOOL_SCAN_VIEW_BUILD=OFF             \
            -DLLVM_BUILD_TOOLS=OFF                       \
            -DLLVM_TOOL_LLVM_AR_BUILD=OFF                \
            -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \
            -DLLVM_FORCE_USE_OLD_TOOLCHAIN=ON            \
            -DCLANG_ENABLE_STATIC_ANALYZER=OFF           \
            -DCLANG_ENABLE_ARCMT=OFF                     \
            -DCLANG_ENABLE_FORMAT=OFF                    \
            -DLLVM_TARGETS_TO_BUILD=host                 \
            -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF         \
            -DLLVM_ENABLE_ABI_BREAKING_CHECKS=OFF        \
            -DCMAKE_INSTALL_PREFIX=..                    \
            -DCMAKE_BUILD_TYPE=Debug"

cmake "$CMAKE_FLAGS"   ../../../sources/root-llvm/
2018-03-28 19:29:10 +02:00
Danilo Piparo
c79fd92638 For the value printing of tuples, prefer an if to a template
in order to reduce the deserialisations which happen at ROOT startup.
2018-03-27 21:29:07 +02:00
Axel Naumann
c0fa0173b9 Remove configure/make buildsystem files. 2018-03-27 16:15:07 +02:00
Simeon Ehrig
3b656d1d3f add automatic load of libcudart.so at start of cling -xcuda 2018-03-23 18:29:07 +01:00
Simeon Ehrig
4f73d1b93d reduce arguments at start of cling -xcling
the argument --cuda-host-only and the default c++ stardard will be set at start of cling -xcuda
2018-03-23 18:29:07 +01:00
Simeon Ehrig
757fca022f allow to enable the cuda mode of the compilerInstance
set the AuxTarget, if the LangOpt CUDA is true and enable the compilation of cuda runtime code
needs a preload of the libcudart.so and the arguments -std=c++11 and --cuda-host-only at start of cling
2018-03-23 18:29:06 +01:00
Damien L-G
6bbf1f3311 Use CLING_OPTS env variable to pass extra arguments to jupyter-cling-kernel
This patch let you customize your kernel:
```
{
  "display_name": "C++14-custom",
  "argv": [
      "jupyter-cling-kernel",
      "-f",
      "{connection_file}",
      "--std=c++14"
  ],
  "language": "C++",
  "env": {"CLING_OPTS": "-I<add_directory_to_include_search_path> -L<add_directory_to_library_search_path>"}
}
```
2018-03-23 16:59:08 +01:00
Simeon Ehrig
83e3eafc44 fix CMakeFiles to allow cling build with shared libraries 2018-03-22 15:59:06 +01:00
Bertrand Bellenot
e26a6cb2df Several fixes for Windows
- cling: add missing symbol in the export list and fix semicolon issue in CMakeList.txt (it has to be in quotes)
 - cling-demo: export symbols and format hexadecimal output
2018-03-22 13:44:16 +01:00
Bertrand Bellenot
e128adbcca Fix cling on Windows (there is no Emulated TLS on Windows) 2018-03-13 18:44:11 +01:00
Vassil Vassilev
7919b1c9c2 We do not need to use std::addressof. Clang has a builtin analog. 2018-03-12 00:14:06 +01:00
Vassil Vassilev
d45d26ae1d Revert "Use a stable way to determine the address of printed objects."
This reverts commit 56b56bf25e5a4ef29555c2f7e9ea30bf76b9000e.
2018-03-12 00:14:06 +01:00
Vassil Vassilev
c2bda52ba2 The test is expected to fail on cling standalone. 2018-03-11 17:14:05 +01:00
Vassil Vassilev
7b70052776 Add forgotten to commit protection and check clause.
This should have landed in 7554be9571.
2018-03-10 10:29:05 +01:00
Vassil Vassilev
01dbb6d9d5 Use a stable way to determine the address of printed objects.
Using unary operator address of (eg. MyClass m; &m) takes into account
overloaded operators which may not give us the precide address of the
allocated storage.

This patch teaches cling to use std::addressof instead.
2018-03-08 22:44:16 +01:00
Vassil Vassilev
911071a080 CLANG_INCLUDE_DIRS and LLVM_INCLUDE_DIRS can be lists of values.
The cmake lists are semicolon-separated strings which we fail to pass
to the colon-expecting interface.
2018-03-08 22:44:16 +01:00
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