Commit Graph

62 Commits

Author SHA1 Message Date
Axel Naumann
2e4b59990d Move BackendPasses to IncrementalExecutor.
They need the TargetMachine - and that's in the IncrementalExecutor.
2016-11-15 16:44:32 +01:00
Axel Naumann
3711cd0658 Unloaded Decls are now put back into CodeGen, no need to mark used. 2016-11-07 13:02:51 +01:00
Frederich Munch
60ecba7d61 Make CIFactory a namespace, not a class.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
5ee1cfb7c3 Refactor all argument parsing into InvocationOptions.cpp.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Axel Naumann
762942581e Remove unused function IncrementalParser::Parse(). 2016-07-22 16:14:11 +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
CristinaCristescu
1cb874532b Correct DiagnoseIfInterpreterException in iterpreter. 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
Elisavet Sakellari
8f51dd1617 Remove default values in IncrementalParser functions 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
Axel Naumann
3136974871 Fix doxygen warnings. 2015-03-20 15:45:03 +01:00
Axel Naumann
8497d89e4a Spell !.size() as .empty(). 2015-03-20 12:43:51 +01:00
Axel Naumann
fa573cf5de Inform commitTransaction() about the ParseResult. 2015-03-18 15:15:01 +01:00
Axel Naumann
fc9b3aa997 Separate Transaction* and parser success: a nullptr Transaction* was ambiguous. 2015-03-16 14:58:58 +01:00
Axel Naumann
260f8d4f2a Now that parsing also emits, non-parsed Decls need to be emitted "by hand". 2015-03-16 14:58:58 +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
Axel Naumann
39e505288b Improve and re-use existing addTransaction(). 2015-02-18 14:51:21 +01:00
Axel Naumann
4bc5c13beb Add backend passes back in. Fixes (some of) MacOS.
Once clang BackendUtils become more relevant for our use case
we should switch to that, instead of simulating its behavior.
2015-02-11 22:05: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
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
899a5dde32 Use the end of the latest memory buffer as Diag pop point.
We might have a memory buffer taht causes the creation of other memory
buffers - which hang from our parent memory buffer, and get parsed before
we pop the diagnostics. The pop location must thus not be the end of our
memory buffer - because those later memory buffers might have created
later DiagStorePoints. Simply use the end location of the last memory
buffer - there cannot be any later Diag pop than that within our call.
2015-01-23 16:24:14 +01:00
Vassil Vassilev
22f891e9be llvm::OwningPtr to std::unique_ptr. 2014-08-14 14:56:38 +02:00
Philippe Canal
576ca3ca96 Remove trailing spaces 2014-08-13 16:08:36 +02:00
Axel Naumann
af66248191 Accessor to current transaction, useful e.g. for callbacks. 2014-05-14 15:32:58 +02:00
Vassil Vassilev
ffc9fe50b5 Disable useless warnings only for the wrapper functions.
We simulate programatically:
void __cling_Unique {
  #pragma push
  #pragma ... ignore ...
  {code}
  #pragma pop
}
2014-04-01 17:09:58 +02:00
Vassil Vassilev
4d5e607256 Merge unloadTransaction and rollbackTransaction. 2014-03-24 14:25:58 +01:00
Axel Naumann
5045248a76 Dealy running static init until gCling is defined; local_cxa_atexit() needs it. 2014-03-04 19:55:00 +01:00
Axel Naumann
6325e7ed19 Keep trying to remap __cxa_atexit until succeeded.
__cxa_atexit is generated by clang::CodeGen upon seeing the first static
destructor. Instead of trying to provoke that we just continue to search for it.
2014-03-04 19:55:00 +01:00
Axel Naumann
baca204185 Simplify cxa_atexit(), first part.
Remove trigger__cxa_atexit(), we will just remap until successful.
Remove unused dso parameter.
Instead of friending just provide a function.
Pass a transaction, the typesafe way.
2014-03-04 19:54:59 +01:00
Vassil Vassilev
1bf7c49086 Move unloading of N transactions outside IncrementalParser 2014-02-27 12:49:11 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Vassil Vassilev
91c54bda2e Add more handy interface that takes a number of transactions to be rolled back. 2013-10-29 20:19:25 +01:00
Axel Naumann
b8adbb24b5 DGRs can have a decl to be emitted, another not to be emitted.
When this oce comes from a #include through ParseForModules():
class A{} g;
A should be emitted, but not g.
This is now tested in roottest/root/meta/templateAutoload.
2013-09-13 10:44:52 +02:00
Vassil Vassilev
59ced3f193 Move codegenning of deserialized declarations in the IncrementalParser.
We had two different codepath for codegeneration. The first one was for
declarations that came from text and the second one for declarations that came
from 'ExternalSource' such as PCH. In the latter case we had to do some
extra equilibristics to emulate a PCM and ignore generating code for decls with
static storage, because it will clash with the loading of the library that already
contains them.

The advantage of the new implementation is that instead of communicating the
deserialized decls to ROOT via some fishy deserialization listeners we can use
the cling::Transaction as we use it for decls that came from code.
2013-08-28 16:44:01 +02:00
Vassil Vassilev
277988492f Commit forgotten file. Documentation improvements. 2013-08-22 16:02:53 +02:00
Axel Naumann
2f15384a4b Use deque: we do not require the MemoryBuffers do be consecutive. 2013-08-18 10:54:53 +02:00
Vassil Vassilev
a571d69951 Finally: enable the asserts that assure very conservative integrity checks. 2013-08-08 15:01:53 +02:00
Vassil Vassilev
f857ed0f7c Already implemented, remove the fixme. 2013-08-07 17:58:57 +02:00
Vassil Vassilev
2bab03fa58 Use the transaction pool to reduce the number of transaction allocations. Add extra assertions. Simplify *a lot* the implementation. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
31d26f7371 Add debugging printout. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
b1c501daf8 Separate concerns. 2013-08-02 17:34:56 +02:00
Axel Naumann
0c74a310d8 Rebase to master/HEAD; split commitTransaction(); select needed parts in emitAllDecls(). 2013-06-28 00:33:17 +02:00
Axel Naumann
0e6302f92c Split CodeGen and UsedAttr from commitTransaction into separate functionw. 2013-06-28 00:33:16 +02:00
Baozeng Ding
1c2f34afd1 Baozeng Ding - Split the transformers into two kinds: AST and IR
The AST transformers should be run *before* codegen, whereas the IR transformers
should be run *after*
2013-06-26 20:57:05 +02:00
Vassil Vassilev
65df970480 Store the transactions in a std::deque. More effecient because it doens't do copy (like std::vector) when the capacity is exceeded. 2013-06-25 09:30:30 +02:00
Axel Naumann
778d10db5a Doc: parameter capitalization 2013-06-22 13:01:16 +02:00
Axel Naumann
502afb5e91 Move codegen forcing to IncrementalParser, skip transformers and callbacks. 2013-06-21 09:27:56 +02:00
Vassil Vassilev
1340b29437 Set the llvm::Module earlier so that the TransactionTransformers could potentially use it. 2013-06-14 09:57:52 +02:00
Vassil Vassilev
07b73f46dd Revert "Store the transactions in a std::deque."
This reverts commit b5a175d4cf6618e74cb40c898bdf805f640c7820.
2013-06-05 16:26:51 +02:00