Commit Graph

2354 Commits

Author SHA1 Message Date
Axel Naumann
40e6b501a4 Handle last token, too. 2016-07-28 11:09:24 +02:00
Axel Naumann
93edfaeec2 Move shouldWrap / isUnnamedMacro; use Lexer. Prerequisite for improving wrapInput(). 2016-07-28 11:09:24 +02:00
CristinaCristescu
d0debe0aa9 Try std::unique_ptr for ClingATSImporter 2016-07-25 15:59:11 +02:00
Axel Naumann
762942581e Remove unused function IncrementalParser::Parse(). 2016-07-22 16:14:11 +02:00
Axel Naumann
431e6e6815 Add clarifying comment. 2016-07-22 16:14:11 +02:00
CristinaCristescu
5e2df99165 Call compile for code completion and reset diagnostics after completion. 2016-07-22 16:14:11 +02:00
Frederich Munch
eb1f75891b Fix Token::startToken not initializing length member. 2016-07-22 12:44:12 +02:00
Frederich Munch
63b1f5d4c9 Fix gcc5 complaining about pow10 being redeclared. 2016-07-22 12:44:12 +02:00
Frederich Munch
c2dc7e1af8 Remove m_exe variable from ClingMemoryManager as it's not being used. 2016-07-22 12:44:12 +02:00
Frederich Munch
57339863eb Comment out unused code in IncrementalExecutor::runStaticInitializersOnce 2016-07-22 12:44:12 +02:00
Frederich Munch
e4fc69a122 Cache function name in IncrementalExecutor::runStaticInitializersOnce. It can be non-trivial to lookup. 2016-07-22 12:44:12 +02:00
Frederich Munch
79afcba73d Fix needless assert in CheckABICompatibility for Debug builds. Trying to get a macro definition was using dyn_cast (which assert on NULL). The function is already handling that case later, so use dyn_cast_or_null. 2016-07-22 12:44:12 +02:00
Axel Naumann
cc77dac476 Indent. 2016-07-21 19:44:08 +02:00
Axel Naumann
77bbfc0020 Only use -I../../include if this is cling (ancient ROOT-4455). 2016-07-21 19:44:08 +02:00
Axel Naumann
09a50d78ce Fix missing enum case warning. 2016-07-21 15:59:24 +02:00
Axel Naumann
12d10b3145 Fix unused var warning. 2016-07-21 15:59:24 +02:00
Axel Naumann
ffec1df67b Only refuse decl extraction if ill-formed; add test; move KnownFail out. 2016-07-21 15:59:24 +02:00
Bertrand Bellenot
0d24d146df Fix weird compilation errors on Windows (to be reviewed) 2016-07-21 11:44:27 +02:00
Bertrand Bellenot
e0dabaef08 Don't use std::stringstream, since it doesn't prepend '0x' in front of hexadecimal values when streaming pointer values 2016-07-21 11:44:27 +02:00
Bertrand Bellenot
b0b2c6d9e7 Propagate the debug compiler flag to prevent mixing debug/optimized code on Windows 2016-07-21 11:44:26 +02:00
Frederich Munch
5a0e1bca84 Fix searching for library twice: DynamicLibraryManage::loadLibrary takes optional argument indicating if the path is from a previous lookupLibrary call.
(cherry picked from commit 244b26d6021e55e214ee078bec99e7c6a43d4820)
2016-07-19 18:14:10 +02:00
Axel Naumann
39dd90e183 Use LLVM_LINK_COMPONENTS; add_dependencies superseded by cling/CMakeLists.txt depending on tablegen-ed files. Cleanup linked libs. 2016-07-19 17:59:14 +02:00
Axel Naumann
b4e6edebb7 Remove unnecessary interface lib; no need for dependencies; add -ldl only if needed; use LLVM_LINK_COMPONENTS for llvm libs. 2016-07-19 17:59:14 +02:00
Frederich Munch
a054b253d8 Fix CMake projects to link to proper libraries when built as shared library. 2016-07-19 17:59:14 +02:00
CristinaCristescu
ae0c82121d Cling UITabCompletion. 2016-07-19 12:10:58 +02:00
Axel Naumann
2e08275916 Build libcling.so based on OBJECT "library" in CMake. 2016-07-19 10:59:32 +02:00
CristinaCristescu
1d13fe7548 Remove Extra included file in cling/UserInterface. 2016-07-18 20:44:10 +02:00
Axel Naumann
b3592df5c0 Fix (un)signed comparison warning. From Cristina! 2016-07-18 15:59:14 +02:00
Axel Naumann
955345222e Fix compilation failure. From Cristina. 2016-07-18 15:59:14 +02:00
CristinaCristescu
12ac538a5c Refactor 2016-07-18 14:29:14 +02:00
CristinaCristescu
4e320a621e LLVM resource dir for the child interpreter. 2016-07-18 14:29:14 +02:00
CristinaCristescu
528b16faf6 Refactoring ROOT & Cling code completion. 2016-07-18 14:29:14 +02:00
CristinaCristescu
e3d5b485e9 Filter the results loaded on the decls map for the known stem. 2016-07-18 14:29:14 +02:00
CristinaCristescu
8a646b6dba Pass the parent's interpreter llvmdir to the child interpreter. 2016-07-18 14:29:14 +02:00
CristinaCristescu
0d5cad62d2 Mark the external visibility of imported decls. 2016-07-18 14:29:14 +02:00
CristinaCristescu
16c5266de3 Make the Complete function a member of cling Interpreter. 2016-07-18 14:29:14 +02:00
CristinaCristescu
0381b517c1 Glue the cling tab completion to ROOT. 2016-07-18 14:29:13 +02:00
CristinaCristescu
cc5da51f21 Cling patch for code completion. 2016-07-18 14:29:13 +02:00
Axel Naumann
8ef4931a12 Initialize all pointer members! (Coverity 63235) 2016-07-18 11:29:36 +02:00
Axel Naumann
ce6206dd3b Do not access TheTarget if nullptr (Coverity 63252). 2016-07-18 11:29:36 +02:00
Axel Naumann
399dbc5248 Do not leak duped file handles (Coverity 54845). 2016-07-18 11:29:36 +02:00
Axel Naumann
1fe1876136 Exit early once the dylib is found. 2016-07-13 17:16:13 +02:00
Axel Naumann
7e9a74f3e4 Remove remnants of llvm configure/make build system. 2016-07-13 17:16:13 +02:00
Axel Naumann
b7267e1553 Clang now checks for missing cleanup actions. 2016-07-12 10:44:20 +02:00
Axel Naumann
ad1b09290d Follow change in clang interface. 2016-07-12 10:44:20 +02:00
Axel Naumann
6d97a5c2fa Improve detection of unnamed macro, from Nigel Victor Warr! 2016-07-06 15:29:05 +02:00
Philippe Canal
a5a0102dd0 Expected<T> object must be checked before use 2016-07-05 23:44:14 +02:00
Philippe Canal
95b31810f3 Fix the behavior of PointerCheckInjector for templated functions.
The previous version of the code was injecting the null pointer check in both
the function template and each function template instances resulting in the
check being called twice.

In addition, r272382 of llvm/clang seems to 'drop' part of the code that is
inserted in the function template when it instantiates it.  This resulting in
faulting behavior as the pointer is incorrectly cast (offset).

To solve this problem and avoid the double call, we now only insert the null
pointer check on regular function and function template instances.
2016-06-28 19:59:07 +02:00
Axel Naumann
bedc277fae Simplify invocation of DeclUnloader::UnloadDecl(). 2016-06-26 18:59:08 +02:00
Axel Naumann
d695460d0c Speling. 2016-06-26 18:59:07 +02:00
Axel Naumann
eb9e07a244 Move include to source where it belongs. 2016-06-26 18:59:07 +02:00
Axel Naumann
113ac38804 Move implementation details into source - even if they are templates.
They are private; any instantiation will happen in the source file.
They must be members: DeclUnloader is friend of Decl to access DefinitionData.
2016-06-26 18:59:07 +02:00
Axel Naumann
a7f2274811 Use overload resolution instead of templates. 2016-06-26 18:59:07 +02:00
Axel Naumann
e3dde66d81 Remove unused includes. 2016-06-26 18:59:07 +02:00
Axel Naumann
b1d7c3498d Very likely fix GCC access check issue. 2016-06-26 18:59:07 +02:00
Axel Naumann
94bc9f4f73 Separate DeclUnloader; TransactionUnloader recurses through Interpreter. 2016-06-26 10:29:17 +02:00
Axel Naumann
97c5bafb2f Merge transaction unlinking into deregisterTransaction; pass nullptr if Transaction gets unloaded. 2016-06-26 10:29:17 +02:00
Axel Naumann
1ec7136eeb Refactor, centralize all TransactionUnloading in Interpreter. 2016-06-26 10:29:17 +02:00
Axel Naumann
28bb1ed854 Make sure rollbackTransaction() can remove the transaction from the JIT. 2016-06-26 10:29:17 +02:00
Axel Naumann
4987d62346 Remove unloaded symbols from the symbol map. 2016-06-26 10:29:17 +02:00
Axel Naumann
6ba0924300 Trigger call to IncrementalJIT::removeModules()! 2016-06-26 10:29:17 +02:00
Axel Naumann
87a580e8c4 Try to work around clang "unused local typedef". 2016-06-22 13:59:07 +02:00
Axel Naumann
b2c8076707 Remove unused variable. Thanks, GCC! 2016-06-22 13:44:09 +02:00
Axel Naumann
3a8a7b2a5b Try to fix Fedora dependency / build issue. 2016-06-22 12:44:08 +02:00
Axel Naumann
dcd823444c Do not mangle dependent types. Fixes failures introduced by GCC5ABI mangling patch. 2016-06-22 12:44:08 +02:00
Axel Naumann
ab48904fa2 Revert "Clarify at compile-time that cling cannot handle the new GCC ABI yet."
Cling should now be able to do that.
2016-06-17 17:16:22 +02:00
Axel Naumann
cc29d8b4ec llvm-config.h gets installed and is sufficient. 2016-06-17 11:59:13 +02:00
Axel Naumann
f15a146faa Force OptLevel=0: all "unused" values might be used later, do not optimize them away. 2016-06-15 14:14:34 +02:00
Axel Naumann
0cd40526b5 Expose injected symbols also to "shared library" part of lambda resolver. 2016-06-15 14:14:34 +02:00
Axel Naumann
2729a76e04 Adapt to changed order of dlsym/JIT lambda in master. 2016-06-15 14:14:34 +02:00
Axel Naumann
b58ed53837 Adapt to current llvm master. 2016-06-15 14:14:34 +02:00
Axel Naumann
811be20ec7 Fix discovered by additional type safety in clang master. 2016-06-15 14:14:34 +02:00
Axel Naumann
c6b91546cb Need to also suppress assert for multiple kCCIHandleCXXImplicitFunctionInstantiation. 2016-06-15 14:14:34 +02:00
Axel Naumann
97b507f1fe Also expose non-exported symbols from previous JIT runs.
This shall be fixed by re-injecting local symbols into incremental modules
once we switch to a collecting TU-module that feeds into incremental JIT
modules.
2016-06-15 14:14:34 +02:00
Axel Naumann
dc952dace7 Force NormalInlining and CodeGen -O1; works around https://llvm.org/bugs/show_bug.cgi?id=23034 2016-06-15 14:14:34 +02:00
Axel Naumann
50847d29d9 Keep track of all emitted symbols and resolve them.
In the future, this should replace the iteration through all emitted objects.
2016-06-15 14:14:34 +02:00
Axel Naumann
7745cb17fd This plus inliner = unhappiness. 2016-06-15 14:14:34 +02:00
Axel Naumann
6155249a62 Fix for std::find from MSVC (requires copyable iterators). 2016-06-15 14:14:34 +02:00
Axel Naumann
92b021279c From Bertrand: fix for MSVC. 2016-06-15 14:14:34 +02:00
Axel Naumann
ab21611239 Change sequence of PP.EnterMainSourceFile() vs Sema.
Any source locs deserialized from the AST must know about the MainSourceFile to be rewired
into the existing AST / its source locations. Deserialization is triggered by m_Parser->Initialize().
2016-06-15 14:14:34 +02:00
Axel Naumann
240d31859c Keep a valid include srcloc tree to make srclocs comparible. 2016-06-15 14:14:34 +02:00
Axel Naumann
f68f2b2ad9 Provide sharedlib sym resolution to lambda resolver. 2016-06-15 14:14:34 +02:00
Axel Naumann
3b0e102006 Use non-deprecated interface. 2016-06-15 14:14:34 +02:00
Axel Naumann
dd40558c54 Move NotifyFinalizedT into implementation / unnamed namespace. 2016-06-15 14:14:33 +02:00
Axel Naumann
a99e7a6eaa Remove now forbidden call (llvm-upgrade). 2016-06-15 14:14:33 +02:00
Axel Naumann
d1941dbea6 Select PreprocessorOptions to load from PCH, instead of resetting their ref_cnt. 2016-06-15 14:14:33 +02:00
Axel Naumann
4e9ec8b0c9 llvm-upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
b6492c1760 Disable GDB listener / obj registration for now (llvm-upgrade). 2016-06-15 14:14:33 +02:00
Axel Naumann
d5a4d8ec28 Fix "hides function" warning. 2016-06-15 14:14:33 +02:00
Axel Naumann
c3fb3857ea Try to fix dependency clingMetaProcessor -> LLVMCore. 2016-06-15 14:14:33 +02:00
Axel Naumann
bae4bea5ac Fix and formalize tear-down; LookupHelper::~Parser still needs the PP. 2016-06-15 14:14:33 +02:00
Axel Naumann
282a32f97a Add missing include / llvm-upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
00fd3dbc12 FIXUP: cling/lib/Utils/AST.cpp extra ) 2016-06-15 14:14:33 +02:00
Axel Naumann
961e00ac2f llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
b1d025d12f llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
8543e1cedb llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
565033adc4 llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
d4b3ac77f2 Use StoredDeclsList::HandleRedeclaration instead of home-grown.
llvm upgrade; might need to revisit for unload failures.
2016-06-15 14:14:33 +02:00
Axel Naumann
5a853a501a llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
61e474fda4 llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
319f68f3f1 llvm upgrade. Revisit symbol resolution + error, move to lambda. 2016-06-15 14:14:33 +02:00
Axel Naumann
377498e147 llvm upgrade. Possibly revisit (debug info, frame ptr). 2016-06-15 14:14:33 +02:00
Axel Naumann
7a620e3f79 llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
681eacc4bc llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
3fc989558d llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
78f8a846bd llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
f844b88e5c llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
95b1b5a961 llvm upgrade. 2016-06-15 14:14:33 +02:00
Axel Naumann
67539cd6af llvm upgrade. 2016-06-15 14:14:32 +02:00
Axel Naumann
7aa512757c DenseMap<const Transaction*,...> now needs definition of cling::Transaction. 2016-06-15 14:14:32 +02:00
Axel Naumann
205a978506 Update to new llvm interfaces. 2016-06-15 14:14:32 +02:00
Philippe Canal
c04d224941 Add assert to be explicit about seg fault 2016-06-08 18:44:10 +02:00
Philippe Canal
c3f961aa67 Avoid unnecessary temporary 2016-06-08 04:29:08 +02:00
Philippe Canal
5e2fe4b0f0 Fix ROOT-8096
Add proper support for template parameter pack in
cling::ForwardDeclPrinter::VisitTemplateArgument
2016-05-17 14:44:42 +02:00
CristinaCristescu
6ba8b80abf Explain unharmful behaviour of address validity cache. 2016-05-09 16:29:07 +02:00
CristinaCristescu
c77ce1d672 Replace the llvm::thread_local with and atomic push.
The atommic operation does the increment and the mod to the number of cache lines
to ensure we are not trying to access memory out of the cache.
2016-05-09 09:44:09 +02:00
Philippe Canal
972c28b439 Remove unused function (in unnamed namespace) 2016-05-04 19:44:07 +02:00
Philippe Canal
3a5dd3a381 Remove unused variable 2016-04-30 05:44:31 +02:00
Philippe Canal
928969ebbd Remove unused variable 2016-04-30 05:44:31 +02:00
Philippe Canal
47513bfc9f Remove some memory hoarding by cling's findFunction.
Avoid creating a CXXScopeSpec (and a NestedNameSpecifierLoc) just to check whether we need
to complete a decl.
2016-04-28 17:44:30 +02:00
Axel Naumann
29c0b8c742 Fix fatal spelling error. 2016-04-26 12:14:07 +02:00
CristinaCristescu
da2190ecf1 Correct CO for DeclareInternal in cling:Interpreter::process. 2016-04-26 08:44:17 +02:00
CristinaCristescu
9cff82d107 Enable Pointer validity check for loadFile and process (user code). 2016-04-22 21:14:07 +02:00
CristinaCristescu
ac18e69a68 Create option for disabling the Pointer check in cling::Interpreter::declare.
To improve performance we limit the use of the Pointer validity check
and remove it from cling::Interpreter::declare.
To do this we introduce a Compilation Option which is used by the
ASTTransformer through Transaction.
2016-04-22 21:14:07 +02:00
Axel Naumann
6f3a95eef2 Doxygen. 2016-04-22 12:29:14 +02:00
CristinaCristescu
60a1b6bca4 Remove redundant test for CXXThisExpr in NullDeref. 2016-04-22 11:44:51 +02:00
CristinaCristescu
afdb4e75a7 Memory leak due to undeleted pointer. 2016-04-21 19:14:47 +02:00
Axel Naumann
8e5514f5b5 Only inject pointer checks if we run.
Fixes an issue visible on Ubuntu, where we deserialize a pointer check call from the PCH, that now has completely bogus (deserialized) pointers to Expr and Sema.
2016-04-21 19:14:47 +02:00
Oliver Freyermuth
304529ba41 MultiplexInterpreterCallbacks: Also multiplex the PrintStackTrace through here. 2016-04-21 19:14:47 +02:00
Oliver Freyermuth
271a0a1829 ExceptionRTTI: Only do dereferencing of Interpreter / Sema if pointer is really nullptr / invalid.
This fixes the crash on startup / during static initialization.
The Interpreter-argument given to cling_runtime_internal_throwIfInvalidPointer during
static initialization is not yet valid.
Only dereferencing in case an error was really diagnosed is also more efficient.
2016-04-21 19:14:47 +02:00
Axel Naumann
cec046a44f Dump stack trace when throwing a null deref exception. 2016-04-21 19:14:47 +02:00
Axel Naumann
50bfb01db7 NullDerefProtectionTransformer is not a WrapperTransformer anymore. 2016-04-21 19:14:47 +02:00
Axel Naumann
dc32ab8e73 Use /dev/random, some kernels skip writing to /dev/null. 2016-04-21 19:14:47 +02:00
Axel Naumann
6c3bb2daef Refinements: use std::array+find, comments, func names. 2016-04-21 19:14:47 +02:00
CristinaCristescu
6dc84b0f29 Improve performance of address validation of interpreted code. 2016-04-21 19:14:47 +02:00
Axel Naumann
739a3c962c Fix decl / impl noexcept mismatch; throw() -> noexcept. 2016-04-21 19:14:47 +02:00
Axel Naumann
bb7b60959b Sort the source files closer to alphabetical order. 2016-04-11 12:14:17 +02:00
Axel Naumann
ea41f5b87e Split Exception.cpp into a part that does and does not need RTTI.
ROOT needs to dynamic_cast a std::exception to an InterpreterException - that only works if the latter has rtti.
2016-04-11 12:14:17 +02:00
Axel Naumann
ac3d7022f0 Update required symbol cling_runtime_internal_throwIfInvalidPointer. 2016-04-09 10:44:32 +02:00
CristinaCristescu
1cb874532b Correct DiagnoseIfInterpreterException in iterpreter. 2016-04-08 15:44:11 +02:00
CristinaCristescu
0fb177cbf2 Do not check null deref for static data members calls. 2016-04-08 15:44:11 +02:00
CristinaCristescu
fc500ad68e Reduce I/O operations caused by the check of address validity. 2016-04-08 15:44:11 +02:00
CristinaCristescu
1bd499bb15 Fix bug - check only for function arguments of pointer types. 2016-04-08 15:44:11 +02:00
CristinaCristescu
0059a81ac3 In Visitor of PointerCheckInjector use Traverse not Visit. 2016-04-08 15:44:11 +02:00
CristinaCristescu
1472015449 Create function member of IncrementalParser for setting the transformers.
The transformers have to be set later in the initialization for 2 reasons:
- to avoid the null deref check before the check pointer function is declared
in the RuntimeUniverse;
- to avoid useless checks.
2016-04-08 15:44:11 +02:00
CristinaCristescu
31af5359b1 Use RecursiveASTVisitor instead of StmtVistor in NullDeref transformer.
The Stmt visitor does not allow for Decl visiting.
2016-04-08 15:44:11 +02:00
CristinaCristescu
89a06892df Constexpr cannot be checked for null derefrencing.
Constexpr are checked at compile time, and there is no need to check at run-time.
Thus we will not descend into visiting expresions which are constexpr.
2016-04-08 15:44:11 +02:00
CristinaCristescu
8cd5175dd7 Add the null derefrencing transformer to the AST transformers.
Checking all cases will be beneficial if it does not compromise
stability and performance.
2016-04-08 15:44:11 +02:00
Axel Naumann
f1d245da6a Clarify where the error comes from (cling!). 2016-03-30 12:44:14 +02:00
Pere Mato
1c1db3c3c9 Changed to avoid wanings when using Xcode >= 7.3 2016-03-24 11:59:43 +01:00
CristinaCristescu
b9a2d80235 Diagnose Interpreter exceptions.
Enable the TInterpreter to diagnose InterpreterExceptions so that
they can be caught and diagnose from outside ROOT. For that
InterpreterException derives from std::exception.
2016-03-23 14:29:11 +01:00
Paul Seyfert
8fe8f2f4ad disable grep colors, fixes ROOT-8056 2016-03-21 09:59:25 +01:00
Philippe Canal
f8a9fdcfc7 In AutoSynthesizer handle the case of try-catch function [ROOT-8034].
Example of try-catch function:

void function_with_try_block()
try
{
    // try block body
}
catch (...)
{
    // catch block body
}
2016-03-03 19:29:13 +01:00
Bertrand Bellenot
74b12a0cfe Use LLVM_ON_WIN32 everywhere 2016-02-23 11:29:06 +01:00
Bertrand Bellenot
2649f0d318 Fix cling compilation errors on Windows (with VS 2015) 2016-02-23 09:29:07 +01:00
Philippe Canal
c1cb2ca6f2 Add a means to customize which file are ignored in ForwardDeclPrinter.
This will also rootcling to tell cling's ForwardDeclPrinter to consider the file included inside a LinkDef file as
being top level headers (rather than listing the linkdef itself\!).
2016-02-19 00:00:26 +01:00
Axel Naumann
4dd09de012 Missing include on Windows; fix preproc indentation. 2016-02-05 17:29:32 +01:00
Axel Naumann
8af1646f97 Better formulation of "integer of potr size". 2016-02-05 16:14:04 +01:00
Axel Naumann
66736733d9 sizeof(pointer) != sizeof(long) on Windows. 2016-02-05 11:44:09 +01:00
Axel Naumann
a14f305911 Clarify at compile-time that cling cannot handle the new GCC ABI yet. 2016-02-04 20:29:06 +01:00
CristinaCristescu
4dd9c812d8 Synthesize InvalidPointerCheck call to take function parameters.
Creating the call for the cling invalid check function required that
the function have a const void *, thus a cast was injected.
Also renamed some of the variable to be more specific and
self-explanatory.
2016-02-04 09:59:06 +01:00
Axel Naumann
6a4196e7c8 Do not assume int as underlying enum type (ROOT-7918). 2016-01-31 21:29:07 +01:00
Philippe Canal
7bcebf40ad Fix fatal typo.
The closing of the anonymous namespace was conditional (only if NDEBUG was not defined)
2016-01-28 22:59:07 +01:00
Axel Naumann
0e2029a0e4 Fix ROOT-7837 by silencing diagnostics.
Still assert if the failure is not because of an unparsable type name.
2016-01-28 20:44:08 +01:00
CristinaCristescu
6ade14763f Replaced the PointerCheckInjector's std::map data member with a llvm::DenseMap for efficiency reasons. 2016-01-28 15:12:50 +01:00
Axel Naumann
83ca41354e Disable access checks for value printing (ROOT-7426). 2016-01-16 20:29:05 +01:00
Elisavet Sakellari
ef6320070f Additional minor changes 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
e9f1240015 Small change in ASTImportSource.cpp 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
01a4526fc6 Edited test for Multiple Interps, and added some fixes 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
4ac0a10a3e Added test for MultipleInterpreters, and some changes. 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
8f51dd1617 Remove default values in IncrementalParser functions 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
b0bdcf4c56 First commit for the Multiple Interpreters. 2016-01-14 20:44:14 +01:00
Elisavet Sakellari
ee92892ad4 First commit for the Multiple Interpreters 2016-01-14 20:44:14 +01:00
CristinaCristescu
8495dc7dd8 Cosmetics of NullDerefProtectionTransformer + isDeclCandidate CXXMemberCallExpr case.
If we have a CXXMemberCallExpr we do not check the arguments of the call,
we only check the callee.
2016-01-14 20:44:14 +01:00
CristinaCristescu
b5594df690 Refactor NullDerefProtectionTransformer.
The class NodeContext was removed since collecting individual Stmts
is not necessary, due to the change of how the visiting of one
single Stmt is done, which now recurses on the children of the Stmt.
Thus, the AST is changed directly by the VisitX methods.

VisitCompoundStmt is not necessary since the CompoundStmt derives from
Stmt and the collection of Stmt of the CompounStmt is visited
through the children visitation.

VisitCXXMemberCallExpr is now covered by the recursive visiting in the
VisitCallExpr method.
2016-01-14 20:44:14 +01:00
CristinaCristescu
94dd1ea523 Visit Stmt children for null deref check.
The previous version of the Null deref visitor was defaulting to
VisitStmt when the Stmt type was unknown, thus allowing for some
types of Stmt X for which a VisitX was not implemented to default
to VisitStmt and not check the content of it. In order to check
any type of Stmt for possible subexpressions which contain s Stmt
that derefrences a Null, the VisitStmt was extended to check its
children.

Only the Stmt types, X, which directly containing a null deref expression
have an explicit VisitX with the exception of CXXMemberCallExpr,
because this type would otherwise default to VisitCallExpr which has
a different check for its structure.
2016-01-14 20:44:14 +01:00
CristinaCristescu
932860cbb2 Replace AST node with node containing NullDeref check and fix NullDeref/Iterator.C test.
Initially the NullDerefProtectionTransformer was prepending a
If statement before the possible Null derefrencing. This was
chenged by a runtime function call which included the check
for Null and invalid address memory, but was replacing the
whole AST node so the parent node of the Expr type would disappear,
resulting in a wrong AST. The correct solution was to replace the
SubExpr of the Expr that contained a possible Null derefrencing.
This was done by using the specific setters for each Expr type
that is detailed in the NullDeref Visiting.
2016-01-12 15:14:08 +01:00
CristinaCristescu
44aa4a6180 Add parameter description to avoid warning generation. 2016-01-07 16:29:07 +01:00
Axel Naumann
ba8e6b2834 Add install dir to cling include path; move -DCLING_VERSION.
The latter fixes CMake cling tests.
2016-01-02 20:48:01 +01:00
Philippe Canal
a11b9e384e Fix cling::utils::GetPartiallyDesugaredTypeImpl for C++14.
Fix cases (seen in roottest/cling/typedef/assertTypedefIter.C) where
a template parameter is an expression that is actually part of a
template parameter pack.  In this case we need to peek into the pack.
2016-01-02 20:48:01 +01:00
CristinaCristescu
d557ed9506 Doxygen compliant comment. 2015-12-18 14:29:05 +01:00
CristinaCristescu
e89f3d6e32 Remove injected ifstmt for invalid derefrencing.
The previous invalid refrence transformer injected if stmt for checking the argument derefrenced.
Now we return a runtime call that checks for validiting for derefrencing and injects the call
into the AST replacing the node where the deref happens with a call to the runtime function.
2015-12-18 14:29:04 +01:00
CristinaCristescu
5d6f86f805 Invalid referrencing runtime call casted to appropriate type. 2015-12-18 14:29:04 +01:00
CristinaCristescu
21b342105b Comment explaining function argument const cast. 2015-12-18 12:44:09 +01:00
CristinaCristescu
c5a42b19af Invalid referrencing runtime call casted to appropriate type. 2015-12-18 12:44:09 +01:00
Axel Naumann
a70623e7e3 Add dependency needed for DiagnosticCommonKinds.inc. 2015-12-18 10:15:18 +01:00
Axel Naumann
2023eac193 Put LINK_LIBS back, they are used by ROOT. 2015-12-16 20:29:22 +01:00
Axel Naumann
6eac3e3159 Define dependencies! 2015-12-16 20:29:22 +01:00
Axel Naumann
ca23c88748 Determine OptLevel for TargetMachine from CodeGenOpts. 2015-12-15 20:24:16 +01:00
Axel Naumann
9c0d626cda Use -O as set through arguments. 2015-12-15 20:24:16 +01:00
Axel Naumann
3f650b08c5 Revert "Set optimization level from -O argument when creating TargetMachine."
This reverts commit 73b3a1dbf9ef8760b9e6f335b7bbafbc21247555.
We'll use clang's parsing of -O... instead.
2015-12-15 20:24:16 +01:00
CristinaCristescu
fb8bc80796 Fix max 80 columns in cling files. 2015-12-15 20:24:16 +01:00
Yves Le Maout
62d51e5f8a Set optimization level from -O argument when creating TargetMachine. 2015-12-15 20:24:16 +01:00
Yves Le Maout
890e4b2e2a If -nostdinc++ was provided, do not determine standard library include paths. 2015-12-15 20:24:16 +01:00
Axel Naumann
9575ece7df Uniform member init. 2015-12-15 20:24:16 +01:00
CristinaCristescu
95e3dcf8ef Check for invalid pointer address access. 2015-12-15 20:24:16 +01:00
CristinaCristescu
b44cf929ba Cache the lookup of the runtime functions in the synthesizers of the transformers. 2015-12-15 20:24:16 +01:00
CristinaCristescu
7556d3814d NullDeref check changed from injection of if(stmt) to a runtime call. 2015-12-15 20:24:16 +01:00
Axel Naumann
25bbe0c617 Cache Dtor wrappers (used by ~Value); reduce calls to dlsym (ROOT-7840).
This fixes a PyROOT performance regression between 6.02 and 6.04, seen by ATLAS.

(cherry picked from commit ba4b0df02a91be4102e62fc76038711d188f07f3)

Conflicts:
	interpreter/cling/lib/Interpreter/Value.cpp
2015-12-15 20:24:16 +01:00
Axel Naumann
923b4ce39b Also strip the "runtime" part of the Interpreter exception here. 2015-12-15 20:24:16 +01:00
CristinaCristescu
1d46fe88d8 Remove runtime namespace from NullDerefException and rename RuntimeException.h to Exception.h.
(cherry picked from commit 234da8bfedce8661c2b8bc50f72632c240c4dfd8)
2015-12-15 20:24:16 +01:00
CristinaCristescu
8ab37ec3d6 Enable Baozeng Ding's NullDeref protection for ROOT; use exceptions.
The function HandleInterpreterException catches the NullDerefException.
Remove pre-exception longjmp code.
2015-12-15 20:24:15 +01:00
Vassil Vassilev
96b189e8d7 Remove new lines. 2015-12-15 20:24:15 +01:00
Philippe Canal
9a9004c501 Correct the name of bundle function of global initializer.
This correctly follow the clang commit afafe70f43dbb614f336ccbede1c4bbb132ec658
See https://root.cern.ch/gitweb?p=clang.git;a=commit;f=lib/CodeGen/CGDeclCXX.cpp;h=afafe70f43dbb614f336ccbede1c4bbb132ec658
and fixes the first attempt (75456cd17689730089526417c0d28ba4ed244f58).
2015-12-15 20:24:15 +01:00
Axel Naumann
30cc58a5c6 Reset diagnostics after parsing arguments: we shall issue an error but survive (ROOT-7619, ROOT-7614 and others). 2015-11-03 00:01:43 +01:00
Philippe Canal
81fef9a7b4 Add support for Parameter packs in type(name) normalization.
This fully resolve ROOT-7708.
2015-10-28 19:44:14 +01:00
Philippe Canal
2c9a79514e White spaces 2015-10-28 19:44:14 +01:00
Philippe Canal
b96301501e Remove unused variable 2015-10-26 19:14:52 +01:00
Philippe Canal
36e5b1eec0 Use isa (instead of dync_cast) for type testing 2015-10-23 18:22:26 +02:00
Philippe Canal
432884aada Add a callback during Transaction's rollback. 2015-10-22 14:56:16 +02:00
Philippe Canal
d58b99d1ed Must unload content before removing context from decl chain 2015-10-22 14:56:15 +02:00
Philippe Canal
5474fb5da7 When removing a definition decl, make the other forget about it 2015-10-22 14:56:15 +02:00
Axel Naumann
be55c83f9b Inline Value move ctor to enable the compiler to skip it. 2015-10-20 01:50:13 +02:00
Philippe Canal
26fdb651b9 PrimaryContext returns non null for forward decl, so we need to also grab the def.
This redo d78dac6 that was thought to be superseeded by ca32227
2015-10-15 22:45:06 +02:00
Philippe Canal
32bd423d59 We must pass the primary decl context to Sema's LookupQualifiedName [ROOT-7737].
This is guarded by an assert in Sema::LookupQualifiedName.
2015-10-15 21:33:13 +02:00
Philippe Canal
a0005a7484 Fail more elegantly in ValuePrinter 2015-10-09 19:11:05 +02:00
Philippe Canal
3182648f56 Suppress more diagnostics. 2015-10-05 03:24:41 +02:00
Philippe Canal
46c2ef299a Properly pop and restore (and clean) Parser::TemplateIds 2015-10-05 03:24:41 +02:00
Philippe Canal
975caef006 Push/pop value of Sema::InNonInstantiationSFINAEContext.
This avoid 'suppressed diagnostics to be nonetheless pick up for the SFINAE mechanism/implementation
2015-10-05 03:24:40 +02:00
Danilo Piparo
c85ce99057 Re-enable "In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType."
This reverts commit 944b1d4fed1851b67236be756094a68be26ae0c2.
2015-10-02 14:09:06 +02:00
Bertrand Bellenot
384c721750 Fix compilation errors on Windows (error C2065: 'constexpr' : undeclared identifier ) 2015-10-01 14:22:06 +02:00
Philippe Canal
8065dfa723 Support gcc 4.9.3's C++14-ish 2015-09-30 23:42:06 +02:00
Philippe Canal
47c7af8967 Fix doxygen comments 2015-09-30 16:51:02 +02:00
Philippe Canal
75fac59326 Coding conventions fixes 2015-09-30 16:41:12 +02:00
Philippe Canal
30352c97a3 Re-enable c00daa7 with handling of the case of 'missing' transactions.
This reverts commit 22c7eb4ae85145682bb0236b6b607188de174992.
2015-09-30 15:51:03 +02:00
Philippe Canal
1f0659d9b0 Remove warning message (intentional const cast) 2015-09-29 23:52:04 +02:00
Philippe Canal
9c88696445 Implement TCling::ResetGlobals to fix ROOT-7673.
Note we don't want to unload transaction so soon as this might remove the header files still needed
(they need to be removed by the library .... which is still a to-be-done feature)
2015-09-29 22:49:05 +02:00
Philippe Canal
70c402f585 Event quickFindType can lead to deserialization 2015-09-29 21:50:04 +02:00
Philippe Canal
50e1fe55cd Don't add spurrious const to a ref type 2015-09-29 19:18:04 +02:00
Philippe Canal
63f19daf03 Documentation justification for hand coded shortcut.
To handle 'Float_t*', quickFindType uses no memory (instead of 183B for findType) and is much faster
(6 times in this case), the cost is the additional ('unnecessary') checks in the cases not handled by
quickFindType.
2015-09-29 08:38:05 +02:00
Philippe Canal
cc7cfa6332 Extract routine quickFindType 2015-09-29 00:54:06 +02:00
Philippe Canal
2555f2e6e8 Remove debug statements 2015-09-29 00:54:06 +02:00
Philippe Canal
5ec73f0aa2 Extent and complete findType's use of quickFindDecl.
Requires to add code specific for builtins types (somehow not found by cling::utils::Lookup::Named).
White spaces fixes
2015-09-29 00:54:06 +02:00
Philippe Canal
426a1c4f4f Add more characters 'illegal' on quickFindDecl 2015-09-29 00:54:05 +02:00
Philippe Canal
795b215716 Use quickFindDecl in findType (need more adaptations) 2015-09-29 00:54:05 +02:00
Philippe Canal
2f40299656 Move findType below quickFindDecl 2015-09-29 00:54:05 +02:00
Philippe Canal
2aff147565 quickFindDecl: use more generic parameter name 2015-09-29 00:54:05 +02:00
Philippe Canal
c9b19691af Document quickFindDecl 2015-09-29 00:54:05 +02:00
Philippe Canal
5ecfd9525f fix scope. 2015-09-29 00:54:05 +02:00
Philippe Canal
b202613de5 Extract 'quick decl find' out of findScope 2015-09-29 00:54:05 +02:00
Philippe Canal
040bad9a53 Revert "In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType."
This reverts commit 5190ebeb2eb0ac527881ab1c91401b20f4e54b39.

It fails on roottest/root/meta/dictSelection:execAtlasTest2
2015-09-24 15:14:01 +02:00
Philippe Canal
f1fd8d0fd0 In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType.
When the type comes (directly or indirectly) from being used as a template paramater, it is decorated
by SubstTemplateTypeParmType which gets in the way of properly getting the name correct (leads to
'std::const string'.
2015-09-24 11:15:18 +02:00
Philippe Canal
df44a9d01d Use canonical type when making type based decision 2015-09-24 11:15:18 +02:00
Philippe Canal
569ef839cb Implement DeclCollector::HandleInvalidTagDeclDefinition.
This allow the transaction from noticing and removing invalid decl (appear during template instantiation)
2015-09-23 09:43:03 +02:00
Axel Naumann
b7ceb3550e Keep pending instants upon unload. Fixes CMS missing symbol. 2015-08-26 08:46:03 +02:00
Axel Naumann
dec5717d4c Fix printing of false! (And add a test.) 2015-08-21 12:23:04 +02:00
Boris Perovic
39f64ab7b7 Catch-all printValue implementation changed to enable correct invocation if only parent type overload exists (ex. if there is no overload for TF1*, compiler invokes the overload to its best parent overload match, in the worst case void*). Argument changed from reference to pointer to support this. isEnumType Coverity bug changed from if to assert (coding, not runtime error) Changed the way printValue is invoked in order to correctly cast Value to the needed value (e.g. LL -> short). Extracted value stays in scope while we execute printValue, because we use the address. 2015-08-20 17:06:02 +02:00
Boris Perovic
fc447d5fd5 Small improvements. nullptr -> nullptr_t for isNullPtrType 2015-08-18 18:08:20 +02:00
Boris Perovic
800c644352 Removed "VALID" after address output, fixes roottest. Various fixes based on comments after second round. 2015-08-18 18:08:20 +02:00
Boris Perovic
2d317b983d Fixes based on cling test suite ("make test"). 2015-08-18 18:08:20 +02:00