Commit Graph

28 Commits

Author SHA1 Message Date
Vassil Vassilev
e5a04f9375 Expand 'properly' VPAuto into whatever the value printer synthesizer desided to do. 2014-05-19 16:05:57 +02:00
Vassil Vassilev
68d86e2537 Add proper assert. 2014-05-19 16:05:57 +02:00
Vassil Vassilev
5167e8f992 Improve the C version of the value printing. 2014-05-18 18:08:59 +02:00
Vassil Vassilev
3e5af816aa No need to synthesize anything anymore. 2014-05-18 18:08:58 +02:00
Vassil Vassilev
c86fbc27b9 Rewire the dumping on cling::Value to its new implementation.
Dump cling::Value within setNoAlloc routines because this is its lifespan,
otherwise gets deleted if nobody requested it. I.e it was created only for
value printing purposes.

Dump cling::Value outside setWithAlloc because the actual value is not put inside
until the call to ::new finishes, thus we need to do it outside, i.e in EvaluateInternal.

Switch on the ValueExtraction synthesizer even when 'just' value printing. We
depend on it. Must be factored out properly in one class.

Stop attaching the value printing template magic, which didn't work in some cases.

Update the ref file, because now there is better type information.

Adapt the user-defined printout functions (TDatime).
2014-05-18 18:08:58 +02:00
Vassil Vassilev
245f098fe1 Record the outcome of VPAuto (auto detection if a value should be printed out). 2014-05-18 18:08:58 +02:00
Vassil Vassilev
39f42b02cd Instead of passing the Expr*, which is being value printed, pass the Interpreter* and deduce the expr. 2014-05-18 18:08:58 +02:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Vassil Vassilev
f685a0bc71 Remove unused variable. 2013-08-09 09:35:53 +02:00
Vassil Vassilev
ecf7e03df8 Not using real SourceLocation is bad, especially in -verify mode. In the value printer synthesis we have real source location of the expression that we are replacing. Use its begin and end location. This will allow us to remove the XFAIL-ed test that now passes. 2013-08-08 22:55:54 +02:00
Vassil Vassilev
1ee8915aa6 Since we enforced very strict policy when declarations should be added to a transaction we have corner cases which need to be handled. For example in the transaction transformers there could be template instantiations happening and the transaction should be open and expecting decls. 2013-06-25 09:30:34 +02:00
Axel Naumann
f507a8da1b Rename public value printer function to cling::printValue. 2013-05-15 11:43:12 +02:00
Axel Naumann
eb087a315f Fix assert message. 2013-05-15 11:43:12 +02:00
Vassil Vassilev
782d2568ea Factor our common functionality and replace CreateTypeSourceInfo with getTrivialTypeSourceInfo.
git-svn-id: http://root.cern.ch/svn/root/trunk@49347 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-25 12:48:15 +00:00
Axel Naumann
8416a9183c Simplify: don't loop over everything to find the WrapperFD but use the one stored in the transaction.
git-svn-id: http://root.cern.ch/svn/root/trunk@47163 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 12:47:05 +00:00
Axel Naumann
61e2c2a788 Don't run ValuePrinter on unknown QualTypes.
Implement type printing for function pointers: just cast them to void*, but do keep the original expression's type so we can print the type correctly.


git-svn-id: http://root.cern.ch/svn/root/trunk@47002 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 13:33:59 +00:00
Vassil Vassilev
24cdb599f7 In many modes (eg like evaluate and value print) we need to find the last
expression in the wrapper function and do things with it. In some cases we 
must consider variable declarations as expressions (eg. int i = 5;) and take
the l-value and build a DeclRefExpr and return it.
Extract that common functionality out in a utility function and call it whenever
needed.


git-svn-id: http://root.cern.ch/svn/root/trunk@46668 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 09:22:36 +00:00
Vassil Vassilev
94904e14ad Revert changes and add proper fix for the coverity issues.
git-svn-id: http://root.cern.ch/svn/root/trunk@46614 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 14:53:36 +00:00
Vassil Vassilev
3a180eb6b5 Remove confusing part of the comment.
git-svn-id: http://root.cern.ch/svn/root/trunk@46594 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 08:54:00 +00:00
Vassil Vassilev
ec129305af Centralize the unique name prefix (the names generated by the interpreter use it)
and provide utility function which checks if a decls has such name.


git-svn-id: http://root.cern.ch/svn/root/trunk@46593 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 08:52:24 +00:00
Vassil Vassilev
32a2b46db8 Use more meaningful compare instead of find.
git-svn-id: http://root.cern.ch/svn/root/trunk@46590 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 08:15:25 +00:00
Vassil Vassilev
aaab1dca48 We need to analyze the whole transaction. (Thanks Axel!)
git-svn-id: http://root.cern.ch/svn/root/trunk@46589 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 07:38:08 +00:00
Vassil Vassilev
ae3a0dfdad * Factor out the duplicate code.
* Avoid alloc/dealloc of the entire body of the function (the CompoundStmt) by
using ugly iterator + offset tricks.


git-svn-id: http://root.cern.ch/svn/root/trunk@46553 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-15 16:57:53 +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
ac49ac695f Initialize the variable to avoid dereferencing 0 (cid #47244)
git-svn-id: http://root.cern.ch/svn/root/trunk@46535 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-14 14:53:39 +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
Vassil Vassilev
7c08e8c678 Get rid of interpreter pointer in one of the transformers.
git-svn-id: http://root.cern.ch/svn/root/trunk@46017 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 13:13:22 +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