Commit Graph

2066 Commits

Author SHA1 Message Date
Axel Naumann
d94e4aae9c Don't #include Type.h in ValuePrinterInfo.h - this will be needed at runtime, too.
Instead just allocate enough data member space to store a QualType (asserting that it really is enough), and cast to and from as needed.
Ugly but it works, and it's sufficiently internal.


git-svn-id: http://root.cern.ch/svn/root/trunk@47191 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-12 14:58:49 +00:00
Axel Naumann
45adbab8dc Convert away from pointer before converting to T.
Repairs code for T == double.


git-svn-id: http://root.cern.ch/svn/root/trunk@47184 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-12 11:49:08 +00:00
Axel Naumann
394e5abae3 Refine case of invalid value: print the address of the value object.
git-svn-id: http://root.cern.ch/svn/root/trunk@47180 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-12 10:33:15 +00:00
Axel Naumann
f39792a8c9 Implement StoredValueRef::dump() using the ValuePrinter.
git-svn-id: http://root.cern.ch/svn/root/trunk@47179 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-12 10:27:50 +00:00
Axel Naumann
340e954bbe ValuePrinterInfo doesn't need to store the Expr but the QualType; shortens signatures.
Factor out StoredValueRef streaming, expose so it can later be used by StoreValueRef::dump().


git-svn-id: http://root.cern.ch/svn/root/trunk@47178 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-12 10:27:13 +00:00
Axel Naumann
e2378406a1 Array printing refinements (needed by r47175, oops.)
git-svn-id: http://root.cern.ch/svn/root/trunk@47176 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 17:18:15 +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
d0e7ca647f Determine the resType from the function decl.
git-svn-id: http://root.cern.ch/svn/root/trunk@47174 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 17:06:00 +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
23ec0224db Const correctness.
git-svn-id: http://root.cern.ch/svn/root/trunk@47172 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 16:36:04 +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
660cbfe820 If the last statement is not an expression, check whether it's a return statement.
If it is, remove the implicit-cast-to-void (injected by Sema to heal "return 12" for the original void return type of the wrapper) and adapt the return type of the wrapper to the type of the returned expression. I.e.
void wrap() { return (void)12;}
will be converted to
int wrap() { return 12;}

Don't search for the WrapperFD, the Transaction has it.


git-svn-id: http://root.cern.ch/svn/root/trunk@47166 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 12:55:34 +00:00
Axel Naumann
d1112e3ce5 Get the result type directly from the wrapper function's return type.
Do that *after* the tranformers have done their work; they change the result type.
Silence a "return 12" inside a (not yet transformed) void wrapper().
The return type will later be repaired by the ReturnSynthesizer if needed.


git-svn-id: http://root.cern.ch/svn/root/trunk@47165 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 12:53:21 +00:00
Axel Naumann
db8b70b203 Clean up includes / fwd declares.
git-svn-id: http://root.cern.ch/svn/root/trunk@47164 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 12:51:35 +00:00
Axel Naumann
8416a9183c Simplify: don't loop over everything to find the WrapperFD but use the one stored in the transaction.
git-svn-id: http://root.cern.ch/svn/root/trunk@47163 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-11 12:47:05 +00:00
Axel Naumann
1a9a90a836 -E does not exist on MacOS. Apparently exporting all symbols is its default.
git-svn-id: http://root.cern.ch/svn/root/trunk@47146 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-10 14:14:27 +00:00
Axel Naumann
7118c364f4 unused include
git-svn-id: http://root.cern.ch/svn/root/trunk@47145 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-10 11:59:19 +00:00
Axel Naumann
46eb845f6d * pass whole file content to process(); enables #ifdef
* ignore ';' after terminal '}'


git-svn-id: http://root.cern.ch/svn/root/trunk@47136 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-09 10:54:07 +00:00
Philippe Canal
26e040e03f fix typo
git-svn-id: http://root.cern.ch/svn/root/trunk@47087 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-07 05:31:03 +00:00
Philippe Canal
bc63cc3bdd Correctly test for the result of loadFile
git-svn-id: http://root.cern.ch/svn/root/trunk@47084 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-06 22:42:02 +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
Axel Naumann
61e2c2a788 Don't run ValuePrinter on unknown QualTypes.
Implement type printing for function pointers: just cast them to void*, but do keep the original expression's type so we can print the type correctly.


git-svn-id: http://root.cern.ch/svn/root/trunk@47002 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 13:33:59 +00:00
Axel Naumann
32852bd800 Missing curly!
git-svn-id: http://root.cern.ch/svn/root/trunk@47001 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 12:56:40 +00:00
Axel Naumann
c68930cc52 Make the cxa_atexit replacements more C-like (e.g. don't put them into namespaces).
git-svn-id: http://root.cern.ch/svn/root/trunk@46997 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 11:51:05 +00:00
Axel Naumann
0b5e5bda73 Export all symbols from the cling binary, such that the JIT can find them.
git-svn-id: http://root.cern.ch/svn/root/trunk@46996 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 11:50:17 +00:00
Axel Naumann
4e90ca5b42 Hopefully last change to RequiredSymbols: given that they are required by the interpreter runtime they should all be symbols from libclingInterpreter. Move it there.
git-svn-id: http://root.cern.ch/svn/root/trunk@46990 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-02 08:11:24 +00:00
Axel Naumann
6035382bb5 Put the symbol requester func into the proper namespace!
git-svn-id: http://root.cern.ch/svn/root/trunk@46987 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-01 19:46:32 +00:00
Axel Naumann
0dea9a66f6 Updated location of RequiredSymbols.cpp
git-svn-id: http://root.cern.ch/svn/root/trunk@46986 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-01 19:38:15 +00:00
Axel Naumann
bf31a650a9 Fix symbol requesting.
git-svn-id: http://root.cern.ch/svn/root/trunk@46983 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-01 19:10:12 +00:00
Axel Naumann
b4a8dcde49 Everyone wants these symbols; for now put the symbol request through static init into UserInterface
git-svn-id: http://root.cern.ch/svn/root/trunk@46982 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-01 16:51:59 +00:00
Axel Naumann
ee3b83e48a Implement unnamed macros:
* MetaProcessor::readInputFromFile passes the content to the Interpreter as if typed at the prompt
* they do not get passed to CINT in TCintWithCling


git-svn-id: http://root.cern.ch/svn/root/trunk@46898 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-30 13:40:25 +00:00
Axel Naumann
5bb394667e Doc fix
git-svn-id: http://root.cern.ch/svn/root/trunk@46897 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-30 13:34:09 +00:00
Axel Naumann
a62cc82f24 Pass CompilationResult through
* MetaProcessor
* loadFile
* TCintWithCling::ProcessLine().
Second part of fixing #98499.

Also fix a few dubious "return 0" instead of returnign the indent in MetaProcessor.


git-svn-id: http://root.cern.ch/svn/root/trunk@46873 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-29 14:23:53 +00:00
Vassil Vassilev
583aceae08 In interactive mode act as a compiler - return !=0 if there were errors.
git-svn-id: http://root.cern.ch/svn/root/trunk@46869 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-29 10:24:14 +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
f7da8da78f End close the file for diagnostics at proper time.
git-svn-id: http://root.cern.ch/svn/root/trunk@46857 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-27 21:41:21 +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
c926ac116c Add support for string arguments (allow spaces in them) for example: build.C("dummy18381.C"," " , "customConstructor.o customConstructorDict.o")
git-svn-id: http://root.cern.ch/svn/root/trunk@46847 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-27 01:09:08 +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
e979b92b16 Return 1 if the VerifyDiagnosticConsumer finds errors (eg. something seen but not
expected or expected but not seen).
Note this is going to break some of the tests, because there are some issues
with the way cling uses the VerifyDiagnosticClient.


git-svn-id: http://root.cern.ch/svn/root/trunk@46832 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 14:27:54 +00:00
Vassil Vassilev
516844befe Revert the parser cleanups. The RAII object is not sufficient for some routines.
Add BeginSourceFile so that the RAII object is happy when we do additional parser
recovery.


git-svn-id: http://root.cern.ch/svn/root/trunk@46828 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 13:32:41 +00:00
Vassil Vassilev
530c500d15 Add file to cmake build system.
git-svn-id: http://root.cern.ch/svn/root/trunk@46827 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 13:21:09 +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
b07eb9a4ec Move begin/end source file in commitCurrentTransaction to make sure that we
get relevant diagnostics from the transformers.
Fixes the text diagnostic printer bug #98434.


git-svn-id: http://root.cern.ch/svn/root/trunk@46822 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 10:08:00 +00:00
Vassil Vassilev
93adbbf34b Remove redundant cleanups.
git-svn-id: http://root.cern.ch/svn/root/trunk@46821 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-26 10:05:51 +00:00
Vassil Vassilev
e92073ebaf Think before commit - it helps... Fixes cling's testsuite.
git-svn-id: http://root.cern.ch/svn/root/trunk@46813 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-25 14:50:54 +00:00