40 Commits

Author SHA1 Message Date
Vassil Vassilev
1179f9a9ec Remove the dependence between the dynamic scopes and implicit auto. 2013-10-14 09:11:40 +02:00
Axel Naumann
2bdbe82561 Resurrect C++11 build. 2013-09-27 10:02:57 +02:00
Vassil Vassilev
816b721f80 Open the transaction to collect declarations coming from the dynamic expressions. 2013-06-25 09:30:34 +02:00
Philippe Canal
812432d36b Remove unused line. 2013-06-09 18:28:55 +02:00
Philippe Canal
e2c1067a82 Suppress warning about unused variables 2013-06-07 10:51:55 +02:00
Vassil Vassilev
92415de6bd Do not value print dynamic expressions when they are in a inner compound stmt. 2013-06-05 16:26:51 +02:00
Vassil Vassilev
48a9f75eed Try finally to implement proper rule for enabling the value printing for dynamic expressions. 2013-06-05 16:26:50 +02:00
Vassil Vassilev
b36efaa548 We should check only the last stmt. If it was null stmt, then no value printing is needed. 2013-05-24 10:39:52 +02:00
Vassil Vassilev
a2ac5448d7 In cases of a = dep->Call(), we still need to visit the RHS, even if it was auto candidate. 2013-05-24 10:39:04 +02:00
Vassil Vassilev
9b12f58bca In the cases of cxx delete expressions we need to escape the whole stmt. 2013-05-24 10:38:27 +02:00
Vassil Vassilev
5200e30e9c Proper merge... 2013-05-24 10:35:41 +02:00
Axel Naumann
cd1f081199 80 columns. 2013-05-15 11:43:11 +02:00
Axel Naumann
37238aa7ef Report correct name in assert. 2013-05-15 11:43:11 +02:00
Vassil Vassilev
059c086a61 Reuse not reimplement util function.
git-svn-id: http://root.cern.ch/svn/root/trunk@49348 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-25 12:59:36 +00: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
70695fe2be Update to clang/llvm r179269 (llvm vendor branch r49215):
Parser::Scope versus Sema::DeclContext are now checked for cross-vailidity.
Emit the TU-transaction explicitly instead of relying on a first transaction.
The typename extraction now takes a stream instead of a string to write to.
The llvm::Linker has much reduced functionality; use llvm::sys::Path instead to find dynamic libraries.


git-svn-id: http://root.cern.ch/svn/root/trunk@49325 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 16:28:08 +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
26935c507c It is always better to look for something where you expect it to be.
git-svn-id: http://root.cern.ch/svn/root/trunk@48853 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-08 09:54:42 +00:00
Vassil Vassilev
3f1bce28bc Adapt the code for the dynamic scope's lifetime handler. Its ctor has new signature
and we need to pass in the gCling variable.

Fixes one of cling standalone test failures.


git-svn-id: http://root.cern.ch/svn/root/trunk@48852 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-08 00:32:55 +00:00
Axel Naumann
451a0e5066 Dynamic lookup: replacing something in the condition doesn't mean that we should give up; there might be more to replace in the then / else parts.
Add a tests for that.
Fix involuntary test (using an undeclared printf) by fwd declaring printf.


git-svn-id: http://root.cern.ch/svn/root/trunk@48787 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-01 15:13:01 +00:00
Vassil Vassilev
ee2372ae3f Implement support of implicit (C++11) auto keyword.
Now we support name = initializer; style syntax, which gets transformed semantically
into auto name = initializer; Eg. i = 45;
The underlying mechanics are similar to the dynamic scopes. We "heal" the failed
lookup of "name" and then transform the created by Sema binary operator into a 
declaration statement after making the type deduction.

Note that the code in the TClingCallbacks could and will be extracted in cling's
codebase.


git-svn-id: http://root.cern.ch/svn/root/trunk@48736 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-27 15:28:38 +00:00
Vassil Vassilev
a343830c5b Create and initialize the type source info. Avoids crashes in the AST build by
the dynamic scopes.


git-svn-id: http://root.cern.ch/svn/root/trunk@48701 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 17:09:57 +00:00
Axel Naumann
664e8b22ac Reduce the amount of headers needed by the dynamic scopes at runtime:
* Make GenericValue, clang::QualType opaque in Value
* Move LifetimeHandler implementation into source; requires separate header
* 

Also:
* Value: replace CPP macros by overloads


git-svn-id: http://root.cern.ch/svn/root/trunk@48675 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-22 15:59:54 +00:00
Vassil Vassilev
3bcfc8b25e Prepare dynamic scopes for integration in ROOT;
* Merge the DynamicIDHandler into InterpreterCallbacks. The DynamicIDHandler was
used to define the failed lookup names as dependent, so that later on they could
be "healed" by the EvaluateTSynthesizer - by generating a call to gCling->EvaluateT...

* Add a flag in the InterpreterCallbacks giving a hint when the failed lookup is
performed - during compilation time or during evaluation type, maybe its name is
misnomer. Maybe I should rename it to IsInRuntimeEvalMode or smth like that...

* Simplify the evaluation routine. The idea is to be merged with one of the 
existing - either echo or evaluate

* Implement proper mock object as test dynamic symbol resolver callback. Now it
fully relies on InterpreterCallbacks.

* Implement dynamic expression node marking. Every node that needs runtime 
resolution is marked as dependent. However, clang marks other nodes as dependent,
too (eg. templates). Until now it was very difficult to distinguish between both.
Now every "artificially" (marked by us) node's declaration is annotated so that 
it could be found back easily by using a simple RecursiveASTVisitor.

Generally we have two issues when using dynamic scopes - filtering the failed 
lookups that need to be evaluated at runtime, and filtering the "artificially"
marked as dependent dynamic nodes/decls. Whereas the second issue is solved by
using the annotations, the first one is more tricky to solve because clang doesn't
give us enough information to conclude what should be done. For now I have 
narrowed down the cases so that dynamic nodes can appear only in function decls.


git-svn-id: http://root.cern.ch/svn/root/trunk@48575 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 17:29:30 +00:00
Vassil Vassilev
7832135a63 * Move the check whether a symbol is dynamic from the testsuite to the "mainline".
* Add the dynamic ID handler, responsible for the dynamic scopes, as ExternalSemaSoruce
for the TClingCallbacks. 

From here on we don't know how many tests will fail due to that.
I might end up reverting it if they are too many.


git-svn-id: http://root.cern.ch/svn/root/trunk@48529 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-11 13:19:55 +00:00
Vassil Vassilev
8c2ccd177f Move the DynamicIDHandler into separate source file so that it could be used while
implementing custom interpreter callbacks.


git-svn-id: http://root.cern.ch/svn/root/trunk@48527 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-11 12:55:01 +00:00
Vassil Vassilev
fdd88b8a47 Implement basic infrastruction to begin tracking down the interfaces from which the decls came.
git-svn-id: http://root.cern.ch/svn/root/trunk@47787 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-03 14:27:12 +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
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
f022ae876f In principle this cannot happen because it is our controlled environment. However
one extra assertion doesn't hurt. (cid #47047)


git-svn-id: http://root.cern.ch/svn/root/trunk@46537 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-14 15:04:47 +00:00
Vassil Vassilev
0632a8e187 Initialize the variables to avoid dereferencing 0 (cid #47241)
git-svn-id: http://root.cern.ch/svn/root/trunk@46536 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-14 15:01:25 +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
6fd2a83a5c Revert previous change which broke cling's testsuite.
The issue that was addressing the previous commit will be fixed with the upcoming
changes anyway.


git-svn-id: http://root.cern.ch/svn/root/trunk@46345 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 14:03:29 +00:00
Vassil Vassilev
2fbeb6ecd4 The callback goes first.
git-svn-id: http://root.cern.ch/svn/root/trunk@46342 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 13:19:18 +00:00
Vassil Vassilev
a41c19237c * Remove the craftwork from dealing with setting callbacks.
* Simplify the impelentation of DynIDHandler.
* Create a shortcut for getting the semantic analysis object.


git-svn-id: http://root.cern.ch/svn/root/trunk@46287 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-03 12:40:41 +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
f2d691971f Get rid of interpreter pointer in one of the transformers. More to follow.
git-svn-id: http://root.cern.ch/svn/root/trunk@46016 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 12:46:30 +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