57 Commits

Author SHA1 Message Date
Axel Naumann
9b61560c4a Extra paren against hex address followed by a dot. 2015-05-24 21:55:24 +02:00
Axel Naumann
61291c5113 Support CXXDependentScopeMemberExpr for EvalT (ROOT-7163). 2015-04-01 12:09:17 +02:00
Axel Naumann
166032069e Emit Decls as DeclCollector sees them.
Now that we can easily revert Transactions' IR (by unloading their
module) we do not need to queue the Decls before emitting them.
This enables EndOfTU actions to be emitted seeminglessly, without
extra transactions, or explicit post-EndOfTU-emission: each
Transaction will have its TU finalized exactly once.

This in turn allows us to turn on Debug emission - which relies on
being invoked exactly once per Module.

Transformers must be invoked before emitting Decls. They are now
invoked for each Decl; WrapperTransformers are invoked when seeing
a wrapper decl. They do not see the "full transaction AST" anymore
- luckily none of our transformers requires this and actually become
simpler because of this change.

This also fixes a bug where the relative sequencing of parsed and
deserialized Decls was lost (parsed was emitted before deserialized).

Remove unused IRTransactions; they should really be llvm::Pass-es.
We don't have them anyway.

Disable a few transformations if the Decl isFromASTFile.

When reverting a Transaction, also revert its nested ones.

In the ValueExtractionSynthesizer, pass the ValuePrinter option as
int, instead of the transaction pointer - that might have changed
(at least its options) by the time we invoke the wrapper.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Explicit paths specified without -i or -o; assuming --only paths...
# rebase in progress; onto b3d9f92
# You are currently splitting a commit while rebasing branch 'declcollector-emits-v2' on 'b3d9f92'.
#
# Changes to be committed:
#	modified:   interpreter/cling/include/cling/Interpreter/RuntimeUniverse.h
#	modified:   interpreter/cling/lib/Interpreter/AutoSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/AutoSynthesizer.h
#	modified:   interpreter/cling/lib/Interpreter/CheckEmptyTransactionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/CheckEmptyTransactionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/DeclCollector.cpp
#	modified:   interpreter/cling/lib/Interpreter/DeclCollector.h
#	modified:   interpreter/cling/lib/Interpreter/DeclExtractor.cpp
#	modified:   interpreter/cling/lib/Interpreter/DeclExtractor.h
#	modified:   interpreter/cling/lib/Interpreter/DynamicLookup.cpp
#	modified:   interpreter/cling/lib/Interpreter/DynamicLookup.h
#	modified:   interpreter/cling/lib/Interpreter/IncrementalParser.cpp
#	modified:   interpreter/cling/lib/Interpreter/IncrementalParser.h
#	modified:   interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/TransactionTransformer.cpp
#	modified:   interpreter/cling/lib/Interpreter/TransactionTransformer.h
#	modified:   interpreter/cling/lib/Interpreter/TransactionUnloader.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValueExtractionSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValueExtractionSynthesizer.h
#	modified:   interpreter/cling/lib/Interpreter/ValuePrinterSynthesizer.cpp
#	modified:   interpreter/cling/lib/Interpreter/ValuePrinterSynthesizer.h
#
# Untracked files:
#	.idea/
#	0001-Fix-llvm-merge-issue.patch
#	0002-Fix-warnings.patch
#	0003-Keep-weak-symbols-around-subsequent-transactions-mig.patch
#	T.cxx
#	T.cxx~
#	TMVA.root
#	a.out
#	boost.root
#	config/Makefile.depend~
#	core/textinput/src/textinput/TerminalDisplayWin.cpp.orig
#	ct.root
#	data.root
#	interpreter/cling/76fc2055249da7b03148a7d4197a279e9943f012.patch
#	interpreter/cling/lib/Interpreter/CIFactory.cpp~
#	interpreter/cling/lib/Interpreter/DeclCollector.h~
#	interpreter/cling/lib/Interpreter/DynamicLibraryManager.cpp~
#	modulemap-one-header-per-file.txt
#	osrm-routed
#	tiles.tar.bz2
#	tmva_class_example.root
#	tutorials/v3.root
#	weights/
#
2015-03-16 14:58:58 +01:00
Axel Naumann
46aca4b23e InstantiationDependent is dependent, too; fix logic. (ROOT-6650) 2014-12-16 10:34:17 +01:00
Philippe Canal
185f135b06 Avoid spurrious complaint about one of the dynamic scope artefact.
This is related to ROOT-6721.
root [1] RooPlot * pl = x.frame(Title(x));
input_line_39:2:36: error: hexadecimal floating constants require an exponent
(*(class RooRealVar*)0x10c746058.frame(Title(x)))
                                   ^
2014-12-09 23:42:12 +01:00
Axel Naumann
bb95ca8a8f Survive failure in dyn expr building (ROOT-6824). 2014-10-16 15:52:04 +02:00
Vassil Vassilev
79b26d8878 ExprResult::take -> ExprResult::get, ExprResult::takeAs -> ExprResult::getAs. 2014-08-14 14:56:33 +02:00
Philippe Canal
576ca3ca96 Remove trailing spaces 2014-08-13 16:08:36 +02:00
Axel Naumann
08d752703f Improve SLoc and output for dynscope errors (more ROOT-6365). 2014-07-02 12:15:01 +02:00
Axel Naumann
0a93013a89 Use the SLoc of the original Expr for better readability (ROOT-6365). 2014-07-01 16:42:58 +02:00
Axel Naumann
b1e81bdcfd Handle failure in dynlookup more gracefully (ROOT-6365). 2014-07-01 16:42:58 +02:00
Axel Naumann
cea02a82e7 From Vassil: substitute then / else (ROOT-6345).
VisitCompoundStmt correctly substitutes the child Stmts. When calling Visit()
on a Stmt, this substitution needs to be carried out by the caller: only
it knows what target type to request. This fixes the issue for if statements
which do not fall back to VisitStmt() because of the conditional being of bool
type. In principle we are still missing do / while statements, too - again due
to the conditional part.
2014-06-13 11:11:57 +02:00
Vassil Vassilev
e173faa960 If we don't have the information about the type of the RHS report an and exit. 2014-05-28 12:11:57 +02:00
Axel Naumann
93970e8c35 Replace StoredValueRef by Value. 2014-04-01 18:31:58 +02:00
Axel Naumann
fae0d4037f Follow changes in llvm/clang. 2014-02-18 08:29:38 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Vassil Vassilev
d74740df1d Size doesn't make sense for a transaction. Iteration doesn't cause side effects anymore. 2013-11-25 17:32:56 +01:00
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