Commit Graph

530 Commits

Author SHA1 Message Date
Axel Naumann
14e101a3b1 Windows needs Windows.h instead of unidist.h. 2016-02-05 17:29:32 +01:00
Axel Naumann
a306d87760 Add santity check - compiled programs should not see this. 2016-02-05 11:44:09 +01:00
Axel Naumann
c2172523f4 Add missing #include <tuple>.
The tuple part will be moved to a separate header in the cling extra / overriding include path,
behind a #include_next <tuple>.
2016-02-04 18:14:08 +01:00
Danilo Piparo
359515e06e Remove usage of stringstream and reformulate iteration on tuple elements
in order to  stop the iteration and account for the empty tuple case with
one single specialisation.
We loop at compile time from element 0 to element TUPLE_SIZE - 1
of the tuple. The running index is N which has as initial value
TUPLE_SIZE.
2016-02-04 15:29:16 +01:00
Danilo Piparo
90fe0e262e Add to cling value printing capabilities for std::tuple and std::pair. 2016-02-02 12:59:25 +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
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
c5a42b19af Invalid referrencing runtime call casted to appropriate type. 2015-12-18 12:44:09 +01:00
CristinaCristescu
fb8bc80796 Fix max 80 columns in cling files. 2015-12-15 20:24:16 +01:00
Axel Naumann
2ebdea084b Fix CPP indentation. 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
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
Axel Naumann
a3a1e27b2f Improve doc wording, no functional change. 2015-10-23 21:16:12 +02:00
Philippe Canal
432884aada Add a callback during Transaction's rollback. 2015-10-22 14:56:16 +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
fdbc4b985c Remove debug characters 2015-10-15 17:09:17 +02:00
Philippe Canal
cb70c9d802 Fix value printing of TCollection objects.
The iterator for a TCollection currently return the content
(a TObject*) by value, preventing the usual mechanism from
working:
   error: cannot take the address of an rvalue of type 'TObject *'
        str += printValue(&(*iter));
                          ^ ~~~~~
so add a special case when this address taking fails.
2015-10-10 20:08:02 +02:00
Philippe Canal
75fac59326 Coding conventions fixes 2015-09-30 16:41:12 +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
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
63bc59dde6 Fixed the bug (missing internal::) from commit 279fc73896036900366fa1596ec4d624b9db1c05. 2015-08-18 18:08:19 +02:00
Boris Perovic
688ad34b3f Minor fixes around printValue, based on comments after the integration. 2015-08-18 18:08:17 +02:00
Boris Perovic
c44940b223 New printValue() integration (printing unified through overloading of printValue() function and template resolution). Modified tests to conform to the new prints. 2015-08-17 18:45:03 +02:00
Elisavet Sakellari
d2953ff9a6 Handling of multiple Redirection RAII's 2015-08-17 18:45:02 +02:00
Axel Naumann
dc2047e7c4 Replace Transaction::reset() by ~Transaction(). Replace RefillPool by new Transaction.
Simplifies code, removes duplication.
2015-06-08 14:58:29 +02:00
Axel Naumann
397f6fb9e9 Fix warning; make determineStorageType() static. 2015-04-07 09:39:25 +02:00
Axel Naumann
ca9ac1961f Accelerate costly Value functions by storing results. 2015-04-06 21:30:19 +02:00
Axel Naumann
8552299b66 Support DynamicLookup test resolver not resolving anything. 2015-04-01 12:09:19 +02:00
Axel Naumann
c91fffa352 Register IssuedDiags with topmost Transaction. 2015-03-17 14:06:39 +01:00
Axel Naumann
166032069e Emit Decls as DeclCollector sees them.
Now that we can easily revert Transactions' IR (by unloading their
module) we do not need to queue the Decls before emitting them.
This enables EndOfTU actions to be emitted seeminglessly, without
extra transactions, or explicit post-EndOfTU-emission: each
Transaction will have its TU finalized exactly once.

This in turn allows us to turn on Debug emission - which relies on
being invoked exactly once per Module.

Transformers must be invoked before emitting Decls. They are now
invoked for each Decl; WrapperTransformers are invoked when seeing
a wrapper decl. They do not see the "full transaction AST" anymore
- luckily none of our transformers requires this and actually become
simpler because of this change.

This also fixes a bug where the relative sequencing of parsed and
deserialized Decls was lost (parsed was emitted before deserialized).

Remove unused IRTransactions; they should really be llvm::Pass-es.
We don't have them anyway.

Disable a few transformations if the Decl isFromASTFile.

When reverting a Transaction, also revert its nested ones.

In the ValueExtractionSynthesizer, pass the ValuePrinter option as
int, instead of the transaction pointer - that might have changed
(at least its options) by the time we invoke the wrapper.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Explicit paths specified without -i or -o; assuming --only paths...
# rebase in progress; onto b3d9f92
# You are currently splitting a commit while rebasing branch 'declcollector-emits-v2' on 'b3d9f92'.
#
# Changes to be committed:
#	modified:   interpreter/cling/include/cling/Interpreter/RuntimeUniverse.h
#	modified:   interpreter/cling/lib/Interpreter/AutoSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/AutoSynthesizer.h
#	modified:   interpreter/cling/lib/Interpreter/CheckEmptyTransactionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/CheckEmptyTransactionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/DeclCollector.cpp
#	modified:   interpreter/cling/lib/Interpreter/DeclCollector.h
#	modified:   interpreter/cling/lib/Interpreter/DeclExtractor.cpp
#	modified:   interpreter/cling/lib/Interpreter/DeclExtractor.h
#	modified:   interpreter/cling/lib/Interpreter/DynamicLookup.cpp
#	modified:   interpreter/cling/lib/Interpreter/DynamicLookup.h
#	modified:   interpreter/cling/lib/Interpreter/IncrementalParser.cpp
#	modified:   interpreter/cling/lib/Interpreter/IncrementalParser.h
#	modified:   interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/TransactionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/TransactionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/TransactionUnloader.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValueExtractionSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValueExtractionSynthesizer.h
#	modified:   interpreter/cling/lib/Interpreter/ValuePrinterSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValuePrinterSynthesizer.h
#
# Untracked files:
#	.idea/
#	0001-Fix-llvm-merge-issue.patch
#	0002-Fix-warnings.patch
#	0003-Keep-weak-symbols-around-subsequent-transactions-mig.patch
#	T.cxx
#	T.cxx~
#	TMVA.root
#	a.out
#	boost.root
#	config/Makefile.depend~
#	core/textinput/src/textinput/TerminalDisplayWin.cpp.orig
#	ct.root
#	data.root
#	interpreter/cling/76fc2055249da7b03148a7d4197a279e9943f012.patch
#	interpreter/cling/lib/Interpreter/CIFactory.cpp~
#	interpreter/cling/lib/Interpreter/DeclCollector.h~
#	interpreter/cling/lib/Interpreter/DynamicLibraryManager.cpp~
#	modulemap-one-header-per-file.txt
#	osrm-routed
#	tiles.tar.bz2
#	tmva_class_example.root
#	tutorials/v3.root
#	weights/
#
2015-03-16 14:58:58 +01:00
Bertrand Bellenot
bb53e44094 Fix compilation errors on Windows
MSVC doesn't support fSpinLock=ATOMIC_FLAG_INIT; in the class definition, nor in the class constructor initializer list
2015-02-25 18:03:18 +01:00
martell
6383df2174 use size_t for void pointer cast 2015-02-23 00:31:28 +01:00
Axel Naumann
430a9c7473 Add non-const getParser(). 2015-02-18 14:51:21 +01:00
Axel Naumann
eb75ab36ef Add the transaction to define its lifetime.
This should be migrated to use unique_ptr in the interfaces instead
of relying on comments...
2015-02-11 10:57:48 +01:00
Axel Naumann
93e44e7273 Use ~Transaction() to unload its JITed symbols. 2015-02-11 10:57:47 +01:00
Axel Naumann
16fe3f49dc Replace use of ExecutionEngine by OrcJIT. 2015-02-11 10:57:47 +01:00
Axel Naumann
276ff16454 No DeclCollector in interface; much more efficient OnlyLex path. 2015-02-11 10:57:46 +01:00
Axel Naumann
b59de8a40a Adapt to clang/llvm changes (mostly ownership). 2015-02-11 10:57:43 +01:00
Axel Naumann
061cd37390 Provide __cxa_atexit replacement through custom MemoryManager.
On some platforms, global destructors are registered through a call to
__cxa_atexit(dtor, 0/*args*/, __dso_handle). While __cxa_atexit can be resolved
by the regular MemoryManager, __dso_handle (representing the "current shared
library" such that the corresponding atexit function can be called on its
dlclose) can not be resolved by MCJIT. Instead, we provide our own, poining to
the ExecutionEngine, which in turn holds a "current module" that corresponds in
spirit to the shared library handle.

__cxa_atexit, on the other hand, needs to be re-wired: the interpreter needs to
destruct globals upon its destruction, and those globals from a certain module
when that module is unloaded.

Both is done through a custom MemoryManager, significantly reducing the
complexity of the previous ("JIT without MC") implementation.

The custom MemoryManager also forwards in case of a unknown symbols to the LazyFunctionCreators instead of using the generic
ExecutionEngine::InstallLazyFunctionCreator() which has no effect with MCJIT.
2015-02-11 10:57:36 +01:00
Axel Naumann
baf51f6b04 Create a new llvm::Module per codegen'ed transaction.
MCJIT needs to finalize modules. To simplify the interface with MCJIT, each
transaction now has its own module. It gets created when the previous module
gets passed to the execution engine; the first one is created by
clang::CreateLLVMCodeGen(). CodeGen now releases the module such that it can be
added to the execution engine.

This enables simple use cases of cling with MCJIT; most notably cross-module
linking is still missing.
2015-02-11 10:57:34 +01:00
Axel Naumann
e34dec8664 Move Diag suppression to IncrementalParser.
This gets rid of the messy pulling-SourceLocations-out-of-thin-air and instead simply
uses begin and end of the relevant memory buffer where diags are meant to be suppressed.
2015-01-23 16:24:13 +01:00
Axel Naumann
ba995aca73 Add flag whether prompt-style diagnostics should be suppressed. 2015-01-23 16:24:12 +01:00