Commit Graph

699 Commits

Author SHA1 Message Date
Vassil Vassilev
38a05dd1df We don't need to add header search path for that particular test.
git-svn-id: http://root.cern.ch/svn/root/trunk@47779 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-02 19:25:49 +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
Philippe Canal
6fbf8745a2 Add minimal test of findClassTemplate
git-svn-id: http://root.cern.ch/svn/root/trunk@47773 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-02 06:50:03 +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
Vassil Vassilev
8cf9ab9121 Add test case for an item on my TODO list.
git-svn-id: http://root.cern.ch/svn/root/trunk@47516 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-21 01:15:58 +00:00
Axel Naumann
c197c04fb6 DiagConsumer::Begin/EndSourceFile() are used to switch from "parsing command line flags" to "parsing source files" more; not to signal a new source file to the diag client.
Switch BeginSourceFile() on after having parsed Interpreter internals.
Switch it off (EndSourceFile()) in ~Interpreter.
Indentation.

Now that we handle diags appropriately, test/ErrorRecovery/MetaProcessor.C fails; repair it.


git-svn-id: http://root.cern.ch/svn/root/trunk@47476 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 13:21:00 +00:00
Axel Naumann
1546d01ca3 Make test more verbose; fix directory for library.
git-svn-id: http://root.cern.ch/svn/root/trunk@47430 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-19 10:59:40 +00:00
Vassil Vassilev
9fce4384b9 Add test exposing the problem with the partial code generation.
git-svn-id: http://root.cern.ch/svn/root/trunk@47417 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-18 22:56:46 +00:00
Axel Naumann
10c0ac8711 Don't free all JITted functions, only those that are referencing an unresolved symbol.
Thus also no need anymore to collect all jitted functions through a function JIT listener.
Sadly, recompilation of them will pick up the existing stub instead of actually recompiling.
Don't use StringRef.data() where we need a 0-terminated string for FindFunctionNamed().
Be explicit about what symbol is triggering an unresolved symbol.
Update test suite.


git-svn-id: http://root.cern.ch/svn/root/trunk@47398 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-17 16:28:14 +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
bb0cacfb13 More rvalue-const removal
git-svn-id: http://root.cern.ch/svn/root/trunk@47173 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 16:38:14 +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
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
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
e5b8645bda Disable test for now.
Right now the issue is not that urgent. We will have to revisit and rethink the
test case.


git-svn-id: http://root.cern.ch/svn/root/trunk@46859 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-27 22:20:01 +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
2908e7f9e4 Do not issue error in case: .x MyFile() - where no string is between the parenthesis.
git-svn-id: http://root.cern.ch/svn/root/trunk@46851 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-27 19:57:29 +00:00
Philippe Canal
d1f4b8c39e Add code and testing for classes declared inside an anymous namespace
git-svn-id: http://root.cern.ch/svn/root/trunk@46841 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 19:51:56 +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
Axel Naumann
835bb9fa1c Try to fix intermittent test failure (library not yet built)
git-svn-id: http://root.cern.ch/svn/root/trunk@46730 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-23 07:25:45 +00:00
Philippe Canal
e60b8ce424 extend testing of typedef to reference
git-svn-id: http://root.cern.ch/svn/root/trunk@46679 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:33:38 +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
5b30c1e744 Why we didn't see that before. FileCheck is consuming the issued diagnostics,
which per se is terrible...


git-svn-id: http://root.cern.ch/svn/root/trunk@46669 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 10:07:41 +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
Vassil Vassilev
2b27986ff9 Totally wrong assumptions. Pipe everything in FileCheck and we are done.
git-svn-id: http://root.cern.ch/svn/root/trunk@46633 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 10:25:24 +00:00
Vassil Vassilev
e8560dc77f This is definitely expected to fail.
git-svn-id: http://root.cern.ch/svn/root/trunk@46630 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 09:35:38 +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
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
Philippe Canal
0701fb4621 Update the test now that lookupFuncProto does overload resolution. Explicitly test paramter that are reference to object. Test case where we request only the non defaulted argument.
git-svn-id: http://root.cern.ch/svn/root/trunk@46455 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-11 00:07:55 +00:00
Vassil Vassilev
9d654b26f9 No need to enable/disable, check for enabled/disabled callback. Either they are
there and we use them or not.


git-svn-id: http://root.cern.ch/svn/root/trunk@46440 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 14:50:45 +00:00
Vassil Vassilev
a047926b87 Usually we have to distinguish between lookup failures. Eg. there are certain
lookups that are expected (by the compiler) to fail and those which should not fail.

I was misled (wasn't thinking at all: Thanks Axel for questioning the checkin) 
because I thought we cannot distinguish those two different cases in the test
callback. 
Silly mistake:
  Revert the changes in the testsuite.
  Revert the default setup of the test callback in enableDynamicLookup

The problem is solved by extracting out the function which determines whether
a lookup is not expected to fail. (It still needs better place.)


git-svn-id: http://root.cern.ch/svn/root/trunk@46438 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 14:37:10 +00:00
Vassil Vassilev
3bba03cf9f *The JIT is configured to compile with RTTI so when we #include the SymbolResolverCallback
it looks for typeinfo of the InterpreterCallbacks (compiled with fno-rtti).

*Move the SymbolResolverCallback into InterpreterCallbacks.(h,cpp). Ideally it is 
used only in the testsuite so we could hack in the build system to build the 
SymbolResolverCallback with fno-rtti and include just the header file but that's
for later.
*Set the symbol resolver callback in enableDynamicLookup for now.
*Clear up the logic behind InterpreterExternalSemaSource and InterpreterCallbacks.
*Now the DynamicIDHandler derives from InterpreterExternalSemaSource.
*Adapt the testsuite to the change.
*Request the InterpreterCallback constructor to be put in the binary.


git-svn-id: http://root.cern.ch/svn/root/trunk@46435 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 13:00:17 +00:00
Vassil Vassilev
a6a7c6f748 No need of -verify and -I for that test.
git-svn-id: http://root.cern.ch/svn/root/trunk@46410 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-09 16:09:42 +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
9c865d8553 Update llvm / clang to r165095.
Update cling to follow interface changes; make note of it in cling/LastKnownGoodLLVMSVNRevision.txt.

Remove all (!) patches from ROOT's version of clang; they are all integrated into clang mainline.
ROOT now starts up with modules without errors; doing almost anything hits
root.exe: /home/axel/build/root/llvmvendor/roottrunk/interpreter/llvm/inst/include/clang/AST/RecordLayout.h:199: clang::CharUnits clang::ASTRecordLayout::getBaseClassOffset(const clang::CXXRecordDecl*) const: Assertion `CXXInfo->BaseOffsets.count(Base) && "Did not find base!"' failed.
or a "corrupt" vtable due to base class definitions being replaced by later PCMs; to be worked-around soon.


git-svn-id: http://root.cern.ch/svn/root/trunk@46280 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-03 09:45:56 +00:00
Philippe Canal
00f0d19636 Add many more tests ..
git-svn-id: http://root.cern.ch/svn/root/trunk@46209 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-27 08:49:18 +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
Vassil Vassilev
5bc1387d38 Remove old lookup functions from the Interpreter. Now we have dedicated object
for string-based lookup (LookupObject) and cling::utils::Lookup class for quick
simple lookups.

This checkin slows down the testsuite because there is no LookupHelper::findVarDecl
and we have to #include a lot of headers at runtime.


git-svn-id: http://root.cern.ch/svn/root/trunk@46022 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 15:05:53 +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
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
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