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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This will be required for future LLVM upgrades that rely on a common
cmake/ directory next to clang/ and llvm/.
The bulk of this change is the result of the following commands:
$ mkdir interpreter/llvm-project/
$ git mv interpreter/llvm/src/tools/clang/ interpreter/llvm-project/clang/
$ git mv interpreter/llvm/src/ interpreter/llvm-project/llvm/
$ git mv interpreter/llvm/llvm-project.tag interpreter/llvm-project/llvm-project.tag
Before showing command promt or executing scripts from argv,
enumerate .C files in the directory ${CLING_HOME}/.cling.d/ in alphabetic
order then .x them.
Search order of ${CLING_HOME}:
1. ${CLING_HOME} envvar
2. ${XDG_CONFIG_HOME}/cling/
3. ${HOME}/.config/cling/
4. ${HOME}/
`--enable-new-dtags` is needed in some toolchains to emit the new ELF dynamic
tags, i.e. RUNPATH.
Per ld(1) manual page: `By default, the new dynamic tags are not created.`
Clang diagnostic verification was unhappy with the previous state of
affairs. Move affected `expected-(warning|note)` markers to `Macros.h`.
Apparently, as Jonas Hahnfeld found, this failure originated in commit
8deb57c04a5ceea96533d095092fcd4f71d1df94, but is not to be reverted
per discussion in https://github.com/root-project/root/pull/12454.
In principle, for a TemplateDecl, `isDefinition()` issues a recursive
call passing the templated decl as a parameter. A `ConceptDecl` is
derived from `TemplateDecl`, however, it should always be considered
a definition.
Also, update the DeclShadowing test incorporating a C++20 concept.
Fixes#12779.
Make `FilteringDiagConsumer` also ignore -Wunused-result. Whether or not
such diagnostic is filtered depends on `CompilationOptions::IgnorePromptDiags`.
In particular, `IgnorePromptDiags` should _only_ be enabled for code parsed
via `Interpreter::EvaluateInternal()`. Thus, as of this commit `IgnorePromptDiags`
defaults to 0 in `makeDefaultCompilationOpts()`
The observable effect of this change is ignoring `-Wunused-result` for
wrapped code, e.g.
```c++
[[nodiscard]] int f() { return 0; }
// This yields `warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]`
void g() { f(); }
f(); // but this should not
```
Since cling was ported to LLVM 13, it is required that the
`__cuda_register_globals` function and the `__cuda_fatbin_wrapper` and
`__cuda_gpubin_handle` variables are unique when defining a CUDA kernel.
Otherwise, the JIT is lazy and reuses the compiled version of
`__cuda_register_globals`, `__cuda_fatbin_wrapper` and `__cuda_gpubin_handle`
from the first CUDA kernel definition for all subsequent CUDA kernel
definitions, which in practice means that the PTX code from the first kernel is
re-registered each time.
Increase the default CUDA SM level to 35 because SM 20 is deprecated or
removed in the current CUDA SDK versions.
It is (again) necessary to call DefineUsedVTables() to enable (at
least) the emission of implicitly defined destructors overriding
the virtual destructor in a base class, see the added test.
Implicit instantiation of a function template calls
`DeclCollector::HandleCXXImplicitFunctionInstantiation()`, which appends the
FunctionDecl to the transaction. According to clang documentation, the body of
the function has not yet been instantiated. `HandleTopLevelDecl()` will be
called again for this decl at the end of the TU, which will append it
again to the transaction - same `Decl *`, different ConsumerCallInfo.
This is by design. However, unloading of decls in the transaction should
not process the same `Decl *` twice. In particular, entries with ConsumerCallInfo
== `kCCIHandleCXXImplicitFunctionInstantiation` will omitted.
Fixes issue #9850.
From SemaDeclCXX.cpp:
```
C++ [namespace.unnamed]p1. An unnamed-namespace-definition behaves as if it
were replaced by
namespace unique { /* empty body */ }
using namespace unique;
namespace unique { namespace-body }
where all occurrences of 'unique' in a translation unit are replaced by the same
identifier and this identifier differs from all other identifiers in the entire
program.
```
Thus, the first declaration of an unnamed namespace creates an implicit
UsingDirectiveDecl that makes the names available in the parent DC.
If we are reverting such first declaration, make sure we reset the anonymous
namespace for the parent DeclContext so that the implicit UsingDirectiveDecl
is created again when parsing the next anonymous namespace.
Fixes issue #7483.
This change was from MCJIT times and now is not needed anymore. Moreover, the
orcv2 jit infrastructure considers the llvm::Module immutable after it takes
control of it via emitModule. This change will allow us to migrate easier to
orcv2.
Some libraries are layered can depend on other libraries on a private paths.
That is, libA can depend on libB which is neither on the LD_LIBRARY_PATH nor
on a known system path. The posix linker injects "variables" such as @rpath
which is expanded at link time to resolve the libraries on a relative path.
Prior to this patch, cling's Dyld-based symbol resolution could not trace down
such cases causing failures in symbol resolution when a symbol is only defined
in libB (a private library).
This patch implements the basic posix linker substitutions allowing cling's
Dyld-based symbol resolution implementation to follow more closely the linker
rules.
Kudos Alexander Penev (@alexander-penev).
The dynamic library manager's dyld can search a symbol in the library path.
This patch uses that functionality to aid the 'unresolved while linking'
diagnostics.
Now we get:
cling -L lib/
****************** CLING ******************
* Type C++ code and press enter to run it *
* Type .q to exit *
*******************************************
[cling]$ extern int gErrorIgnoreLevel;
[cling]$ gErrorIgnoreLevel
IncrementalExecutor::executeFunction: symbol 'gErrorIgnoreLevel' unresolved while linking [cling interface function]!
Symbol found in '/.../lib/libCore.so'; did you mean to load it with .L /.../lib/libCore.so ?
[cling]$
Before, pre-existing fwd decls of specializations got unloaded.
OTOH, any decl produced during (failed) template instantiation must
also be unloaded; see #6331. Those are easiest identified by unloading
the whole (failed) transaction.
```
error: no member named 'value' in 'std::__and_<std::is_copy_assignable<std::__cxx11::basic_string<char> >, std::is_copy_assignable<Inner<int> > >'
is_copy_assignable<_T2>>::value,
~~~~~~~~~~~~~~~~~~~~~~~~~~^
```
which is due to the first decl being invalid (as `Inner<int>` does not have a deinition and a `static_assert` /usr/lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/type_traits:1093 being triggered), then not unloaded, and then picked up again where we *do* have the definition for `Inner<int>`.
Add test for templt spec lookup vs unloading.
A failure to load the library will *not* trigger loading the
same file as a source file: `#pragma load` will cause zero or
one diagnostics, not two.
Now that the diagnostic for a missing file to be `#pragma load`ed
is "file not found", re-use the existing `expected-error@input_line_12`
line!.
Copy and adapt lit.cfg from clang.
Export the CMake variable cling needs.
Add missing, now needed call to lit.llvm.initialize.
Remove unused "loadable_module" feature.
The old JIT infrastructure assumed shared ownership of the llvm::Module
implemented via shared_ptr. This guaranteed each client can have a uniform
view of the llvm::Module. The new infrastructure claims ownership of the object
and even more transfer ownership when the llvm::Module travels through different
layers of the JIT. The claimed advantage is better thread safety.
The new logic defines away an important property which cling has been built
around, that is the shared symbol object ownership.
This patch makes the cling::Transaction the owner of the llvm::Module. The
ownership is transfered when we want the JIT to 'emit' the module. Fortunately,
there is a JIT callback which can transfer back the ownership to the transaction.
This preserves some consistency, however, makes some operations unsafe. For
example, we cannot rely on Transaction::getModule when the module is being
handed to the JIT.
This patch tries to adapt to the new infrastructure by reducing the dependency
on the transaction's llvm::Module in favor of relying more on the information
available in the execution engine (eg. at_exit handling).
llvm-mirror/clang@444665e219 says:
"Remove use of lookahead from _Pragma handling and from all other
internal lexing steps in the preprocessor.
It is not safe to use the preprocessor's token lookahead except when
operating on the final sequence of tokens that would be produced by
phase 4 of translation. Doing so corrupts the token lookahead cache used
by the parser. (See added testcase for an example.) Lookahead should
instead be viewed as a layer on top of the normal lexer.
Added assertions to catch any further incorrect uses of lookahead within
lexing actions."
This tells us that if we try to #include the header.h while processing the
- To enable the CUDA test, lit detects the `libcudart.so` in
`LD_LIBRARY_PATH`. Now lit also set the CUDA SDK root of
`libcudart.so` as cling parameter (`--cuda-path`) in the tests.
- Pass through the environment variable `CUDA_VISIBLE_DEVICES`.
This makes all functions end up in the same text section, which is
important for TCling on macOS to catch exceptions from constructors:
Stack unwinding requires information about program addresses to find
out which objects to destroy and what code should be called to handle
the exception. These addresses are relocated against a single __text
section when loading the produced MachO binary, which breaks if the
call sites of global constructors end up in a separate init section.
Fixes ROOT-10703 and ROOT-10962
This commit allows the user to enable/disable specific interpreter capabilities
without requiring to `#include` the heavier weight `Interpreter.h` (that also
has dependencies on llvm).
The only feature covered at the moment is definition shadowing.
Closes cling issue #360.