51 Commits

Author SHA1 Message Date
Vassil Vassilev
9b4ea193c0 If cling::Value is provided turn result evaluation on. 2014-04-14 09:09:01 +02:00
Axel Naumann
628618f2b9 Add test for copy ctor and dtor in Value for array-of-structs. 2014-04-11 09:00:01 +02:00
Vassil Vassilev
d1a416ddc0 When variadic return stmt doesn't have a return value, invalidate the calculation of the last expr for evaluation.
In the same cases we still need to synthesize the setValueNoAlloc, to initialize
the cling::Value to void.
2014-04-04 09:42:07 +02:00
Vassil Vassilev
c868ddfd49 In cases of cling::Value reuse we need to update its settings even if we evaluated void expression. 2014-04-02 16:56:58 +02:00
Axel Naumann
d00d9e8d54 Simplify; adapt to new Value. 2014-04-01 18:31:58 +02:00
Axel Naumann
574b7751f9 Test the behavior of the ValueExtractionSythesizer for objects.
Still missing: arrays incl arrays of objects.
2014-02-26 09:22:05 +01:00
Axel Naumann
efa8f37cd4 long double has "L" suffix. 2014-02-19 15:34:56 +01:00
Axel Naumann
6b3e713217 Test evaluation of long double. 2014-02-19 14:55:00 +01:00
Vassil Vassilev
e92088a41e If RHS is dependent - skip value extraction. Add a testcase for auto vars. 2014-02-19 14:22:58 +01:00
Vassil Vassilev
9749af417c The test should be run on 32 bit finally. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
460b8b43b1 We have more accurate results so adjust the test. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
980a1813cf typo. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
c963d9f520 Add var returns test case. 2014-02-18 17:22:58 +01:00
Axel Naumann
4f07ffa888 Refer to license in C files. 2014-01-07 12:02:58 +01:00
Axel Naumann
d240bd5de8 Refer to license in test and demo files. 2014-01-07 12:02:58 +01:00
Axel Naumann
47475c9934 Do not run the test at all on 32bit: it might or might not fail. 2013-12-17 15:29:49 +01:00
Axel Naumann
51f03371e1 Aggregate returns do not work on 32bit; see ROOT-5860. 2013-12-17 13:54:53 +01:00
Axel Naumann
020af968f0 Resolve Elab and TemplSpecTypes; use short name for dtor; test (ROOT-5839). 2013-12-12 21:46:51 +01:00
Axel Naumann
b0fe13d878 Test lifetime handling of StoredValue. 2013-12-11 12:14:52 +01:00
Axel Naumann
490f9084d3 Add test for Interpreter::compileFunction(). 2013-12-09 16:35:01 +01:00
Vassil Vassilev
26b0a13f81 Use the correct interface to check for emptiness. 2013-11-25 13:56:02 +01:00
Vassil Vassilev
64b1a77356 Fix the case when the decl doesn't need mangling, adapt the test to the new impl. 2013-10-29 20:19:23 +01:00
Vassil Vassilev
26eec6ab21 Now expected errors are printed out and filecheck cannot skip them. This is actually an improvement in newest llvm. In that case we don't need to run the test twice. 2013-10-14 09:11:38 +02:00
Vassil Vassilev
ffa77e6521 We cannot forward declare a function inside a function. 2013-10-14 09:11:38 +02:00
Vassil Vassilev
069a9d76c1 Remove unnecessary files that used to 'steer' the testsuite. 2013-09-27 14:33:05 +02:00
Vassil Vassilev
342918a4b9 Adapt to _Bool -> bool Use reg expr, because when building cling standalone we should still get _Bool. 2013-09-05 19:08:56 +02:00
Philippe Canal
f13c81470a We must have a function implementation to take its address 2013-08-31 20:49:07 +02:00
Philippe Canal
fc90db23ba In ReturnSynthesizer add better support for RecordType.
When we dectect that the last expression is a record type and is not
a temporary, we now return it by reference, hence avoiding an unnecessary
and sometimes impossible (cout) copy.   If it is a temporary we still
return a 'copy'.
2013-08-31 20:49:07 +02:00
Vassil Vassilev
8a6adff938 Make sure that the value is valid.a 2013-08-07 17:58:57 +02:00
Vassil Vassilev
96dbd7d963 Remove the expected error. We don't expect error there. The declared function has an address, which could be evaluated. 2013-08-07 17:58:57 +02:00
Vassil Vassilev
6604b6b763 Some transactions don't have a wrapper. 2013-06-25 09:30:32 +02:00
Vassil Vassilev
78ea68614a Fix syntax errors in the test.
I DO NOT STILL UNDERSTAND HOW THAT WAS HIDDEN BY CLING's TESTSUITE. We should
investigate seriously these issues.
2013-06-25 09:30:32 +02:00
Axel Naumann
56e2be3e6f Add library path.
git-svn-id: http://root.cern.ch/svn/root/trunk@49350 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-25 16:22:23 +00:00
Vassil Vassilev
fc0f602a9e Add more checks.
git-svn-id: http://root.cern.ch/svn/root/trunk@49319 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 15:01:35 +00:00
Vassil Vassilev
4a809957be Add test.
git-svn-id: http://root.cern.ch/svn/root/trunk@49316 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 13:12:08 +00:00
Vassil Vassilev
8040f69fc3 Fix the test. In that particular case in ReturnSynthesizer we check whether the
type is trivially copiable and cling::StoredValueRef is not.
We could check for a copy ctor (which is defined in that type), however, that is
not important at the moment. We can readd that logic on use-case.


git-svn-id: http://root.cern.ch/svn/root/trunk@47825 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 16:10:48 +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
3b59fceed9 Test r47166:
return 12;
as alterative to
12;


git-svn-id: http://root.cern.ch/svn/root/trunk@47168 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 14:06:03 +00:00
Vassil Vassilev
d70f4b6173 Fix broken by construction test.
git-svn-id: http://root.cern.ch/svn/root/trunk@46858 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-27 21:42:00 +00:00
Vassil Vassilev
4fd8ccc00d Rollback the transaction if there is an error occurred in one of the transformers.
git-svn-id: http://root.cern.ch/svn/root/trunk@46826 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 12:56:49 +00:00
Vassil Vassilev
d132d3d5ba evaluate now builds DeclRefExpr if there is DeclStmt.
Don't run the wrapper function when the transaction was rolled back.


git-svn-id: http://root.cern.ch/svn/root/trunk@46674 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 12:23:34 +00:00
Vassil Vassilev
7f6039444b When we evaluate we *must* provide a value where the evaluated result to be stored
git-svn-id: http://root.cern.ch/svn/root/trunk@46642 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 12:24:04 +00:00
Vassil Vassilev
f48a4881cd Add super efficient execute function. It doesn't do any fancy things with the
declarations - it just compiles and runs given expression or statement.


git-svn-id: http://root.cern.ch/svn/root/trunk@46636 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 11:56:20 +00:00
Vassil Vassilev
ff1861cfc2 Lit runs cling with --nologo.
git-svn-id: http://root.cern.ch/svn/root/trunk@46635 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 11:55:04 +00:00
Axel Naumann
a4ec8a554f Check for variables injected throug process being available on the prompt.
Check that redecl causes an error -- only the whole verify thing doesn't actually verify!
Also, the initializer should end up in the Value returned by evaluate; it's not!


git-svn-id: http://root.cern.ch/svn/root/trunk@46626 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 21:34:59 +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
Vassil Vassilev
b95f52a9f2 remove the inclusion of CompilerInstance
git-svn-id: http://root.cern.ch/svn/root/trunk@46289 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-03 12:57:48 +00:00
Axel Naumann
fe430cd40d Add tests for Interpreter::getAddressOfGlobal().
Fix it for the JIT case.


git-svn-id: http://root.cern.ch/svn/root/trunk@46146 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-24 15:16:36 +00:00
Axel Naumann
268a844e25 Re-apply r45839; got lost during move of cling
git-svn-id: http://root.cern.ch/svn/root/trunk@45870 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 15:35:00 +00:00