40 Commits

Author SHA1 Message Date
Axel Naumann
331a71cd2d Provide a valid SourceLoc - template instantiation needs it (ROOT-7364). 2015-06-08 18:10:01 +02:00
Axel Naumann
25b4369647 Only emit Value return placement new for CallInit (ROOT-7310). 2015-05-13 12:12:00 +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
69234ce153 Fix nullptr value printing (ROOT-7092). 2015-02-21 22:27:26 +01:00
Vassil Vassilev
0764694c14 Do not try to fixup return statements in lambdas. 2014-10-08 17:42:04 +02:00
Axel Naumann
69d6c4e992 Handle member fun ptr (ROOT-5467). 2014-09-26 16:08:06 +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
CristinaCristescu
aaff0628ca Value extraction checking for deleted copy ctor (ROOT-6385).
During the value extraction the copy constructor availability check must ensure the copy ctor was not deleted.
2014-06-17 14:41:28 +02:00
CristinaCristescu
5d4115482f Value extraction: not a record decl we have copy ctor by default. 2014-05-26 18:30:58 +02:00
CristinaCristescu
832390bc7b Correct line alignment. 2014-05-26 18:30:58 +02:00
CristinaCristescu
980133d65e Value extraction setting void types.
In the case the type is void we have to reset the maybe different object type pushed on the stack before the assesment of the desugared type.
2014-05-26 18:30:57 +02:00
CristinaCristescu
d85eba73ee Default cling::Value set to invalid.
The cling::Value is initialized to be invalid then the value extraction changes it or not. If we do not have an available copy constructor for objects the value stays invalid.
2014-05-26 18:30:57 +02:00
CristinaCristescu
e41ba01959 ValueExtractionSynthesizer: check for the existance and accessibility of copy constructor. (ROOT-6185). 2014-05-26 18:30:56 +02:00
Vassil Vassilev
de3809bb51 Rely on the expr kind, instead of some compiler generated exprs which can be missing. 2014-05-21 09:36:56 +02:00
Vassil Vassilev
5deb236214 Dump only if value printing was enabled. Add assertion. 2014-05-19 16:05:57 +02:00
Vassil Vassilev
711e39e092 Pass in the transaction ptr, whoose value we print out. 2014-05-18 18:08:59 +02:00
Vassil Vassilev
5bdf863d5f Do not dump for void, resetting the value of the value. 2014-05-18 18:08:59 +02:00
Vassil Vassilev
5167e8f992 Improve the C version of the value printing. 2014-05-18 18:08:59 +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
e587158b03 Add the Interpreter* to the cling::Value. We can afford it, because its actual size is 24 and it anyway gets aligned to 32 (except on a few old washing machines). 2014-05-18 18:08:58 +02:00
Vassil Vassilev
7b18586fa9 Extend the lifetime of the temporaries up to the function call using them.
Results in move of ExprWithCleanups, which is responsible for the lifetime
of the temporaries.
2014-05-18 18:08:58 +02:00
Vassil Vassilev
198e89d305 Run caching before using the cached vars. 2014-04-04 15:22:00 +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
529088b816 There might be returns without return values. 2014-04-03 13:56:59 +02:00
Vassil Vassilev
1c237c2844 In order to run the void expression we need to put it inside a binary operator.
This is the shorthand of syntesizing two statements, which will dramatically
increase the complexity of the implementation.
Now we use setValueToVoid, runExpression
2014-04-02 16:56:58 +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
93970e8c35 Replace StoredValueRef by Value. 2014-04-01 18:31:58 +02:00
Vassil Vassilev
2c9fe16a56 Remove dead branch. 2014-03-24 14:25:58 +01:00
Vassil Vassilev
890c1df223 Remove unused variable. 2014-03-17 12:03:02 +01:00
Axel Naumann
68d1b137b5 Pass lvalues like declRefExpr as references into the cling::Value (ROOT-6107).
This restores ReturnSynthesizer's behavior for ValueExtractionSynthesizer.
2014-02-26 09:22:04 +01:00
Vassil Vassilev
fe98663520 Rename var clashing with the param 2014-02-21 09:33:02 +01:00
Vassil Vassilev
1a59a8b87a Blanks. 2014-02-20 10:36:08 +01:00
Vassil Vassilev
9481d37d5b Use the new signature. 2014-02-19 15:01:03 +01:00
Vassil Vassilev
9e1bfae897 Simplify. 2014-02-19 15:01:03 +01:00
Axel Naumann
b27e430c89 Implement setValueNoAlloc() for 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
ca4fd9eb3a Improve encapsulation. Move ValueExtractionSynthesizer specifics to its implementation. Get rid of references to the interpreter class in the ExecutionContext. 2014-02-19 10:43:00 +01:00
Vassil Vassilev
6435fb8ad1 Remove unused var. 2014-02-18 18:19:07 +01:00
Vassil Vassilev
ca5db8bcce Use a bit better (more descriptive) name. 2014-02-18 17:22:59 +01:00