181 Commits

Author SHA1 Message Date
Vassil Vassilev
32751e08ff Remove now redundant code.
git-svn-id: http://root.cern.ch/svn/root/trunk@47823 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 15:42:01 +00:00
Vassil Vassilev
ed96f22a74 Make use of the new patch in the vendor branch. Setting the TU to TU_Complete
will force generation of the vtables of referenced classes.


git-svn-id: http://root.cern.ch/svn/root/trunk@47821 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 15:22:10 +00:00
Vassil Vassilev
5e9a144766 Add default case and silence a warning.
git-svn-id: http://root.cern.ch/svn/root/trunk@47813 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 10:53:44 +00:00
Axel Naumann
5b92bda924 Skip white space when determining whether input can be wrapped or not.
Fixes Savannah #99246


git-svn-id: http://root.cern.ch/svn/root/trunk@47806 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 08:54:16 +00:00
Axel Naumann
36f406676f Print source from memory buffer instead of AST dump if the code is available. Print file name / line number.
git-svn-id: http://root.cern.ch/svn/root/trunk@47797 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-03 21:20:53 +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
Vassil Vassilev
7cf86a9898 Remove unused variable
git-svn-id: http://root.cern.ch/svn/root/trunk@47769 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 18:56:53 +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
Paul Russo
2f2f7f6a9c When checking for enum types during a type lookup, we
must convert the ParsedType to a QualType correctly.

This should fix a lot of failures with enums.


git-svn-id: http://root.cern.ch/svn/root/trunk@47744 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-30 22:42:53 +00:00
Philippe Canal
63ea4e20db avoid crashing when seeing module 'import' thingies
git-svn-id: http://root.cern.ch/svn/root/trunk@47653 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-27 15:54:36 +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
Axel Naumann
6d87784d2a Add missing second half of r47590
git-svn-id: http://root.cern.ch/svn/root/trunk@47592 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-23 08:30:04 +00:00
Vassil Vassilev
a28cd2e9ab Remove a declaration only from its lexical declaration context.
Don't erase the decl from the vector of decls, because the vector is generated
from the declaration context from which we have already deleted the decl.


git-svn-id: http://root.cern.ch/svn/root/trunk@47591 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-23 08:05:40 +00:00
Vassil Vassilev
046ac9440e When we cannot copy the result we shouldn't try. Fixes savannah bug #99000
git-svn-id: http://root.cern.ch/svn/root/trunk@47590 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-22 22:23:17 +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
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
c197c04fb6 DiagConsumer::Begin/EndSourceFile() are used to switch from "parsing command line flags" to "parsing source files" more; not to signal a new source file to the diag client.
Switch BeginSourceFile() on after having parsed Interpreter internals.
Switch it off (EndSourceFile()) in ~Interpreter.
Indentation.

Now that we handle diags appropriately, test/ErrorRecovery/MetaProcessor.C fails; repair it.


git-svn-id: http://root.cern.ch/svn/root/trunk@47476 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 13:21:00 +00:00
Vassil Vassilev
1901c83a0e Fix warning in EC.
git-svn-id: http://root.cern.ch/svn/root/trunk@47475 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 13:20:22 +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
afcf1105c9 Having warnings does not mean failure.
git-svn-id: http://root.cern.ch/svn/root/trunk@47469 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 09:43:17 +00:00
Vassil Vassilev
009338beb7 Since cling::Transaction is public and the fact that on commit of transaction a
new transaction could be triggered, every compile should return the transaction
that it actually compiled. I.e. the cling::IncrementalParser::getLastTransaction
in many cases might not be the transaction we expect. For example in ROOT's case
plugin manager is triggered for some reason and the last transaction is not the
one that I'd personally expect.
This should be fix roottest/.../runMemory.C


git-svn-id: http://root.cern.ch/svn/root/trunk@47465 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 03:26:52 +00:00
Vassil Vassilev
e49c5fb31e If the first decl happens to be null ask the wrapper function for the ASTContext.
git-svn-id: http://root.cern.ch/svn/root/trunk@47459 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-19 21:17:28 +00:00
Vassil Vassilev
177d20e14c Fix code generation of dynamic classes, i.e classes having virtual tables.
git-svn-id: http://root.cern.ch/svn/root/trunk@47418 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-18 22:57:52 +00:00
Vassil Vassilev
3a684ca4d6 HandleVTable assert is far too intrusive to stay.
git-svn-id: http://root.cern.ch/svn/root/trunk@47416 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-18 22:44:58 +00:00
Vassil Vassilev
9b1a7efe4b Indents
git-svn-id: http://root.cern.ch/svn/root/trunk@47415 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-18 22:27:00 +00:00
Vassil Vassilev
991d6c55c8 Assert actually on use of one of those routines in Sema.
git-svn-id: http://root.cern.ch/svn/root/trunk@47411 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-18 20:52:41 +00:00
Axel Naumann
10c0ac8711 Don't free all JITted functions, only those that are referencing an unresolved symbol.
Thus also no need anymore to collect all jitted functions through a function JIT listener.
Sadly, recompilation of them will pick up the existing stub instead of actually recompiling.
Don't use StringRef.data() where we need a 0-terminated string for FindFunctionNamed().
Be explicit about what symbol is triggering an unresolved symbol.
Update test suite.


git-svn-id: http://root.cern.ch/svn/root/trunk@47398 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-17 16:28:14 +00:00
Axel Naumann
777c96d84e Only replace if used.
git-svn-id: http://root.cern.ch/svn/root/trunk@47397 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-17 16:22:57 +00:00
Axel Naumann
9386e93211 * The ExeEngine *is* the JIT (and not owned by the JIT); it is now owned by the ExectutionContext.
* Fix documentation
* Move d'tor to c'tor; document that both c'tor and d'tor should be in source because the OwningPtr c'tor and d'tor need a definition of ExecutionEngine, and we don't want to #include ExectuionEngine in the header.
* Add debug options to the JIT; keep frame pointer. Should make debugging a lot easier (and all tests continue to pass).


git-svn-id: http://root.cern.ch/svn/root/trunk@47396 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-17 12:09:08 +00:00
Axel Naumann
95a0df6fba Move things around.
Print the builder error message if needed.


git-svn-id: http://root.cern.ch/svn/root/trunk@47395 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-17 11:29:35 +00:00
Axel Naumann
47c2be1200 Handle ValuePrinting of char* 0 without crashing.
git-svn-id: http://root.cern.ch/svn/root/trunk@47378 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-16 20:25:34 +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
ee70e6bee3 tryCode only makes sense if a shared library is tried.
Fixes "cond jump dep on uninit var" / cling test failure.


git-svn-id: http://root.cern.ch/svn/root/trunk@47345 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-16 13:39:09 +00:00
Axel Naumann
5491fc88b6 Use the full path name to the shared library when registering it, not just "libGPad".
git-svn-id: http://root.cern.ch/svn/root/trunk@47342 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-16 11:30:31 +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
Paul Russo
f8b1205d19 Use the DestroyTemplateIdAnnotationsRAIIObj to cleanup
template ids after a parse.


git-svn-id: http://root.cern.ch/svn/root/trunk@47335 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 20:19:21 +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
Vassil Vassilev
3b037537f4 The test symbol provider should react on empty lookup result (Thus avoid the ambiguity coming from the extra call put in clang for autoloading).
git-svn-id: http://root.cern.ch/svn/root/trunk@47323 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 16:41:10 +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
Vassil Vassilev
c3c5d1e11a Use separate parser for our string-based lookup. This in general is safer because
we don't need pin-point precision while we recover the lookup parser from lookup.


git-svn-id: http://root.cern.ch/svn/root/trunk@47298 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 00:11:14 +00:00
Vassil Vassilev
29b9270e50 Remove unused code.
git-svn-id: http://root.cern.ch/svn/root/trunk@47291 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-14 22:07:42 +00:00
Vassil Vassilev
76975bf2da Improve cling's transaction model. For now a bit hackish because it doesn't
actually support proper nesting of transactions.
(begin|end)Transaction return the transaction began or ended, which simplifies
interaction in case of nested transactions (coming from the autoloading)

Implement new function which transforms the single-linked list into a vector of
transactions for debugging purposes only.


git-svn-id: http://root.cern.ch/svn/root/trunk@47290 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-14 22:06:58 +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