Commit Graph

5249 Commits

Author SHA1 Message Date
Jonas Hahnfeld
85c348828f CompoundStmt::Create takes FPOptionsOverride 2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
d5aec8274b Adapt arguments for updated APIs
Forwarding data (differently) or passing trivial parameters.
2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
fae810094c Misc renamings and type changes 2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
1144ecf217 Update ClingMemoryManager with llvm::Align 2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
fb4be6f374 InclusionDirective takes an clang::OptionalFileEntryRef 2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
490a3a9359 LookupFile takes arguments as ConstSearchDirIterator 2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
2113534493 llvm::Optional::hasValue was renamed to has_value 2023-12-11 08:59:20 +01:00
Jonas Hahnfeld
2213f5ca92 TargetRegistry.h moved to MC/ 2023-12-11 08:59:20 +01:00
Vassil Vassilev
ada3befa98 Bump cling version to 1.1~dev. 2023-12-09 17:44:02 +01:00
Vassil Vassilev
ab81cdcc61 Prepare for releasing cling v1.0 2023-12-09 16:44:07 +01:00
Vassil Vassilev
fa520028cb Add docs how to build from the mono repo 2023-12-09 09:44:03 +01:00
Axel Naumann
33084d36ad Revert "[Cling] Simplify std::tuple/pair value printer"
This reverts commit bfbb58e6f74c38b883ce6e6e096b6c6e44028869.
cling needs to be able to interpret C++11, even if built with C++17.
2023-12-09 09:29:10 +01:00
Jonas Hahnfeld
aacb57ada4 Provide fallback for LLVM_INCLUDE_DIRS
In standalone builds, it could otherwise happen that the variable is
not set during the first CMake invocation and tests fail because they
are unable to locate the LLVM headers.
2023-12-05 15:44:05 +01:00
Axel Naumann
cbd1dcf8da test/Driver/CommandHistory.C: env -u also works on macOS. 2023-12-05 15:44:05 +01:00
Vassil Vassilev
93153b9971 Correctly infer the SDKROOT.
This fixes the -lSystem issues we saw on recent osx platforms.
2023-12-05 14:14:03 +01:00
Vassil Vassilev
8069aa7a73 Handle llvm::Errors correctly.
This fixes several tests on osx.
2023-12-05 14:14:03 +01:00
Jonas Hahnfeld
5cf51d53dd Handle variable templates in DeclUnloader
Fixes #13815
2023-11-30 09:29:02 +01:00
Jonas Hahnfeld
df71846ee9 Refactor unloading of template specializations
Also quite a bit of simplification.

Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
2023-11-30 09:29:02 +01:00
Jonas Hahnfeld
788b2b2be7 DeclUnloader: Avoid iterator invalidation
... when unloading template declarations and their specializations.
2023-11-30 09:29:02 +01:00
Jonas Hahnfeld
aeba3fa2c7 DeclUnloader: Remove extra check isInstantiatedInPCH
This effectively reverts commit 74472caaa9 ("[cling] Fixes issue in
DeclUnloader: do not unload templates intantiated in the PCH"), it's
not needed anymore, all tests pass and the snippet in the summary of
https://github.com/root-project/root/pull/4447 works, but it filters
too many declarations from the unloader.
2023-11-30 08:59:08 +01:00
Javier Lopez-Gomez
d3e42235c1 DeclUnloader: do not delete instantiated member functions
The body of member functions of a templated class only gets instantiated
when the function is used.  These `CXXMethodDecl` should not be deleted
from the AST; instead return them to the 'instantiation pending' state.
2023-11-30 08:59:08 +01:00
Javier Lopez-Gomez
33a63913b3 DeclUnloader: remove StaticVarCollector
StaticVarCollector recursively visited descendants of a `FunctionDecl`
node to collect static local variables.  However, these always appear
in the enclosing DeclContext.
2023-11-30 08:59:08 +01:00
Danilo Piparo
a292a61b28 Simplify std::tuple/pair value printer
By using std::apply, now available after moving to C++17,
the implementation can be greatly simplified.
2023-10-18 06:59:05 +02:00
Jonas Hahnfeld
41e07b3b23 Handle length modifiers in IsClassOrFunction
This expands the handling introduced in commit 31e46a65f6 to include
the length modifiers 'short' and 'long' as mentioned back then. It
still doesn't handle the cases of multiple modifiers such as "unsigned
long long int" and "long int unsigned long" (being the same type).

Fixes https://github.com/root-project/root/issues/13288
2023-10-13 10:14:07 +02:00
Jonas Hahnfeld
97485f56de Refactor modifier handling in IsClassOrFunction 2023-10-13 10:14:07 +02:00
Jonas Hahnfeld
a3fa6e22a1 Emit const variables only once (#13614)
Otherwise they are emitted as internal and we get double-construction
and -destruction on the same memory address due to the way we promote
internal declarations in KeepLocalGVPass.

According to upstream tests, the de-duplication doesn't work on Windows
(yet), but I think this problem is severe enough to fix it on the other
platforms sooner rather than later.

Fixes #13429
2023-10-03 17:14:07 +02:00
Javier Lopez-Gomez
45318c5a0e Fix unmatched #pragma clang diagnostic push 2023-08-24 23:44:07 +02:00
Javier Lopez-Gomez
ed8ed246b2 Move helper functions to anonymous namespace at the beginning 2023-08-24 23:44:07 +02:00
Jonas Hahnfeld
dfee35549d Skip IncrementalExecutor for CUDADevice
We don't need it, and with the upgrade to LLVM 16 the NVPTX target
(correctly) errors that there is no (direct) JIT execution support.
2023-08-18 19:29:07 +02:00
Jonas Hahnfeld
345d51a8b0 Fix assertion in ExternalInterpreterSource
As far as I can understand the intent, this wants to check that the
diagnostic is *not* because it's an unsupported AST node.
2023-08-18 19:29:07 +02:00
Jonas Hahnfeld
ba5faff605 Cast to base element type pointer before calling copyArray
(For context, this is important for multi-dimensional constant arrays
as described in ROOT-7016 and tested in Cling's Interfaces/evaluate.C
test. But for reasons unknown to me, the ROOT prompt now seems to have
a different way of handling this case because just reverting commit
d97e4dca363 still works there...)

Instead of using relying on recursive templated calls, perform the
type cast in the ValueExtractionSynthesizer. This has the advantage
of avoiding an ODR violation warning in MultipleInterpreters.C with
LLVM 16 (while unclear if that one is correct or not).
2023-08-18 19:29:07 +02:00
Sergey Linev
0a23c00a1a increase minimal version requirement to 3.5, call before project
Future cmake will no longer support features before version 3.5
Also `cmake_minimum_required` must be called before `project`
2023-08-17 17:44:07 +02:00
Jonas Hahnfeld
76e87e6686 Remove REQUIRES: not_system-windows
Replace it by the standard UNSUPPORTED: system-windows.
2023-08-14 18:44:02 +02:00
Jonas Hahnfeld
bb45512ff6 Stop using triple substrings in UNSUPPORTED
With LLVM 16 and https://reviews.llvm.org/D141007, this will not be
supported anymore. As a replacement, use system-{darwin,linux,windows}.
2023-08-14 18:44:02 +02:00
Sergey Linev
0b175d1f01 fix unsafe mix of type warning in Diagnostic.cpp
Warning appears when building on Windows:

```
Diagnostics.cpp
C:\git\root\interpreter\cling\lib\Utils\Diagnostics.cpp(37,27): warning
C4805: '|': unsafe mix of type 'bool' and type
'int' in operation
[C:\Soft\root_64\interpreter\cling\lib\Utils\obj.clingUtils.vcxproj]
```
2023-08-14 15:14:03 +02:00
Stephan Lachnit
53d69ef760 Improve interface for external LLVM 2023-08-10 09:29:06 +02:00
Stephan Lachnit
c0e9de73bf Explicitly disable linking against shared LLVM 2023-08-10 09:29:06 +02:00
Stephan Lachnit
4261b067ab CMake: use CLING_BINARY_DIR instead of LLVM_BINARY_DIR to configure ClingConfig.cmake
This fixes #12151.

Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2023-08-08 08:44:08 +02:00
Stephan Lachnit
798c565978 Remove usage of --src-root with llvm-config 2023-08-02 10:59:04 +02:00
Jonas Hahnfeld
5a58c4f08d Inject symbols from libc_nonshared.a
These symbols may not be found automatically. See also upstream issue
https://github.com/llvm/llvm-project/issues/61289. This fixes the
test DynamicLibraryManager/cached_realpath.C, approach by Lang Hames.
2023-07-21 13:14:04 +02:00
Vassil Vassilev
5e3310ac04 Bump clad version to v1.2.
This new release includes some improvements:
  * Add experimental support for forward vector mode
  * Add pushforwards for std::floor and std::ceil
  * Improve AD function interfaces with bitmasked options. For example:
    clad::differentiate<<clad::order::first, clad::opts::vector_mode>(f) will
    be equivalent to clad::differentiate<<1, clad::opts::vector_mode>(f) and
    will request the first order derivative of f in forward vector mode.
  * LLVM16 Support

See more at: https://github.com/vgvassilev/clad/blob/v1.2/docs/internalDocs/ReleaseNotes.md
2023-07-20 16:59:07 +02:00
Maksymilian Graczyk
01ff272a9f Fix cling incorrect LLVM path for external LLVM+clang 2023-07-20 12:14:04 +02:00
Jonas Hahnfeld
c1574685cb Automatically adjust C++ version of PCH in Cling's test
This fixes test/CodeUnloading/PCH/VTables.C with C++17 and later.
2023-07-20 08:44:03 +02:00
Jonas Hahnfeld
a9ebc3862c Remove unused tools from Cling's lit.cfg 2023-07-20 08:44:03 +02:00
Jonas Hahnfeld
a8b0ad9867 Remove unused ASTContext from getCorrespondingTypeKind 2023-07-20 08:44:03 +02:00
Jonas Hahnfeld
ebd3404baa Fix void Value across Interpreters
They have different ASTContexts, so the VoidTy is different.
2023-07-20 08:44:03 +02:00
Jonas Hahnfeld
6466a6dfe9 Only execute void expression in MultipleInterpreters.C
It was probably an accident and currently leads to an assertion (that
will be fixed in the next commit).
2023-07-20 08:44:03 +02:00
Jiang Yi
b9e8886af7 Extend test/Prompt/decls.C to test ctor, dtor and operator 2023-07-18 20:14:07 +02:00
Jiang Yi
884b73b2a7 Treat operator overload as normal function. Do not wrap it.
Fixes https://github.com/root-project/root/issues/9449

so it is possible to define operator overload in cling cmd prompt.

btw, Make SkipPointerRefs() to not assume next token being a

tok::raw_identifier since it can be a global-scoped identifier,

e.g. int* ::class_a::func_b(short c) { return nullptr; }
2023-07-18 20:14:07 +02:00
Jiang Yi
7c7f5e0d19 cmd prompt skips global scope while parsing func return type
e.g. ::class_a class_b::mem_func_b() { return 'w'; }

skip :: right before class_a while calculating wrap point
2023-07-18 20:14:07 +02:00