Commit Graph

4672 Commits

Author SHA1 Message Date
Simeon Ehrig
be5ea3a651 Fixed CUDA mode for Clang/LLVM 9 upgrade
- fix bug, which was caused by executing a transaction in the device
interpreter
- fixed warning from the device compiler
- update test cases
2021-02-25 20:44:19 +01:00
Vassil Vassilev
84bcd07963 Add a module for Vc.
This should fix a problem where the ClingTest unit test fails due to the fact
that std::vector is copied and delivered by Vc pulling a wrong dependency.
2021-02-25 20:44:19 +01:00
Vassil Vassilev
fedeedc2cd Improve "[cling] DefinitionShadower: allow shadowing of non-user-defined declarations (#6571)"
The patch applies a patch to remove duplicated entries from the StoredDeclsList.
Apparently, reading a yet-to-be-determined PCM file adds the same `Decl *` to
the lookup table. Trying to remove it using `StoredDeclsList::remove()` makes
an internal assertion to fail, as it expects the Decl to disappear from the
lookup table after being removed.

So far, `darwin.pcm` seems like one of the possible causes of this problem, but
more investigation is needed.
2021-02-25 20:44:18 +01:00
Axel Naumann
74e4407225 Unload even if no T->module:
Modules are constructed lazily; not having one still means
DeferredDecls need to be unloaded. This fixes stressInterpreter.
2021-02-25 20:44:18 +01:00
Axel Naumann
400f7c7ffb Remove pseudo-conditional / simplify (NFC). 2021-02-25 20:44:18 +01:00
Vassil Vassilev
c061a8ae01 Plugins on Windows are not supported, don't build the example plugin. 2021-02-25 20:44:18 +01:00
Axel Naumann
eac42c613b Reset Sema::CurContext to TU before auto-import:
Sema create an ImportDecl, and that should not end up e.g. inside
a class definition, or wherever else the "autoparsing" was triggered.
Fixes roottest-root-meta-assertVarOffset.

(cherry picked from commit 4d8fcf0984118663a356d462eeec6cb6c34ebfef)
2021-02-25 20:44:18 +01:00
Axel Naumann
02ec8bf986 Only JIT symbols that are unavailable:
fixes CodeGeneration/Symbols.C
2021-02-25 20:44:18 +01:00
Axel Naumann
b118f4dee3 Get rid of extra-complex built_cling:
that is anyway what we want to test, always.
And nothing seems to set the env var.
2021-02-25 20:44:18 +01:00
Axel Naumann
ffc267b9dd Import updated lit config:
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.
2021-02-25 20:44:18 +01:00
Vassil Vassilev
19543be988 LLVM-9 recommends gcc version at least 5.1
The reason is that llvm soon will use new features which are not available
on older versions.

That is a temporary fix to support gcc 4.8 and higher.
2021-02-25 20:44:18 +01:00
Vassil Vassilev
0ae75bafcd cling::Transaction::Initialize does not need Sema. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
a4a06e0fdf Fix warnings coming from shadowing names. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
d0904c1ec2 Remove unused member from the JIT. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
deafa47202 Remove unused parameters. Fixes -Wunused-parameter. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
23dadd0812 Mark the include directories of clang and llvm as system. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
cad5c25c17 Implement -Dbuiltin_cling=Off
Cling needs to be built and installed as part of llvm/clang and
then we need to specify paths as we do for builtin_clang=Off.
2021-02-25 20:44:18 +01:00
Vassil Vassilev
45002e650d Complete the upgrade to LLVM/Clang 9.0 for cling. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
36ffd9a3d5 Include ExternalProject for the clad plugin.
That allows building clad for cling standalone.
2021-02-25 20:44:18 +01:00
Vassil Vassilev
a65caf82d7 Better export cling's cmake targets 2021-02-25 20:44:18 +01:00
Vassil Vassilev
b4daff130e LLVM_ON_WIN32 was dropped.
See llvm-mirror/llvm@4833be0
2021-02-25 20:44:18 +01:00
Vassil Vassilev
f66cd2585a Store the llvm::Module ptr before moving it. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
fa7c45b1ca Orc JIT now takes the ownership of the llvm::Module.
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).
2021-02-25 20:44:17 +01:00
Vassil Vassilev
2d1a60d163 Drop support of #pragma cling load header.h
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
2021-02-25 20:44:17 +01:00
Vassil Vassilev
6a66cbd1df Fix wrong asserts. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
16988119ae ActOnModuleImport takes an export location.
See See llvm-mirror/clang@33eb2ff
2021-02-25 20:44:17 +01:00
Vassil Vassilev
51ce81f72e SymbolRef::getContents returns Expected<StringRef> 2021-02-25 20:44:17 +01:00
Vassil Vassilev
401fbfdf90 Check for the expected diagnostics. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
3f8a2221ed llvm9 fixes the printing of unscoped enums.
See llvm-mirror/llvm@2f52311
2021-02-25 20:44:17 +01:00
Vassil Vassilev
86c99ba57e BuildReturnStmt requires setting up a current function scope.
See llvm-mirror/clang@84b007fae6
2021-02-25 20:44:17 +01:00
Vassil Vassilev
c32df9ba67 auto func requires c++14 2021-02-25 20:44:17 +01:00
Vassil Vassilev
38545eec20 Suppress cmake diagnostic.
It tells us that target_link_libraries should be either all-keyword or all-plain.
2021-02-25 20:44:17 +01:00
Vassil Vassilev
9d168479f3 BuildCXXNew takes an llvm::Optional and passing 0 means ArraySize is 0.
See llvm-mirror/clang@5b0a110410
2021-02-25 20:44:17 +01:00
Vassil Vassilev
08d52941b2 Delegate the TargetMachine initialization to JITTargetMachineBuilder.
This fixes the uninitialized CodeModel and also is able to detect which is
the best setup for running a JIT.
2021-02-25 20:44:17 +01:00
Vassil Vassilev
ca290d04a0 Try moving cling to the new orc jit api. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
dbc4d6631a first and second were renamed to getBegin and getEnd. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
c9fb0ce320 The SourceLocation parameter is optional.
See llvm-mirror/clang@497bb75060
2021-02-25 20:44:17 +01:00
Vassil Vassilev
9acd5936f9 Add LLVM_FALLTHROUGH to silence warnings. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
3e364c42a5 CreateASTDumper takes 2 more parameters.
See llvm-mirror/clang@dff959c
2021-02-25 20:44:17 +01:00
Vassil Vassilev
7581cf55c8 Fix unintended negation typo. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
e16a3b2e19 BuryPointer went to llvm. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
9d149b5748 getNewUninitMemBuffer is only available in WritableMemoryBuffer.
See llvm-mirror/llvm@2a379e0
2021-02-25 20:44:17 +01:00
Vassil Vassilev
8c77337f72 The default JIT settings are assumed by default now.
See llvm-mirror/llvm@9aafb85.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
89a9b377da Remove redundant include. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
641183d4e8 Add an include to the LegacyPassManager for object's size. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
ce3ba64099 The interface requires us to tell if the value will be discarded.
See llvm-mirror/clang@bf91d084.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
f4b6851414 Index goes behind the getASTIndex interface.
See llvm-mirror/clang@03ebcc82 and llvm-mirror/clang@f4ca1ac
2021-02-25 20:44:16 +01:00
Vassil Vassilev
c85cf9e4ea Use directly the const-checking routine. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
dffacf9ee2 getTypeQualifiers was renamed to getMethodQualifiers.
See llvm-mirror/clang@8a8b20e
2021-02-25 20:44:16 +01:00
Vassil Vassilev
5c5d94f5ac TypeNameContext was moved to DeclaratorContext.
See llvm-mirror/clang@ef699b2164
2021-02-25 20:44:16 +01:00