4855 Commits

Author SHA1 Message Date
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
Vassil Vassilev
4a2cc489a3 Add override keyword and InclusionDirective callback takes extra arg.
See llvm-mirror/clang@ef699b2.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
08814ef1fb addPassesToEmitFile takes an extra argument.
See llvm-mirror/llvm@9ffe073.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
bd580208a7 isExplicitSpecified was refactored into an enum.
See llvm-mirror/clang@7a6d690
2021-02-25 20:44:16 +01:00
Vassil Vassilev
2419680d6b isExplicitSpecified was renamed to hasExplicitSpecifier.
See llvm-mirror/clang@7a6d690.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
99a5da9134 Fix weird whitespace. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
172fcc4c42 The member was hidden in favor of an accessor.
See llvm-mirror/clang@672ad52
2021-02-25 20:44:16 +01:00
Vassil Vassilev
355e9bcfe5 PragmaIntroducerKind was renamed to PragmaIntroducer.
See llvm-mirror/clang@6333880.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
adb3a16dff The PCHGenerator was enhanced to protect against build races.
See llvm-mirror/clang@d28cf14 and llvm-mirror/clang@2d59837.
2021-02-25 20:44:16 +01:00
Vassil Vassilev
0e04207ce2 setBuffer was renamed to replaceBuffer.
See llvm-mirror/clang@5fa94c9
2021-02-25 20:44:16 +01:00
Vassil Vassilev
e1368fcfbc getLocStart was renamed to getBeginLoc and getLocEnd to getEndLoc. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
a498073ef8 Replace the statements only if they differ. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
60bed9429d CompoundStmt::setStmts was reimplemented to save a pointer.
Unfortunately this break external tools such as cling which alters CompoundStmts
to implement its interactive extensions.

We have implemented a patch in clang which brings the old facilities only when
the new interface CompoundStmt::replaceStmts is called.

See llvm-mirror/clang@d0ee47a
2021-02-25 20:44:16 +01:00
Vassil Vassilev
ab1ea2bb02 driver::ArgStringList moved to llvm::opt. 2021-02-25 20:44:16 +01:00
Vassil Vassilev
62891a2537 clang::vfs::getVFSFromYAML moved to llvm. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
14c4b6c575 Add support for c++2a. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
b3238e5f1c LookupFile takes an extra optional argument. 2021-02-25 20:44:15 +01:00
Vassil Vassilev
f960a3520d Various ASTImporter import interfaces return llvm::Expected. 2021-02-25 20:44:15 +01:00