38 Commits

Author SHA1 Message Date
Axel Naumann
b91c987027 Fix value printing for functions. Needs test! 2014-05-28 18:09:57 +02:00
Vassil Vassilev
ec31eb9db8 Test value printing of template constructs 2014-05-22 11:13:55 +02:00
Bertrand Bellenot
2b34bf819e Update cling test using .help to match the new help format 2014-05-21 17:18:57 +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
cefb472b5f Update the test to more generically 'detect' the version. 2014-05-09 15:28:06 +02:00
Axel Naumann
d00d9e8d54 Simplify; adapt to new Value. 2014-04-01 18:31:58 +02:00
Axel Naumann
ed1069786f Improve version string; adapt test. 2014-03-05 09:46:09 +01:00
Axel Naumann
40be9385f3 From Cristina: tests redirection. 2014-03-02 19:45:00 +01:00
Axel Naumann
9c73790d79 Test decl extraction of const enum.
And uncover a new bug: k2 is not visible, now ROOT-6095.
2014-02-19 15:59:01 +01:00
Axel Naumann
c78aa3b7fb Test value printing of a long double. 2014-02-19 14:55:00 +01:00
CristinaCristescu
0b3a2d5ef0 Correct comment. 2014-02-18 17:08:57 +01:00
CristinaCristescu
7605c85f5c Fix Cling Regression test. 2014-02-18 17:08:57 +01:00
CristinaCristescu
091a2aabaf Add correct test for unanamed decls for cling. 2014-02-07 23:12:58 +01:00
CristinaCristescu
aadc2db22c Add test for unnamed decls for cling. 2014-02-07 23:12:58 +01:00
Axel Naumann
d240bd5de8 Refer to license in test and demo files. 2014-01-07 12:02:58 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Vassil Vassilev
069a9d76c1 Remove unnecessary files that used to 'steer' the testsuite. 2013-09-27 14:33:05 +02:00
Vassil Vassilev
92098d2046 Add XFAILing test, exposing issue ROOT-5248. 2013-06-25 09:30:31 +02:00
Vassil Vassilev
d5cf020d2b Add future test, checking the unnamed macro support. 2013-06-05 16:26:50 +02:00
Axel Naumann
925cdd2400 Update to git "version" (which currently is "$Id$"...) 2013-05-08 15:38:21 +02:00
Vassil Vassilev
99dfb99f35 Do not print the address of the temporary value of an enum constants.
For example, when we have enum e {e1=1}; and we do e1 on the prompt we got the 
address of e1 and we printed it out. However, this doesn't make sence because we
cannot use it later, because it is destroyed.


git-svn-id: http://root.cern.ch/svn/root/trunk@48850 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-07 23:29:10 +00:00
Vassil Vassilev
1ae610b211 Fix savannah #99234.
The issue we experienced is that we couldn't pipe the output in the terminal.
The reason is that we were using llvm::outs() which closes explicitly the file
descriptor (thanks Axel for the help debugging).
We introduce our custom stream, which keeps the file descriptor open so that
we can use it in pipes. For debugging purposes, however we use/should use llvm::errs()

The lesson learned:
DONT USE LLVM::OUTS() ANYMORE!


git-svn-id: http://root.cern.ch/svn/root/trunk@48316 27541ba8-7e3a-0410-8455-c3a389f83636
2013-01-17 15:27:14 +00:00
Vassil Vassilev
a81a028269 Add simpler testcase. The test is marked as XFAIL because of another bug.
git-svn-id: http://root.cern.ch/svn/root/trunk@48121 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-19 10:59:04 +00:00
Axel Naumann
dac8f76e3e Showcase https://savannah.cern.ch/bugs/index.php?99210
and likely also https://savannah.cern.ch/bugs/?99234
Use a test case where RAII is enforced and copying is not an option (instance count).


git-svn-id: http://root.cern.ch/svn/root/trunk@47847 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-05 11:12:52 +00:00
Vassil Vassilev
a530a63d15 Readd custom meta command support.
git-svn-id: http://root.cern.ch/svn/root/trunk@47776 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-02 19:01:02 +00:00
Vassil Vassilev
1a07e07155 Add sane test case testing capital x.
git-svn-id: http://root.cern.ch/svn/root/trunk@47757 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 13:07:07 +00:00
Vassil Vassilev
810fd5f060 Make sure that we have proper case preventing such scenario as from today.
git-svn-id: http://root.cern.ch/svn/root/trunk@47754 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 01:14:53 +00:00
Axel Naumann
47c2be1200 Handle ValuePrinting of char* 0 without crashing.
git-svn-id: http://root.cern.ch/svn/root/trunk@47378 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-16 20:25:34 +00:00
Axel Naumann
f0f33b18b4 Test array printing
git-svn-id: http://root.cern.ch/svn/root/trunk@47175 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 17:17:27 +00:00
Axel Naumann
716729e5eb Don't append "const" for rvalues for increased CINT compatibility.
Might re-introduce later.


git-svn-id: http://root.cern.ch/svn/root/trunk@47171 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 16:15:35 +00:00
Axel Naumann
909bc42884 [5] now becomes * because we use the wrapper return type.
git-svn-id: http://root.cern.ch/svn/root/trunk@47170 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 16:13:02 +00:00
Axel Naumann
2f0d47e0b7 Teach the ValuePrinter to print arrays.
Accept that Value's type is not the last Expr's type (e.g. const char[5]) but whatever the wrapper returns, (e.g. const char*).
Print StoredValueRefs recursively.
Add mechanism to suppress newlines (improves readability for nested calls)


git-svn-id: http://root.cern.ch/svn/root/trunk@47169 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 16:05:30 +00:00
Axel Naumann
0269fc8b08 Add test for r47002: ValuePrinting of function ptrs.
git-svn-id: http://root.cern.ch/svn/root/trunk@47003 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 13:40:27 +00:00
Vassil Vassilev
21da904ea7 Make sure that the bug won't be reintroduced again.
git-svn-id: http://root.cern.ch/svn/root/trunk@46550 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-15 13:57:36 +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
Axel Naumann
3ec1741cf9 Add cling::StoredValueRef: a ref-counted value with automatic storage management.
Update Interpreter to use that instead of cling::Value.
This fixes an issue where the called neded to guess the return type of the wrapper function, such that for instance Interpreter::Evaluate() has storage for the wrapper's aggregate SRet return value if needed.
Instead, the Interpreter now allocates the proper storage for return values, and hands out references to it.
StoredValueRef is tiny (8bytes on 64bit Linux); default allocation is cheap.

Update TCintWithCling and friends; don't pass the returnValue in if the caller does not need it.
TClingCallFunc: provide storage for fArgs.


git-svn-id: http://root.cern.ch/svn/root/trunk@46334 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 12:09:51 +00:00
Axel Naumann
27ed0045e2 Merge r45833, r45837 that got lost during move of cling
git-svn-id: http://root.cern.ch/svn/root/trunk@45872 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 15:41: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