Commit Graph

4307 Commits

Author SHA1 Message Date
Axel Naumann
436b28ca62 cling-travis: update images, less builds, newer comp, log folding. 2018-06-12 12:44:08 +02:00
Axel Naumann
681e0c5e1d Update cling readme (cling issue #210). 2018-06-12 10:44:10 +02:00
Saagar Jha
d57fbe37d5 Handle Control+C and Control+D (mostly) correctly 2018-06-12 08:41:07 +02:00
Saagar Jha
68c93f9743 Fix unfortunate typo 2018-06-12 08:41:03 +02:00
Guilherme Amadio
cbaac95d07 Replace deprecated std::ptr_fun and std::mem_fun with equivalent code
Removed in C++17. No functionality change intended.
2018-06-12 08:40:00 +02:00
Bertrand Bellenot
a561c61888 disable unicode (UTF-8) in the console for the time being, since it causes problems on Windows 10 2018-06-12 08:40:00 +02:00
Raphael Isemann
345a13cef6 Don't assume fileno is a function.
This otherwise leads to compilation errors when we do `::fileno`
as OpenBSD implemented fileno as a macro (which seems to be allowed).
2018-06-12 08:40:00 +02:00
Bertrand Bellenot
ed135557e7 disambiguate the else branch 2018-06-12 08:40:00 +02:00
Bertrand Bellenot
c4990cff45 Fix uninitialized fDefaultAttributes (makes terminal black on black) 2018-06-12 08:40:00 +02:00
Yuka Takahashi
0d478d0fc4 Revert "Add the cwg to the prebuilt module cache path." (#2160)
This reverts commit 5298b418eec4129351888f41cb7c3bfc90161e22.

This commit was mistakenly committed. PR was opened in #1730, but it was
closed and moved to #1761. I didn't notice this and created another PR
in #1980.

This change was causing 100+ failures in runtime cxxmodules nightlies.
(Eg. https://epsft-jenkins.cern.ch/job/root-pullrequests-build/29183/testReport/junit/projectroot/runtutorials/tutorial_fit_FittingDemo/)
We want to have **proper** PrebuildModulesPaths which information were
extracted from LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, not a random ".".

Because of this commit, we were trying to autoload libraries generated
by roottest on-demand (for example "./h1analysisTreeReader_C.so") This
is not an intentional behavior, these autogenerated libraries are
already loaded by roottest and what we want to do is to load **proper**
libraries like libHist.so instead.
2018-06-07 15:59:45 +02:00
Yuka Takahashi
35a8988d50 Autoload less libraries
In previous allmodules&autoloading patch, we used callback from
DeserializationListener to get Decl and loaded corresponding libraries.
It worked, but the performance was bad because ROOT was loading
excessive libraries.

In this patch, we use TCling::LazyFunctionCreatorAutoloadForModule. This
function gets callback when "mangled_name" was not found in loaded
libraries thus we have to the load corresponding library and lookup
again.

I used unordered_map to store mangled identifier and library pair. I'm
doing an optimization by hashing mangled name and storing library not by
name but by uint8 and hold uint8-name information in another vector.
Also tried std::map but unorderd_map was more performant. There are
better hash table like:
https://probablydance.com/2018/05/28/a-new-fast-hash-table-in-response-to-googles-new-fast-hash-table/
we can try to use them if this part gets crucial.

With this patch:
```
Processing tutorials/hsimple.C...
hsimple   : Real Time =   0.04 seconds Cpu Time =   0.03 seconds
(TFile *) 0x562b37a14fe0
Processing /home/yuka/CERN/ROOT/memory.C...
cpu  time = 0.362307 seconds
sys  time = 0.039741 seconds
res  memory = 278.215 Mbytes
vir  memory = 448.973 Mbytes
```

W/o this patch:
```
Processing tutorials/hsimple.C...
hsimple   : Real Time =   0.08 seconds Cpu Time =   0.07 seconds
(TFile *) 0x5563018a1d30
Processing /home/yuka/CERN/ROOT/memory.C...
cpu  time = 1.524314 seconds
sys  time = 0.157075 seconds
res  memory = 546.867 Mbytes
vir  memory = 895.184 Mbytes
```

So it improves time by 4x times and memory by 2x.
2018-06-02 10:44:38 +02:00
Axel Naumann
eb9fbe9f2c Unroll the pointer-check cache loop. 2018-05-24 23:14:32 +02:00
Nathan Daly
f2bcf29b1c Allow cpt.py to handle double-digit version numbers
Before this commit, cpt.py attempted `"3.11.1" < "3.4.3"`, but this
incorrectly returns `True`. This commit adds a function that splits the
string into version identifiers and checks them all individually.
2018-05-24 11:29:51 +02:00
Axel Naumann
332a707e55 Allow passing of cling::Interpreter constructor flags. 2018-05-22 23:29:52 +02:00
Axel Naumann
7682a69042 Do not override preproc (un)defines if already set. 2018-05-22 23:29:52 +02:00
Axel Naumann
673a1d63a4 cling PR 233 (#2038)
Add llvm module pass to generate unique cuda module ctor/dtor names.

This llvm module pass address the follow problem. Every llvm module has a cuda ctor and dtor (if a cuda fatbinary exist), with at least a function call to register the fatbinary. The ctor/dtor can also include function calls to register global functions and variables at runtime, depending on user's code. The lazy compilation detects functions by the name. If the name (symbol) already exists it uses the existing translation. Otherwise it translates the function on first use (but it never translates twice). Without the module pass, Cling will always use the translation of the first module.

The testcase use the reflection of the gCling interpreter object. It takes two random modules and compare the symbols of the cuda module ctor and dtor.

Also add function, which change the symbol of the cuda module ctor and dtor to preprocessor compliant symbols.
2018-05-18 11:14:07 +02:00
Yuka Takahashi
98719ad352 Preloading modules and autoloading libraries by deserialized decls
Preloading all the modules has several advantages. 1. We do not have to
rely on rootmap files which don't support some features (namespaces and
templates) 2. Lookup would be faster because we don't have to do
trampoline via rootmap files.

Autoloading libraries when decls are deserialized gives us correctness.
However we still need to optimize the performance by reducing the amount
of loaded libraries and improving Clang performance.
2018-05-18 10:14:30 +02:00
Axel Naumann
3b7919436c Do not unload enum fwd decl but silence redecl diag (ROOT-9363 ROOT-9114).
Unloading the enum forward decl has tragic consequences e.g. for template
specializations relying on that decl (as template type parameter): the
enum definition will not be associated with teh forward decl, and any
subsequent template specialization will not recognize the type identity
of the enum forward declaration and its definition.

Instead, silence the diagnostic. This is not nice, but will be fixed by
C++ modules.
2018-05-16 16:00:04 +02:00
Axel Naumann
d3e070c663 Revert "Move enum attributes after "enum class X: int" (ROOT-9114)."
This reverts commit 42f889c02436107da57d45192951176892666083.
2018-05-16 16:00:04 +02:00
Vassil Vassilev
806c5685c7 Add the cwg to the prebuilt module cache path.
Some modules (produced by rootcling) are located in the cwg and they
should be resolved from there without being rebuilt.
2018-05-09 22:14:39 +02:00
Bertrand Bellenot
01fa534b71 Fix compilation errors on Windows
Fix compilation errors with the latest version of Visual Studio (15.7.0)
- Prevent compilation error G47C585C4: STL1000: Unexpected compiler version, expected Clang 6 or newer
- Fix exported symbols
2018-05-09 10:14:21 +02:00
Oksana Shadura
f8b6afcbb0 Fixing linking of Clang libraries for Cling and rootcling_stage1 in case of builtin_clang=OFF 2018-05-02 11:29:42 +02:00
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