IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Initializing the module manager overwrites the external Sema/AST sources
with the ASTReader.
As we are using our own sources in cling, we should manually initalize
the module manager when we are in the module mode before we set our
own custom sources (which respect any existing sources like the ones
created by the module manager).
We should setup our callbacks for ExternalASTSource/ExternalSemaSource
before we parse *any* code to prevent that any part of the code
stores a reference to a non-cling external sources. If this happens,
then the clang data structures such redecl chain could go out of
sync if they reference different sources and produce errors like failing
to merge declarations correctly or creating invalid redecl chains.
To fix this, we move this initalization before the initalization of
the incremental parser which is the first part that can generate
any AST nodes. We only do this for the modules case because in
the non-modules case the clang PCH overwrites our callback
in the ExternalASTSource and therefore would destroy our external
source.
We actually need those callbacks as they are responsible for
loading decls from unresolved identifiers, which then actually
triggers the loading of the specific header (or in our case
the specific C++ modules).
For now we need this as long as the modules are based on the
rootmap mechanism.
Initializing the module manager overwrites the external Sema/AST sources
with the ASTReader.
As we are using our own sources in cling, we should manually initalize
the module manager when we are in the module mode before we set our
own custom sources (which respect any existing sources like the ones
created by the module manager).
We should setup our callbacks for ExternalASTSource/ExternalSemaSource
before we parse *any* code to prevent that any part of the code
stores a reference to a non-cling external sources. If this happens,
then the clang data structures such redecl chain could go out of
sync if they reference different sources and produce errors like failing
to merge declarations correctly or creating invalid redecl chains.
To fix this, we move this initalization before the initalization of
the incremental parser which is the first part that can generate
any AST nodes.
Right now we always start generating a module in the CIFactory
when modules are enabled. However, we should only do that when
we actually want to generate a module according to the COpts
(e.g. the user has given a module that we should generate).
When generating the GQt module in rootcling, we hit the assertions
in forceAppend assertions about "Duplicates?!" with this declaration:
```
CXXRecordDecl 0x55555643fae8 </usr/include/qt4/QtCore/qglobal.h:1658:1, line:1794:1> line:1658:21 in GQt.TGQt.h hidden class QSysInfo definition
|-also in GQt.TQtClientWidget.h
|-CXXRecordDecl 0x55555643fc30 <col:1, col:21> col:21 in GQt.TGQt.h hidden implicit class QSysInfo
|-AccessSpecDecl 0x55555643fce8 <line:1659:1, col:7> col:1 in GQt.TGQt.h public
|-EnumDecl 0x55555643fd18 <line:1660:5, line:1662:5> line:1660:10 in GQt.TGQt.h hidden Sizes
| `-EnumConstantDecl 0x55555643fe98 <line:1661:9, col:38> col:9 in GQt.TGQt.h hidden WordSize 'enum QSysInfo::Sizes'
| `-ImplicitCastExpr 0x55555643fee0 <col:20, col:38> 'unsigned int' <IntegralCast>
| `-ParenExpr 0x55555643fe70 <col:20, col:38> 'unsigned long'
| `-BinaryOperator 0x55555643fe48 <col:21, col:37> 'unsigned long' '<<'
| |-UnaryExprOrTypeTraitExpr 0x55555643fe08 <col:21, col:34> 'unsigned long' sizeof 'void *'
| `-IntegerLiteral 0x55555643fe28 <col:37> 'int' 3
`-EnumDecl 0x55555643ff00 <line:1672:5, line:1685:5> line:1672:10 in GQt.TGQt.h hidden Endian
|-EnumConstantDecl 0x55555643ffd8 <line:1673:9> col:9 in GQt.TGQt.h hidden referenced BigEndian 'enum QSysInfo::Endian'
|-EnumConstantDecl 0x555556440028 <line:1674:9> col:9 in GQt.TGQt.h hidden referenced LittleEndian 'enum QSysInfo::Endian'
`-EnumConstantDecl 0x5555564400a0 <line:1681:11, col:23> col:11 in GQt.TGQt.h hidden ByteOrder 'enum QSysInfo::Endian'
`-ImplicitCastExpr 0x5555564400e8 <col:23> 'unsigned int' <IntegralCast>
`-DeclRefExpr 0x555556440070 <col:23> 'int' EnumConstant 0x555556440028 'LittleEndian' 'enum QSysInfo::Endian'
```
The reason for this is that we have QSysInfo both in the TQtClientWidget
and TGQt submodules and our current translation (which is supposed to
parse all header in the module) sees them both in one transaction.
As we also don't recognize that this decl is from a module, the code
fires the assert even though duplictes are expected with modules.
The reason why we don't recognize it as a declaration form an ASTFile
which disables the assert is that FromASTFile for the decls is
not set. This is because they haven't been loaded by the ASTFileReader
but are directly parsed as submodules in our special case where we
directly parse a module content from rootcling to generate it.
We just workaround in this patch by checking that if the decl is from
the currently generated module, we are pretending it's as if it was
loaded from an AST file.
This reverts commit 79ed4963868c758757c25b7d93ef98fac0e34774.
The commit tried to bring back the optimisation level to O0 but 2 tests fail
if this is done:
- roottest-cling-specialobj-reread
- roottest-root-io-datamodelevolution-make
Revert https://github.com/root-project/root/commit/548eca7 bringing back
optimisation level to O0 given the very long time needed to JIT simple
pieces of code.
This takes tens of seconds versus a few seconds:
using namespace ROOT::Experimental;
int test() {
// build a TDF with 1 event and 1 column "x" that is always equal 42
TDataFrame dd(1);
auto d = dd.Define("x", []() { return 42; });
// book nHistos histograms
// all with the same cut and filled with the same variable in this simple example
std::vector<TDF::TResultProxy<TH1D>> histos;
const auto nHistos = 1000u;
histos.reserve(nHistos);
for (auto i = 0u; i < nHistos; ++i)
histos.emplace_back(d.Histo1D("x"));
// run event loop, print something to be sure everything is ok
std::cout << histos.front()->GetMean() << std::endl;
return 0;
}
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.
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)
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.
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.
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.
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.
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.
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.
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