Commit Graph

107 Commits

Author SHA1 Message Date
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
Axel Naumann
d5f237f819 Move "library load result" enum to the other enum.
Make tryLinker a member function now that it uses the collection of loaded libraries.
Implement "was alreday loaded" as possible loadLibrary() result.


git-svn-id: http://root.cern.ch/svn/root/trunk@47324 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 16:41:30 +00:00
Axel Naumann
8616cc7bea Split loadFile() into two and we have a new interface loadLibrary()!
Prepare new result "library was alreday loaded" - will be implemented if we actually need it.


git-svn-id: http://root.cern.ch/svn/root/trunk@47319 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 14:50:59 +00:00
Paul Russo
afe62b76cb Use CodeGen to lower an AST type to a LLVM type.
git-svn-id: http://root.cern.ch/svn/root/trunk@47285 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-14 21:23:31 +00:00
Vassil Vassilev
d49cd5c090 The parent of a nested thansaction is definitely not itself.
git-svn-id: http://root.cern.ch/svn/root/trunk@47284 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-14 20:29:57 +00:00
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
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
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
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
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
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