Commit Graph

2829 Commits

Author SHA1 Message Date
Vassil Vassilev
c912c9437d Switch back to O0.
We have a suboptimal behavior in the way cling optimizes code in O2 mode.
Disable it until the issue is understood and fixed.
2017-11-03 16:19:32 +01:00
Axel Naumann
3256a1dc1f Spelling. 2017-11-02 20:14:18 +01:00
Vassil Vassilev
e488ba8466 Rely on Azog to allocate the memory in an exception-aware manner. 2017-11-02 17:59:25 +01:00
Vassil Vassilev
985b2c8740 LLVM 5.0 comes with special library lookup ordering options.
Force using the old behavior and explain why it is not so good idea.
2017-11-02 17:59:25 +01:00
Vassil Vassilev
d6fe62edaf Return 0 if we cannot find an address.
Add an llvm_unreachable to handle potential errors.
2017-11-02 17:59:25 +01:00
Vassil Vassilev
5f3494f950 Do not forget to return from the function.
This was probably due to non-proprely merged conflict.
2017-11-02 17:59:25 +01:00
Vassil Vassilev
dfc5cf657d The annotation token became a special one.
We can only consume it with calling a special interface or calling ConsumeAnyToken.
2017-11-02 17:59:25 +01:00
Vassil Vassilev
8bfa1b52c6 Make this code path unreachable.
If we cannot return an address we should assert and handle the diags.
2017-11-02 17:59:25 +01:00
Vassil Vassilev
88c3d07bb9 Follow recent LLVM changes.
The orc jit API evolved as follows:
  * Use better error handling via llvm::Error and llvm::Expected<>
  * Switch back to the single llvm::Module concept as opposed to sets.
  * Use more expressive ownership model: extensive use of smart ptrs.
2017-11-02 17:59:25 +01:00
Vassil Vassilev
6e1865dafb Do not prevent copy elision. 2017-11-02 17:59:24 +01:00
Vassil Vassilev
97f45536c3 Use the setter. 2017-11-02 17:59:24 +01:00
Vassil Vassilev
16c99f41f6 Follow recent changes in the OptTable.
LLVM 5.0 introduces a field to describe possible allowed option values. This
aids the auto completion machanisms.
2017-11-02 17:59:24 +01:00
Vassil Vassilev
1a35776759 file_magic went into its own header file. 2017-11-02 17:59:24 +01:00
Vassil Vassilev
628c1fbc86 BBVectorize flag was unused and went away in LLVM 5.0 2017-11-02 17:59:24 +01:00
Raphael Isemann
00a59858a5 Manually initialize the module manager before callbacks.
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).
2017-11-02 10:10:48 +01:00
Raphael Isemann
016eaa7620 Prepone callback initialization in cling.
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.
2017-11-02 10:10:48 +01:00
Raphael Isemann
d411ed7885 Enable interpreter callbacks again
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.
2017-11-02 10:10:48 +01:00
Raphael Isemann
a03e320a33 Revert "[cxxmodules] Prepone callback initialization in cling."
This reverts commit 62fc3e9eddc6c7e78c3becf60092143607cddf50.
2017-11-01 15:33:02 +01:00
Raphael Isemann
8165c1c800 Revert "[cxxmodules] Manually initialize the module manager before callbacks."
This reverts commit 6b3f5a1f04afff77089d39c905b29ce0a411d683.
2017-11-01 15:33:02 +01:00
Raphael Isemann
e20f8edbec Manually initialize the module manager before callbacks.
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).
2017-11-01 15:33:02 +01:00
Raphael Isemann
1ebf53715c Prepone callback initialization in cling.
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.
2017-11-01 15:33:02 +01:00
Raphael Isemann
0f16f1ac15 Don't always generate a module in CIFactory
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).
2017-10-29 14:14:46 +01:00
Vassil Vassilev
8647fad06d Ask Sema if we enabled modules.
That fixes an issue when running hsimple.C with modules on.
2017-10-28 16:29:08 +02:00
Raphael Isemann
99d1df55ae Fix assert failure with duplicate decls.
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.
2017-10-27 10:52:41 +02:00
Danilo Piparo
f081e145e8 Revert "Revert 548eca7 to bring back optimisation level of interpreter to O0"
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
2017-10-19 21:14:24 +02:00
Danilo Piparo
fde4b32b7c Revert 548eca7 to bring back optimisation level of interpreter to O0
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;
}
2017-10-19 19:28:42 +02:00
Bertrand Bellenot
f8d746464b Silent many warnings on Windows 2017-10-17 15:44:31 +02:00
Axel Naumann
b1e4381dd5 Use the result of find(). 2017-10-11 21:56:45 +02:00
Vassil Vassilev
2a4be7cd70 Simplify llvm::Module emission in the JIT.
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.
2017-10-10 18:32:58 +02:00
Vassil Vassilev
fca3ee5f64 Disable a little to restrictive assert.
We are not quite ready to control that precisely the ownership.
2017-10-05 22:31:07 +02:00
Bertrand Bellenot
6bfd18bbc4 formatting (clang-format) 2017-10-05 17:59:08 +02:00
Bertrand Bellenot
988e5b00f2 Fix the Visual Studio 2017 directory location (quick and dirty hack). To be reviewed
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)
2017-10-05 17:59:08 +02:00
Vassil Vassilev
dfc0e8a2d4 shared_ptr-ize the llvm::Module*.
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.
2017-10-05 17:59:08 +02:00
Raphael Isemann
b24a3f704c clang-formated ForwardDeclPrinter::prettyPrintAttributes 2017-10-02 11:27:19 +02:00
Raphael Isemann
5a45b2f93d Fix assert failure when printing fwd delcs
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.
2017-10-02 11:27:19 +02:00
Raphael Isemann
016c1fd372 Use clang's method for checking if we are in std::* 2017-09-27 10:24:51 +02:00
Raphael Isemann
b7783cf7a9 Remove unnecessary assert
After some discussion with Axel we decided that there is no point to
assert here. This feature here is not related to C++ modules.
2017-09-25 10:29:21 +02:00
Danilo Piparo
6dbdd2ab18 Fix ROOT-8359: the first compiler we look for is the one the path
then the one that was used to build cling and finally the one
in the absolute path (e.g. usr/bin/g++)
2017-09-22 08:29:26 +02:00
Raphael Isemann
246ce867e6 Print stacktrace before aborting on a missing exception.
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.
2017-09-20 22:44:21 +02:00
Raphael Isemann
779e64646e Don't overrite the DeserializationListener.
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.
2017-09-20 13:55:20 +02:00
Axel Naumann
e88b4a338b Use lambda to avoid default ction of Value (thanks, Philippe!) 2017-09-18 14:29:05 +02:00
Axel Naumann
48e0ed72fe Add note to future self on multiplexing synchonization callbacks. 2017-09-18 14:29:05 +02:00
Axel Naumann
f033d3024f RAII, not RTTI: rename class and #includes. 2017-09-18 14:29:05 +02:00
Axel Naumann
1cb22ab987 RAII, not RTTI: rename file. 2017-09-18 14:29:05 +02:00
Axel Naumann
363deeffa1 Use LockCompilationDuringUserCodeExecutionRAII when compiling during user code execution. 2017-09-18 14:29:05 +02:00
Axel Naumann
5a7c0d122c Add RAII for LockCompilationDuringUserCodeExecution. 2017-09-18 14:29:05 +02:00
Axel Naumann
f195e8f2fd Add (Un)LockCompilationDuringUserCodeExecution() callback. 2017-09-18 14:29:05 +02:00
Raphael Isemann
bfe05be443 Now configuring C++ modules in CIFactory on -fmodules.
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.
2017-09-14 13:29:20 +02:00
Raphael Isemann
d9475011ca Extended InvocationOptions with C++ modules flags.
This makes it easier for cling to check if -fmodules and/or
-fmodule-name is passed so that we can act on these flags in the
CIFactory.
2017-09-14 13:29:20 +02:00
Axel Naumann
eaa02cc638 Missing return statement! 2017-09-13 18:00:09 +02:00
Frederich Munch
da655d2e8e TextInput: Remove unused method. 2017-09-13 17:16:13 +02:00
Axel Naumann
bb161feccb Also recognize templates as identifier. 2017-09-13 17:14:08 +02:00
Axel Naumann
7f105f4ad5 Assume valid pointers for declare(). 2017-09-13 13:14:06 +02:00
Axel Naumann
89a7a1ead0 Only disable ptr checker, not all AST transformers! 2017-09-13 13:14:06 +02:00
Axel Naumann
5baa770702 Throw an interpreter exception when encountering a dynamic expression error.
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.
2017-09-13 13:03:03 +02:00
Raphael Isemann
84e413a1cb Use unique_ptr to better display ownership in CIFactory::createCI. 2017-09-10 13:59:13 +02:00
Axel Naumann
4681e8014f Do not diagnose instantiation failures during function lookup.
Fixes an issue for ATLAS, where Property<string>::Property<string&> cannot be instantiated by ROOT.
ROOT is trying to do that because the function is templated, with all template parameters having defaults.
(This "let us instantiate if all template params have defaults" is needed e.g. to see pair::pair() which is sfinae protected.)
2017-09-05 10:59:25 +02:00
Raphael Isemann
7efc518a7e Refactor resource path code into own function.
This is a preparation because we want to ship module configuration
files in the future in the cling resource directory (Clang VFS overlay
files and modulemaps). This means that we will need to know this path
in a few other places (e.g. where we specify the -ivfsoverlayPATH
arguments and potential -fmodule-map-file=PATH args)

It also makes this giant function a bit easier on the eyes.
2017-09-01 18:47:47 +02:00
Axel Naumann
15a4056c56 Whitespace. 2017-08-31 08:44:16 +02:00
Axel Naumann
62bcd0aa3b Use local lock reset state instead of a global stack.
Fixes threading issues: multiple threads storing and restoring mutex state, the
stack being modified concurrently etc.
2017-08-31 08:44:16 +02:00
Axel Naumann
8cfa532b72 Interpreter callback is created after Interpreter ctor. 2017-08-31 08:44:15 +02:00
Axel Naumann
63e3937b23 Add new interface to MultiplexInterpreterCallbacks. 2017-08-31 08:44:15 +02:00
Axel Naumann
4f41d10b0c Inform callback upon invoking functions / static init. 2017-08-31 08:44:15 +02:00
Axel Naumann
2a0b7a6495 Wrap enter/leave user code into RAII. 2017-08-31 08:44:15 +02:00
Axel Naumann
0f8914316e Rename executeInitOrWrapper to jitInitOrWrapper: it does not execute. 2017-08-31 08:44:15 +02:00
Bertrand Bellenot
5d4a7b51a7 Add support for Visual Studio 2017 2017-08-29 15:21:36 +02:00
Philippe Canal
6c368913e7 clang-format suggestion 2017-08-24 17:03:58 +02:00
Frederich Munch
38c4b902cf Fix registration of other atexit functions during an atexit handler. Recursive registration of atexit handlers is legal and should be handled, not ignored. 2017-08-24 17:03:58 +02:00
Frederich Munch
5c41b2957c Hide members of CXAAtExitElement and make it a callable object. Update iteration to use llvm::reverse and C++11 range based for loop. 2017-08-24 17:03:58 +02:00
Frederich Munch
baa1cba4d3 Store unresolved symbols in an unordered_set; have no need for ordering. 2017-08-24 17:03:58 +02:00
Axel Naumann
8f59d3cb34 Coverity; assert on unhandled future C++ standard. 2017-08-23 01:27:08 +02:00
Axel Naumann
58614e53fd Coverity: add comment that fall-through is intentional. 2017-08-23 00:27:18 +02:00
Frederich Munch
760df2116a Hide DeclCollectorPPAdapter and use DeclCollector for setup. No need for these details to be public. 2017-07-15 10:14:38 +02:00
Frederich Munch
eba5ccd09a Update DeclCollectorPPAdapter to allow unloading of #undef command. 2017-07-15 10:14:38 +02:00
Frederich Munch
68d2bac1b1 Use final instead of virtual keyword for DeclCollector. 2017-07-15 10:14:38 +02:00
Roman Zulak
4a8d300bb1 When looking for the end of a block comment, really don’t bother with nesting. Finding the first end is good enough, the real parser can warn about any balancing issues. 2017-07-13 10:21:58 +02:00
Roman Zulak
6f5594ab4d Fix block comments greedily looking for the next asterisk. 2017-07-13 10:21:58 +02:00
Frederich Munch
7104363d9e Allow CompilerOptions:: DefaultLanguage to be queried earlier in initialization. 2017-07-06 15:59:08 +02:00
Frederich Munch
b4e11b5b79 Prefer local LangOptions variable rather than CI->getLangOpts(). 2017-07-05 11:29:06 +02:00
Frederich Munch
76a43cc209 Don’t change the C++ version from underneath clang, tell it what is desired. 2017-07-05 11:29:06 +02:00
Frederich Munch
1abc6539a9 Windows: Don’t enable GNU keywords by default. 2017-07-05 11:29:06 +02:00
Frederich Munch
66ba7a896c Formatting. 2017-07-05 11:29:06 +02:00
Frederich Munch
808cd70864 UserInterface: Enforce destruction order with TextInputHolder. 2017-07-05 10:29:07 +02:00
Frederich Munch
08178f1a46 Fix Windows exception handling for newer LLVM interfaces. Block it’s usage around CLING_WIN_SEH_EXCEPTIONS macro. 2017-07-05 09:14:09 +02:00
Bertrand Bellenot
071bf231b7 Fromm Frederich Munch: Fix CxxStdCompiledWith for Visual Studio, which requires C++14 2017-07-04 17:00:34 +02:00
Frederich Munch
329de59275 Windows: Fix infinite loop when piping to cling with < operator. 2017-07-04 15:36:52 +02:00
Frederich Munch
aad084a75a UserInterface: cling is discarding the last line if it does not have a newline. 2017-07-04 15:29:09 +02:00
Frederich Munch
22d5d1c1d2 Windows: Visual Studio 2017 is still returning 199711L for __cplusplus! 2017-07-04 15:29:09 +02:00
Axel Naumann
b675d42b6f Support shebang even outside cling driver, e.g. #!/usr/bin/env root -l -b. 2017-07-04 13:44:22 +02:00
Axel Naumann
4259fa5c74 Missing newline (breaking echo.C?) 2017-07-03 22:29:13 +02:00
Axel Naumann
609b88eabd Mark intentional fall-throughs (Coverity). 2017-07-03 14:47:57 +02:00
Axel Naumann
702dc6e269 Also escape array subscript (ROOT-7718). 2017-07-03 14:47:57 +02:00
Raphael Isemann
777650d799 Allow setting a custom ASTConsumer in CIFactory (NFC).
So far we create our DeclCollector in the CIFactory and then tried to
get this variable back in the IncrementalParser by casting the
ASTConsumer of our compiler instance to a DeclCollector. This strategy
fails as soon as we want to have multiple collectors and start using
the clang multiplexer as this call will now fail (e.g. in this case to
have another ASTConsumer that looks in the C++ modules case for what
libraries we need to link - and the best way to add this is via
the multiplexed ASTConsumer that clang provides).

This patch moves the responsibility for the DeclCollector to the
caller that relies on getting a DeclCollector back, which is in this
case the constructor of IncrementalParser.
2017-06-30 10:30:35 +02:00
Raphael Isemann
3c745639bb Always generate a ROOT modulemap and install it.
To use C++ modules during runtime we need to generate a modulemap
and install it alongside the ROOT headers. However, right now
we need to turn on cxxmodules to generate a modulemap, which would
force experiments to fulfill all the depndencies that cxxmodules
brings with it (that is, a modern clang that can build ROOT with C++
modules).

This patch untangles the modulemap generation from the cxxmodules
option, so that we always generate a modulemap even when cxxmodules
is turned off. We now also install the modulemap alongside
the ROOT headers.

No functional change for normal ROOT expected here, as the modulemap
will just be ignored without having runtime C++ modules enabled.
2017-06-29 20:51:50 +02:00
Axel Naumann
2b2f6f27db 80 cols [NFC]. 2017-06-28 17:14:08 +02:00
Axel Naumann
7aff792c8e #warning is compile-time :-) 2017-06-28 17:14:08 +02:00
Frederich Munch
c4a1d433bb Set __CLING__CXX14 for consitancy. 2017-06-28 16:15:10 +02:00
Frederich Munch
ac8fb31f82 Remove outdated comments. 2017-06-28 16:15:10 +02:00
Frederich Munch
e90cfd8b4f Make sure to setup the language defaults normally when outputting a PCH. 2017-06-28 16:15:10 +02:00
Frederich Munch
4739761b89 Don’t clear GNUMode when user has specifically asked for it. There are uses that are valid even if the host compiled with _GLIBCXX_USE_FLOAT128. 2017-06-28 16:15:10 +02:00
Axel Naumann
3918184d11 StartModule(), makeModuleName() do not need to be public. 2017-06-28 14:08:13 +02:00
Frederich Munch
f63f9bb61d Remove dependency on sstream and iostream. 2017-06-28 14:08:13 +02:00
Frederich Munch
c0ccc621da Refactor common code for creating modules in IncrementalParser. 2017-06-28 14:08:13 +02:00
Axel Naumann
3693489f3d Handle also nested deduced templates, even those wrapped in a LocInfoType.
Fixes cling/test/Lookup/template.C in C++17.
2017-06-27 10:31:08 +02:00
Frederich Munch
8e41533e0a Remove extra semicolon. 2017-06-27 10:14:05 +02:00
Axel Naumann
8fae026045 Missing "}"! 2017-06-26 22:15:16 +02:00
Axel Naumann
6ec06c0bd6 Use proper interface. 2017-06-26 22:00:28 +02:00
Axel Naumann
8e0dc09857 Turn gnu++ off if __float128 is unsupported in clang:
// clang currently supports native __float128 only on few targets, and
      // this target does not have it. The most visible consequence of this is a
      // specialization
      //    __is_floating_point_helper<__float128>
      // in include/c++/6.3.0/type_traits:344 that clang then rejects. The
      // specialization is protected by !if _GLIBCXX_USE_FLOAT128 (which is
      // unconditionally set in c++config.h) and #if !__STRICT_ANSI__. Tweak the
      // latter by disabling GNUMode.
2017-06-26 20:59:35 +02:00
Axel Naumann
07f42c7a51 Fist step towards fixing cling/test/Lookup/template.C for C++17. 2017-06-26 17:44:07 +02:00
Axel Naumann
c904524faa Back out __float128 change until we know why it's happening.
Travis should be able to reproduce this, which should allow us to report it upstream.
2017-06-23 17:14:12 +02:00
Frederich Munch
a48a2803be Add CxxStdCompiledWith function that will error if C++ standard is unknown. Fix __float128 error for gcc with -std=c++1z. 2017-06-23 17:14:12 +02:00
Axel Naumann
dc04fb555c Show diagnostics of possible value print errors. 2017-06-23 17:14:12 +02:00
Axel Naumann
27aea4b5a0 Use proper function name. 2017-06-23 17:14:12 +02:00
Axel Naumann
640eb1d81d Debug Travis GCC builds on MacOS - do they really pass -std=gnu++17?! 2017-06-23 16:44:06 +02:00
Frederich Munch
df4aea2fb0 Add continuation support for comma and backslash characters. 2017-06-23 15:14:10 +02:00
Frederich Munch
499b522de5 Initialize Token fields on construction. 2017-06-23 15:14:10 +02:00
Axel Naumann
1b2a853b7d Initialize pointer array (FWIW). Thanks, Coverity! 2017-06-23 12:59:10 +02:00
Axel Naumann
0b3c8e3acd Fix clang warning "suggest braces around init of subobject". 2017-06-23 12:59:10 +02:00
Bertrand Bellenot
5665358dff Add missing semicolon (Windows) 2017-06-23 11:14:04 +02:00
Axel Naumann
aae2870f62 Allow getStringType() to reset the cache. 2017-06-23 10:59:10 +02:00
Frederich Munch
522b5f491c Add support for multiple arguments in one pragma call. Add support for multiple styles: 2017-06-23 10:44:12 +02:00
Frederich Munch
f0caa519e8 Save some memory and only create one ClingPragmaHandler to handle all pragmas. Use clang diagnostics for parsing errors. 2017-06-23 10:44:11 +02:00
Frederich Munch
955b5423e4 Make sure to declare gCling in C-mode. Skip failing test in AtExit.C. 2017-06-22 20:30:27 +02:00
Axel Naumann
deb1fcbc7d Only emit definitions if !SyntaxOnly.
Fixes duplicate definition errors with PCH, where the first definition is in the PCH, and the
second one is injected at runtime, after attaching the PCH.
This patch still exposes as many declarations as possible to fSyntaxOnly to validate their syntax.
2017-06-22 16:39:14 +02:00
Frederich Munch
8f29132120 Fix -fsyntax-only flag which changed in 0d15357 and to allow usage of gCling.
0d15357 unintentionally blocked inclusion of RuntimeUniverse.h when using -fsyntax-only.
2017-06-22 16:39:14 +02:00
Frederich Munch
f1071b4f86 Only set -std=c++11 on Apple/GCC if language has not been explicitly set. 2017-06-22 16:39:14 +02:00
Axel Naumann
65b4cd2cc3 Avoid memset by using in-class member init. 2017-06-22 13:10:37 +02:00
Frederich Munch
7504234e21 Cache all string types. 2017-06-22 13:10:37 +02:00
Frederich Munch
8fab0d5be8 Fix caching of std::string type.
If the Transaction that holds std::string type is unloaded LookupHelper::m_StringTy will point to invalid memory.
LookupHelper::findType can return an invalid QualType causing dereference of null.
2017-06-22 13:10:37 +02:00
Frederich Munch
6753263bf4 Refactor specializations of executePrintValue. Having ExecutePrintValue templated codegens duplicate functions unneccessarily. Removes re-direction, duplicate signatures, and line count for executePrintValue. 2017-06-21 12:59:08 +02:00
Frederich Munch
c11b3fdecc Enclose more stuff in anonymous namespaces. 2017-06-21 12:59:08 +02:00
Frederich Munch
38c757e36d Have MetaProcessor::process take an llvm::StringRef. Remove unnecessary std::string -> const char* -> std::string conversions. 2017-06-21 11:29:07 +02:00
Frederich Munch
14d88d2d86 Move wchar_t type branching out of runtime. 2017-06-21 08:29:11 +02:00
Frederich Munch
f241b59b68 Remove unnecessary include. 2017-06-21 08:29:11 +02:00
Frederich Munch
e8e203bc98 Add __CLING__GNUC_MINOR__ macro. 2017-06-21 08:29:10 +02:00
Frederich Munch
95c67cb818 Cleanup cruft from CreateHostTargetMachine. 2017-06-20 11:44:13 +02:00
Axel Naumann
2177d1d4e5 Rename cling_Evaluate to EvaluateDynamicExpression.
"cling" is already in the namespace, and this is about DynamicExprInfo.
Thanks to Roman Zulak for the suggestion!
2017-06-19 16:00:56 +02:00
Vassil Vassilev
01d6baa5a9 Silence unused var warning. 2017-06-14 18:29:10 +02:00
Frederich Munch
f84742e218 Fix buffer overflow. 2017-06-14 17:59:39 +02:00
Axel Naumann
2faf5c2400 Make sure we use the definition as lookup scope. 2017-06-14 09:30:01 +02:00
Axel Naumann
212ad1b7d1 Outline calls to Interpreter::Evaluate() to not #include "Interpreter.h" in the runtime. 2017-06-14 09:30:00 +02:00
Raphael Isemann
8bdca9bc29 Fixed formatting. 2017-06-13 14:30:47 +02:00
Raphael Isemann
ca887faea0 Fix Interpreter::getMacro returning 0 when using modules.
The old code didn't query the modules if the identifier
is updated. This caused some checks to fail such as
CheckABICompatibility().
2017-06-13 14:30:47 +02:00
Raphael Isemann
55702c056b Don't overwrite the ExternalSemaSource in the modules case. (#538)
The modules implementation provides it's own sema source and
overwriting this confuses clang when we have -fmodules enabled.
2017-06-13 14:30:47 +02:00
Roman Zulak
2806ec0f61 Warn if lambdas in global scope use copy capture.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-12 18:14:31 +02:00
Roman Zulak
6a8632d451 Fix trying to destruct C structs after printing on prompt. Don't bother destructing C++ objects who have trivial destructors.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-12 18:14:30 +02:00
Axel Naumann
48aa4b9096 Remove hack, now that clang pulls the init symbol name from the Module!
This depends on the commit under review here: https://reviews.llvm.org/D34059
2017-06-10 10:29:06 +02:00
Axel Naumann
67cceed590 Do not only set the const char* but the whole StringRef of the MainFile.
Fixes a memory corruption seen after the llvm upgrade. This is still a terrible hack;
it will be replaced by a proper fix in clang::CodeGen (coming up).
2017-06-09 23:29:06 +02:00
Roman Zulak
aea1940093 Sort filenames before printing them in ClangInternalState. Cache entries being invalidated are causing the map order to change.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-09 17:45:51 +02:00
Roman Zulak
70bf1a3e8b Don’t invalidate the Transaction’s FileEntry if verifying diagnostics.
Remove check before insertion into set.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2017-06-09 17:45:51 +02:00