Commit Graph

79 Commits

Author SHA1 Message Date
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
Vassil Vassilev
655454b7d5 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-05 16:26:50 +02:00
Vassil Vassilev
052976bf88 endTransaction should take a transaction to be ended.
Parsing code in ROOT can lead to lookups which open a nested transactions. Ending
the current transaction in these cases is misleading because usually the
transaction that is expected to be ended is different.

Add an argument to endTransaction to disambiguate. Please note that this fixes
the regular cases of ROOT autoloading.

One of the remaining issues is autoloading of classes, which are passed in as
template arguments. The second remaining is autoloading of classes residing in
unnamed namespaces. Eg. MyNamespace::MyClass, where the diagnostic is issued upon
seeing that MyNamespace is unknown.
2013-04-27 01:52:55 +02:00
Vassil Vassilev
eff367e1b8 Add a fixme.
git-svn-id: http://root.cern.ch/svn/root/trunk@49142 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-09 09:04:30 +00:00
Vassil Vassilev
863970c3ba Include/Fwd decl cleanup.
git-svn-id: http://root.cern.ch/svn/root/trunk@49141 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-09 09:03:54 +00:00
Axel Naumann
77ba6929b0 v5 of patches.
Remaining:
* callfunc issues finding functions
* vtable issues (likely related)
* in stressHistogram: Test  3: Projection with Range for Histograms and Profiles................OK
  Error in <TStreamerInfo::Build>: TProfile, unknown type: EErrorType fErrorMode


git-svn-id: http://root.cern.ch/svn/root/branches/dev/root6-pch@48858 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-11 13:11:15 +00:00
Vassil Vassilev
009338beb7 Since cling::Transaction is public and the fact that on commit of transaction a
new transaction could be triggered, every compile should return the transaction
that it actually compiled. I.e. the cling::IncrementalParser::getLastTransaction
in many cases might not be the transaction we expect. For example in ROOT's case
plugin manager is triggered for some reason and the last transaction is not the
one that I'd personally expect.
This should be fix roottest/.../runMemory.C


git-svn-id: http://root.cern.ch/svn/root/trunk@47465 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 03:26:52 +00:00
Vassil Vassilev
76975bf2da Improve cling's transaction model. For now a bit hackish because it doesn't
actually support proper nesting of transactions.
(begin|end)Transaction return the transaction began or ended, which simplifies
interaction in case of nested transactions (coming from the autoloading)

Implement new function which transforms the single-linked list into a vector of
transactions for debugging purposes only.


git-svn-id: http://root.cern.ch/svn/root/trunk@47290 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-14 22:06:58 +00:00
Vassil Vassilev
cbd2ae5bac Keep just the head and the tail of the single-linked list.
git-svn-id: http://root.cern.ch/svn/root/trunk@46683 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 14:17:20 +00:00
Vassil Vassilev
da3a51f5f8 Make the transaction class single list.
git-svn-id: http://root.cern.ch/svn/root/trunk@46676 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:29:03 +00:00
Vassil Vassilev
c5a8df6c88 Prepare cling for fixing bug #98146. In principle the bug could be fixed in 10
seconds, but I don't like where EvaluateInternal is going.
At first place it shouldn't do any smart guessing what the transformers would do.
Second it shouldn't try to attach expression evaluation (storing the result in 
cling::Value) while preparing for value printing.

To sum up:
* Simplify the old craft in EvaluateInternal
  - Move the value printing logic into the value printer transformer. 
  - Move the expression evaluation login (mainly coming through the 
Interpreter::evaluate interface) into separate transformer.
* Attach the new transformer to the list of transformers (the size of it was 
increased as well.)
* Add new compilation option switch that the new transformer will react on.
* Turn on the switch where necessary.
* Simplify value printer logic. Now everything is at one place, which makes it
simpler and easier to debug.
* Make IncrementalParser::Parse to take compilation options' reference instead of
constructing it's own.
* As consequence of the new implementation - two bugs in the testsuite were 
uncovered. Propose a fix for them.
* Improve documentation.
* TODO: There is some code duplication, which will be factored out soon.


git-svn-id: http://root.cern.ch/svn/root/trunk@46549 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-15 13:42:09 +00:00
Vassil Vassilev
e087402f78 * Implement interpreter callbacks, which the Interpreter owns.
* Implement new callback functions - on transaction committed and transaction unloaded.
* Publish the Transaction class so that it can be visible by TCintWithCling.
* Publish the CompilationOptions needed by Transaction.
* Fix the references of Transaction and CompilationOptions.
* Forward declare where possible.
* Add missing keywords.
* Improve include style.


git-svn-id: http://root.cern.ch/svn/root/trunk@46264 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-02 10:30:25 +00:00
Axel Naumann
05ba8a3a07 Move cling from cint/ to interpreter/ (Will add a "we have moved" readme to cint/cling.)
git-svn-id: http://root.cern.ch/svn/root/trunk@45844 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 09:37:39 +00:00