119 Commits

Author SHA1 Message Date
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
Paul Russo
1737ff69c7 Change TCling::ResetGlobals() to invoke the global destructors.
This fixes roottest workaround ClingWorkAroundIncorrectTearDownOrder.


git-svn-id: http://root.cern.ch/svn/root/trunk@48514 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-08 18:11:36 +00:00
Vassil Vassilev
5bbb8c2aba Implement the autoloading for ROOT_MODULES.
git-svn-id: http://root.cern.ch/svn/root/trunk@48385 27541ba8-7e3a-0410-8455-c3a389f83636
2013-01-23 14:41:15 +00:00
Vassil Vassilev
1ae610b211 Fix savannah #99234.
The issue we experienced is that we couldn't pipe the output in the terminal.
The reason is that we were using llvm::outs() which closes explicitly the file
descriptor (thanks Axel for the help debugging).
We introduce our custom stream, which keeps the file descriptor open so that
we can use it in pipes. For debugging purposes, however we use/should use llvm::errs()

The lesson learned:
DONT USE LLVM::OUTS() ANYMORE!


git-svn-id: http://root.cern.ch/svn/root/trunk@48316 27541ba8-7e3a-0410-8455-c3a389f83636
2013-01-17 15:27:14 +00:00
Philippe Canal
90d940fbb8 Introduce (and use in TCling) Interpreter::parseForModule that codegen just
inline functions (and should codegen anything that is not directly provide
by a library 'described' by a module).


git-svn-id: http://root.cern.ch/svn/root/trunk@48197 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-25 04:57:07 +00:00
Axel Naumann
c759ab29ed Add two missing ASTConsumer interfaces to the DeclCollector.
git-svn-id: http://root.cern.ch/svn/root/trunk@47986 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-12 08:08:56 +00:00
Vassil Vassilev
d8d127664d Until we have the full implementation of the preprocessor directives just act
on #include. This makes sure that we don't do any extra work causing roottest
failures.


git-svn-id: http://root.cern.ch/svn/root/trunk@47972 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-11 14:43:40 +00:00
Philippe Canal
cbc0713c9e Document new parameter of findScope
git-svn-id: http://root.cern.ch/svn/root/trunk@47948 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-10 13:40:57 +00:00
Vassil Vassilev
b117bb49de Implement simple preparse of input lines. In many cases this helps to take
quickly decisions what to do with the input. Partially fixes savannah #99294


git-svn-id: http://root.cern.ch/svn/root/trunk@47941 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-10 11:17:43 +00:00
Philippe Canal
c7b6bc94ce In findScope, give the user the choice on whether the class template are instantiated or not
git-svn-id: http://root.cern.ch/svn/root/trunk@47934 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-09 01:51:25 +00:00
Axel Naumann
979efbde76 Update doc.
git-svn-id: http://root.cern.ch/svn/root/trunk@47894 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 14:50:38 +00:00
Vassil Vassilev
83331c8cfa Update docs.
git-svn-id: http://root.cern.ch/svn/root/trunk@47891 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 11:49:53 +00:00
Vassil Vassilev
c97b8bd3c7 Remove redundant includes and forward declarations.
git-svn-id: http://root.cern.ch/svn/root/trunk@47890 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 11:49:14 +00:00
Vassil Vassilev
9881b59a06 Get rid of meta processor options and various improvements.
git-svn-id: http://root.cern.ch/svn/root/trunk@47889 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 11:47:24 +00:00
Vassil Vassilev
ad0cfca9a6 Get rid of another use of meta processor option.
git-svn-id: http://root.cern.ch/svn/root/trunk@47885 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:52:01 +00:00
Vassil Vassilev
b6020d1e60 const
git-svn-id: http://root.cern.ch/svn/root/trunk@47884 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:48:12 +00:00
Vassil Vassilev
5b995b50d1 Add accessor for the interpreter.
git-svn-id: http://root.cern.ch/svn/root/trunk@47882 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:39:27 +00:00
Vassil Vassilev
b4ae9af6f1 RawInput mode has proven itself to be very helpful. We should have support for it
on Interpreter level and not at MetaProcessor level.


git-svn-id: http://root.cern.ch/svn/root/trunk@47881 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:38:56 +00:00
Vassil Vassilev
096a0647c2 No need of dynamic lookup as meta processor option.
git-svn-id: http://root.cern.ch/svn/root/trunk@47880 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:20:15 +00:00
Vassil Vassilev
9b237493fe MetaProcessor Options must go away. This is one step towards it.
git-svn-id: http://root.cern.ch/svn/root/trunk@47879 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:18:35 +00:00
Vassil Vassilev
1f8fc62305 Remove unused code
git-svn-id: http://root.cern.ch/svn/root/trunk@47877 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:11:25 +00:00
Vassil Vassilev
fc6f865dfb Use contemporary cling coding style :)
git-svn-id: http://root.cern.ch/svn/root/trunk@47876 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 09:54:20 +00:00
Vassil Vassilev
fda024151f Remove redundant unclude.
git-svn-id: http://root.cern.ch/svn/root/trunk@47875 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 09:46:23 +00:00
Axel Naumann
5ed01c266c Add interface to cancel input continuation.
git-svn-id: http://root.cern.ch/svn/root/trunk@47803 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 08:05:33 +00:00
Vassil Vassilev
ef8d4e85ba Readd support (which we had long time ago) for tracking down which decl came from.
This "is meant" to help us generating the missing symbols in the llvm::Module.


git-svn-id: http://root.cern.ch/svn/root/trunk@47790 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-03 16:28:24 +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
Axel Naumann
17884114d5 Add value printing of namespace- or static member functions (i.e. not CXXMethods):
root [0] TIterCategory<TList>::End
(class TIterCategory<class TList> (void)) Function @0x1086ff040: 
static TIterCategory<TList> End() {
    return TIterCategory<TList>(static_cast<TIterator *>(0));
}


root [1] printf
(int (const char *, ...)) Function @0x7fff946a6650: 
int printf(const char *, ...) __attribute__((format("printf", 1, 2)))
root [2] TCollection::GetCurrentCollection
(class TCollection *(void)) Function @0x100b4cf90: 
static TCollection *GetCurrentCollection()
root [3] TMath::Sin
(Double_t (Double_t)) Function @0x10ca2d9f0:
inline Double_t Sin(Double_t x) {
    return sin(x);
}

Dump the decl (its definition, if available), which we cannot get from the type, instead put the Expr back into the ValuePrinterInfo and use its DeclRefExpr.
If we don't have one, then just dump the function type which is much less informative.


git-svn-id: http://root.cern.ch/svn/root/trunk@47775 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-02 16:47:34 +00:00
Philippe Canal
0ecd2ced8c Properly handle the qualifiers in the new desugaring code
git-svn-id: http://root.cern.ch/svn/root/trunk@47772 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-02 01:56:59 +00:00
Philippe Canal
89257d8935 Implement a findClassTemplate return the ClassTemplateDecl give a 'fully qualified' class template name
git-svn-id: http://root.cern.ch/svn/root/trunk@47755 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 07:22:56 +00:00
Vassil Vassilev
60b330abb2 Revert r47746 (which means fully unrevert the r47739). We can run roottest and all seems good. Unbreaks the trunk.
git-svn-id: http://root.cern.ch/svn/root/trunk@47752 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 00:45:43 +00:00
Philippe Canal
e719c8efdb Partially revert r47739 so that we have a functional meta processor
git-svn-id: http://root.cern.ch/svn/root/trunk@47746 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-30 23:09:26 +00:00
Vassil Vassilev
72539ff673 Implement lexer/parser/sema for the meta language, which we have to implement soon.
* It makes the life easier to add new grammar rules and keywords.
* Silences a lot of the test failures we had.
* Fixes the imbalanced ' or " properly.


git-svn-id: http://root.cern.ch/svn/root/trunk@47739 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-30 17:26:26 +00:00
Paul Russo
b75c068ea4 Make the partial desugaring of types fully granular,
we now explicitly control exactly which types get
desugared and which do not.  The current set which
does get desugared is a first pass at what we need,
I fully expect we will have to tune it as we do
more debugging of roottest.


git-svn-id: http://root.cern.ch/svn/root/trunk@47719 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-29 21:40:44 +00:00
Vassil Vassilev
55e9e20bf8 Silence a warning.
git-svn-id: http://root.cern.ch/svn/root/trunk@47626 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-26 13:45:32 +00:00
Vassil Vassilev
0b9ac8557b Factor out the creation on IntegerLiteral in separate public routine.
git-svn-id: http://root.cern.ch/svn/root/trunk@47542 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-21 17:05:10 +00:00
Vassil Vassilev
512d1bbf21 Add interface in cling::Interpreter that avoids lexing, parsing and sematic
analysis. It just takes the transaction runs all the transformers on it 
(depending on the compilation options residing in the transaction itself) and
generate code for it.


git-svn-id: http://root.cern.ch/svn/root/trunk@47518 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-21 02:28:31 +00:00
Vassil Vassilev
4008ac3681 Add convenient interface that allow us to add easily single decl in a transaction.
git-svn-id: http://root.cern.ch/svn/root/trunk@47517 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-21 02:26:05 +00:00
Axel Naumann
3df2500a81 Be nice to the caller - lookup inside a DeclContext should work even for a const DeclContext, so do a const_cast in the source.
git-svn-id: http://root.cern.ch/svn/root/trunk@47496 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 19:13:06 +00:00
Axel Naumann
2da8caecff Handle unresolved symbols in static initialization.
Now that it's used twice, extract the conversion from ExeContext::ExeResult to Interp::ExeResult.
IncrementalParser will try to roll the transaction back for unresolved initializers.


git-svn-id: http://root.cern.ch/svn/root/trunk@47484 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 16:24:02 +00:00
Axel Naumann
d465d934a5 Simplify the RAII:
when constructing it takes a snapshot of whatever is relevant.
when destructing it restores whatever is relevant.

Don't mess with the diag Begin/EndSourceFile(); that's only relevant on a frontend level (aka are we parsing command line flgs or already source files?)


git-svn-id: http://root.cern.ch/svn/root/trunk@47474 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 13:17:55 +00:00
Axel Naumann
26f3d7cf75 Do cling's best at returning the currently executing file.
#included files will not be picked up as cling cannot tell where the currently running function was defined.
But it does know which file was passed to MetaProcessor::executeFunction() (e.g. via .x).
So at least store that.
This fixes the occurrences of GetCurrentMacroName() in tutorials/


git-svn-id: http://root.cern.ch/svn/root/trunk@47421 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-19 00:00:53 +00:00
Vassil Vassilev
6c4ae5b1dd Add non const iterator.
git-svn-id: http://root.cern.ch/svn/root/trunk@47407 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-18 15:46:16 +00:00
Axel Naumann
6e29edaafa Add getAddressOfGlobal() taking a const char symbol name.
git-svn-id: http://root.cern.ch/svn/root/trunk@47358 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-16 15:32:43 +00:00
Axel Naumann
0f6a4cc921 Doxygen is unhappy about the hash.
git-svn-id: http://root.cern.ch/svn/root/trunk@47344 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-16 13:27:49 +00:00
Vassil Vassilev
20180ac047 Temporarily!? publish the parser.
git-svn-id: http://root.cern.ch/svn/root/trunk@47340 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 23:51:52 +00:00
Axel Naumann
28dc13c51e Don't try to #include a file for which we know it's a dynamic library (that just failed to load) or a bitcode file.
Fixes bug #98798.
Print error message from loader ("cling::Interpreter::tryLinker(): .../libFoo.so: undefined symbol: bar") on dlopen failure.


git-svn-id: http://root.cern.ch/svn/root/trunk@47339 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 21:36:41 +00:00
Axel Naumann
7d5ed9e511 Define result of ExecutionContext::executeFunction().
Return it all the way through Interpreter.
Fixes bug #98837.


git-svn-id: http://root.cern.ch/svn/root/trunk@47337 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 20:55:43 +00:00
Axel Naumann
226b360b15 Rename LoadLibResult constants to start with 'k'.
Enable kLoadLibExists case in TCintWithCling.

Collect statistics about loaded files.
Give access to that through .file; rename SourceManager dump to fileEx.

Documentation.

(Sorry, should have been three patches.)


git-svn-id: http://root.cern.ch/svn/root/trunk@47330 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 18:23:11 +00:00
Axel Naumann
e8d7963b97 Split dumping and extraction of IncludePaths (aka HeaderSearchOpts).
Call it like this:
SmallVector<std::string, 100> inclPaths;
interp->GetIncludePaths(inclPaths, false, true);
to get the include paths prefixed with -I, but no system onclude paths.

Mark include paths supplied via AddIncludePath() as IsUserSupplied.


git-svn-id: http://root.cern.ch/svn/root/trunk@47325 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 17:07:44 +00:00