Commit Graph

530 Commits

Author SHA1 Message Date
Bertrand Bellenot
d9f80eb51b Use canonicalized absolute pathname
This should fix Jira #ROOT-5636 Be more precise on whether a shared library was loaded
2013-11-11 12:19:59 +01:00
Philippe Canal
6f87119b4b Add LookupHelper::findAnyFunction 2013-11-02 13:55:02 +01:00
Axel Naumann
ceaa2ce579 Add documentation. 2013-10-31 12:59:55 +01:00
Vassil Vassilev
91c54bda2e Add more handy interface that takes a number of transactions to be rolled back. 2013-10-29 20:19:25 +01:00
Vassil Vassilev
69eb1a59a6 Enforce integrity of getGlobalAddress, too. 2013-10-29 20:19:19 +01:00
Vassil Vassilev
a97a2811c9 maybeMangleDeclName should take GlobalDecl. This enforces integrity. 2013-10-29 20:19:17 +01:00
Vassil Vassilev
bd34a1ca16 Erase takes iterator and sets the wrapper fd to 0 if the wrapper is being erased. 2013-10-29 20:19:14 +01:00
Vassil Vassilev
aa5ae69f10 Make the function static. 2013-10-29 20:19:13 +01:00
Vassil Vassilev
f1e156daa4 Construct the mangle context upon each call. It is cheap to construct. And makes the call independent and static-ready :) 2013-10-29 20:19:12 +01:00
Axel Naumann
11f9065caa Misseplled oxygen tag. 2013-10-28 10:57:00 +01:00
Vassil Vassilev
082f3feab4 Dump the llvm::Module too. 2013-10-14 09:11:40 +02:00
Axel Naumann
5706d4bdef Workaround broken JIT exceptions, use longjmp instead. 2013-10-03 09:54:00 +02:00
Axel Naumann
790c34b4f4 Change in option sort order in llvm head. 2013-09-26 17:54:19 +02:00
Vassil Vassilev
8ffa2e2d8b Fix the doxygen only. 2013-09-26 09:42:57 +02:00
Vassil Vassilev
9a2b9913ce Fix doxygen warnings 2013-09-26 09:27:58 +02:00
Philippe Canal
e9376dd7a6 Re-add missing (at least on C+11) header file.
cstdlib is required for std::getenv.
2013-09-25 01:44:55 +02:00
Vassil Vassilev
f1a128f825 Reduce the amount of #included files. 2013-09-24 12:07:07 +02:00
Vassil Vassilev
f7a0987ac9 Move dynamic library handling in separate class. 2013-09-24 12:07:06 +02:00
Vassil Vassilev
9d87f9b56e Move dynamic library handling in separate class. 2013-09-24 12:07:05 +02:00
Vassil Vassilev
0421df1d22 Cleanup the temporary files. 2013-09-24 12:07:04 +02:00
Vassil Vassilev
19181a1392 Move the ExecutionContext-specific parts from the Interpreter. 2013-09-20 10:12:57 +02:00
Philippe Canal
4f81441b51 Add missing #include <cstdlib> 2013-09-19 23:55:55 +02:00
Vassil Vassilev
b74f068aaf Temporary fix to the build. This will be factored out by our future DynamicLibraryManager. 2013-09-18 21:08:54 +02:00
Vassil Vassilev
26a3abe1db Reset the cache only if there is a fileentry associated with it.
This avoids removing the cache of the virual file, wrapping the memory buffers
in cling.
2013-09-18 20:33:07 +02:00
Vassil Vassilev
b4f912f8c5 We don't need to keep track of the .L-ed files. The implementation of TCling is very raw and I bet we can improve it a lot. 2013-09-18 20:33:06 +02:00
Vassil Vassilev
cc13c4c79c Publish the useful helper class. 2013-09-18 20:33:05 +02:00
Vassil Vassilev
6f569a1aaa Move the implementation in an interpreter-independent object.
We don't need the intepreter to store clang's state. We can use a separate object
for that which allows to be reused.

Provide *much* shorter and cleaner implementation.
2013-09-18 20:33:05 +02:00
Vassil Vassilev
16243be584 Add getter and silence a warning. 2013-09-13 15:18:57 +02:00
Vassil Vassilev
5c7a283759 Synthesizing if(DeclRefExpr) throw requires cling to be run with rtti.
Fix that problem by introducing an indirection - a compiled function that throws.
2013-09-11 23:11:57 +02:00
Vassil Vassilev
b4e0eca21f Add trampoline that will help avoid running without -no-rtti. 2013-09-11 23:11:57 +02:00
Axel Naumann
4222ba870d Add more rationale as to how this exception is different from others. 2013-09-11 09:14:56 +02:00
Vassil Vassilev
c35e529cd6 Remove unused code. 2013-09-10 15:41:01 +02:00
Vassil Vassilev
d2b1e288a4 Spaces. 2013-09-10 15:41:01 +02:00
Axel Naumann
8f435ec57a File renamed 2013-09-09 18:02:53 +02:00
Axel Naumann
0782d4d515 Make CompilationException public, (also) use new cling runtime exception as base. 2013-09-09 18:02:53 +02:00
Vassil Vassilev
bffd16ea1d RuntimeExceptions got renamed. 2013-09-09 15:24:51 +02:00
Vassil Vassilev
8e9970d472 Rename filename. We don't use plural in the names... 2013-09-09 15:04:51 +02:00
Baozeng Ding
04d71f9f82 Pass in the Expr* instead of the SourceLocation. 2013-09-09 14:45:51 +02:00
Vassil Vassilev
aa1cd1d208 Fix doxygen warning. 2013-09-09 13:14:55 +02:00
Vassil Vassilev
1a2a7862c5 Propagate the new callback to our InterpreterCallbacks interface. 2013-09-09 13:14:55 +02:00
Vassil Vassilev
89d47f66d1 Improve the look&feel of the exception classes. 2013-09-07 10:46:54 +02:00
Jerome Beclin
afcd8a7cca Commit of storeState/compareState that now print lookup table and included files
Implementation of .files moved in the Interpreter.cpp

storeState now calls three functions: dumpAST(), dumpLookup(), printIncludedFiles().
compareState now calls three functions: compareAST(), compareLookup(), compareIncludedFiles().
It's working for the included files and the AST, and it needs a new patch for
being able to dump the lookup tables (we cannot use dumpLookups() for the moment).
2013-09-07 10:41:01 +02:00
Jerome Beclin
624354cfb4 Commit Interpreter.cpp with dumpLookupTable() function not working yet.
This will be fully operational after the LLVM/Clang update.
2013-09-07 10:41:00 +02:00
Vassil Vassilev
34d2c33c18 Handle the default interpreter's runtime exception. 2013-09-06 23:47:55 +02:00
Vassil Vassilev
7c6324d79b Add base class for the interpreter's runtime exceptions. 2013-09-06 23:47:55 +02:00
Vassil Vassilev
683a11e9e9 Use default cling style for naming classes. 2013-09-06 23:47:55 +02:00
Vassil Vassilev
eff9830b09 Add missing header method declarations. 2013-09-06 23:47:54 +02:00
Vassil Vassilev
7e7951185b Add special exception type for the null deref exceptions. 2013-09-05 19:08:55 +02:00
Philippe Canal
44891a9b46 Update doxygen doc 2013-09-05 13:52:52 +02:00
Axel Naumann
5e68396609 Fix constness. 2013-09-04 15:51:54 +02:00
Axel Naumann
88077c7e68 Add getter for dylib handle (against unused warning); remove unused kBitcode 2013-09-04 15:51:53 +02:00
Philippe Canal
53bf555194 In GetPartiallyDesugaredType add ability to replace a type by a typedef.
Add struct cling::utils::Transform::Config to hold both the list of typedef to
avoid desugaring (m_toSkip) and the list of type to replace by a nicer typedef
(m_toReplace).

This is used to replace basic_string<...> by std::string.
2013-09-03 13:18:55 +02:00
Vassil Vassilev
a6f245a8b4 Don't play smart* use proper empty str as default arg. 2013-08-28 16:44:01 +02:00
Vassil Vassilev
eaadf9d492 Finally fix that infinite const recursion. 2013-08-28 16:44:01 +02:00
Vassil Vassilev
2b67326e17 Fix getters, ending up in infinite recursion... 2013-08-28 16:44:00 +02:00
Vassil Vassilev
d7c785b0b2 Implement pretty print of DelayCallInfo. Constify. 2013-08-28 16:44:00 +02:00
Vassil Vassilev
8d3f2089b2 Order. 2013-08-28 16:44:00 +02:00
Vassil Vassilev
f043c36192 Constify. 2013-08-28 16:43:59 +02:00
Vassil Vassilev
94853302a7 Forward to the const getter. 2013-08-28 16:43:58 +02:00
Paul Russo
63cb406f2f Add support for TClingCallFunc function wrappers to transactions. 2013-08-28 03:46:06 +02:00
Baozeng Ding
69c20e16b9 Make shouldProceed C++ function. 2013-08-27 22:18:54 +02:00
Philippe Canal
467cb93b3e Add support for lookup function from QualType(s).
Add new overload for findFunctionProto and matchFunctionProto which rather than
taking the list of argument types as a StringRef, take it as a
const llvm::SmallVector<clang::QualType, 4>.  This avoids the (permanent)
allocations inside clang due to the Parsing of types.
2013-08-26 00:10:54 +02:00
Vassil Vassilev
c6e144f046 Fix param name. 2013-08-23 21:44:53 +02:00
Vassil Vassilev
36b6e36b1a Move the PPCallbacks in InterpreterCallbacks too. 2013-08-22 13:50:57 +02:00
Vassil Vassilev
2445d8b5fe Fix typo. 2013-08-22 13:50:57 +02:00
Vassil Vassilev
8c168320f0 Hide the callback adaptor classes in the implementation. 2013-08-22 13:50:56 +02:00
Vassil Vassilev
c8f4ac8beb Remove private ctor. 2013-08-22 13:50:54 +02:00
Vassil Vassilev
1c04a16ae6 Hide InterpreterExternalSemaSource class as an implementation detail. 2013-08-22 13:50:54 +02:00
Vassil Vassilev
6527a15123 We don't need the the members and the accessors. 2013-08-21 14:29:58 +02:00
Jerome Beclin
ead0f8d091 Implement cling (clang) internal state verification.
There are cases where cling needs to 'rollback' its state to a previous one.
Examples for that are cling's error recovery and code unloading. This can become
easily tricky to implement. One step reducing the complexity is the verification
of the 'interesting' data structures.

Implement .storeState and .compareState commands, which dump the internal compiler
data structures like AST (implemented), included files (in progress) and lookup
tables (unimplemented yet). The information is dumped into a file and then that
file is diff-ed to the one taken with .compareState. If they were identical all
files are deleted otherwise a .diff file with the differences remains for debug.
2013-08-21 14:29:57 +02:00
Axel Naumann
3b64a6b98a Nobody but I sees dlsym handles const :-) Give in. 2013-08-21 14:06:58 +02:00
Axel Naumann
05f7752740 Make static; ROOT must call it before cling::Interpreter is created. 2013-08-21 14:06:57 +02:00
Axel Naumann
6cf9eba1d9 Add an interface for the ExecutionEngine to look at a RTLD_LOCAL library. 2013-08-21 14:06:57 +02:00
Axel Naumann
9b019990ea Keep a set of .so handles without creating a llvm::sys::DynamicLibarary for each
Symbol lookup happens through dlsym(0).
Handle 0, i.e. the program image, is the only DynamicLibrary that is created.
2013-08-21 14:06:55 +02:00
Vassil Vassilev
88cc4a1ed2 Implement autoloading of entities in unknown namespaces. Eg. MyNamespace::MyClass. The implementation is far from ideal, but for the timeline we have it is good enough. On a second iteration it could be improved a lot. 2013-08-21 10:54:51 +02:00
Axel Naumann
327dbb72cc Fix doxygen param doc 2013-08-17 12:21:53 +02:00
Philippe Canal
39d8a3e8a6 Add matchFunctionProto returning the decl only in case of exact match.
The new call is:

const clang::FunctionDecl* matchFunctionProto(const clang::Decl* scopeDecl,
                                              llvm::StringRef funcName,
                                              llvm::StringRef funcProto,
                                              bool objectIsConst
                                              ) const;

and the function must match in name and prototype (including constness).
The only thing not checked is the actual declaration context.
2013-08-17 01:45:56 +02:00
Philippe Canal
31b60e0ab5 Add support for restricting the function search to const functions.
Add an optional argument objectIsConst to findFunctionArgs and
findFunctionProto:

   const clang::FunctionDecl* findFunctionProto(const clang::Decl* scopeDecl,
                                                llvm::StringRef funcName,
                                                llvm::StringRef funcProto,
                                                bool objectIsConst) const;

   const clang::FunctionDecl* findFunctionArgs(const clang::Decl* scopeDecl,
                                               llvm::StringRef funcName,
                                               llvm::StringRef funcArgs,
                                               bool objectIsConst) const;
2013-08-17 01:45:55 +02:00
Vassil Vassilev
31da52cca3 Add iterators over the deserialized declarations. 2013-08-07 14:58:00 +02:00
Vassil Vassilev
3643b28116 Change the state when the transaction gets returned in the pool. Simplifies debugging. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
67a8bbfd1f Make setNext public and thus the IncrementalParser will be no more friend of the transaction. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
01314c9d78 Transaction takes and stores the ASTContext, otherwise it is too much of an effort to get it from the DeclQueue, which might contain null DGRs. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
dfe1c172b6 Style. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
a8c9e880e9 Transactions that triggered deserialization shouldn't be considered as empty, because logically they are not and because ROOT needs the callbacks to be fired. 2013-08-02 17:34:57 +02:00
Vassil Vassilev
a6fbc75dfa Move the TransactionPool in its own file. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
4230a3cc6c Remove redundant transaction state. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
cb27a8c694 Since we have the transaction pool we can afford to construct the decl collection non-lazy. This is because we know that this will be reused. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
c21695c982 Implement a transaction pool. This will help reusing empty transactions and reduce the number of alocations. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
c03e35696e Add more brief transaction structure printout for debugging purposes. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
d25550e955 Sync names. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
abeaf4b6d7 Fix an issue with deleting the nested transaction marker. Improve style. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
8de890ee52 Add default constructor and move the initialization in a separate routine. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
63f1ce5082 Outline method. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
f841f0bc8d Add extra assert enforcing integrity. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
48984bc835 Simplify commitTransaction by moving the running of inits in the caller.
Temporarily we create a nested transaction instead of delegating that to the
caller to decide. This should be fixed soon.
2013-08-02 17:34:54 +02:00
Vassil Vassilev
fc7d1879da Replace Decl** with the more accurate Transaction**.
Add output Transaction parameter to Interpreter::parse.
2013-07-15 12:58:54 +02:00
Axel Naumann
a2bb0b2b46 codegen() really does emitAllDecls(); use new IncrementalParser interfaces. 2013-06-28 00:33:17 +02:00
Vassil Vassilev
777a44ad37 Define operator== and operator!= for DelayCallInfo. 2013-06-25 09:30:35 +02:00
Vassil Vassilev
ef0c731ecb Add method removing nested transactions. Move reset implementation in the cpp file. 2013-06-25 09:30:34 +02:00
Vassil Vassilev
93d0d81de2 The null DGR is a marker for nested transactions. Instead using isNull DGR protected interface append, push back the marker in the decls queue. 2013-06-25 09:30:34 +02:00
Vassil Vassilev
1ee8915aa6 Since we enforced very strict policy when declarations should be added to a transaction we have corner cases which need to be handled. For example in the transaction transformers there could be template instantiations happening and the transaction should be open and expecting decls. 2013-06-25 09:30:34 +02:00
Vassil Vassilev
ebd1976bf3 No Constness and semi needed anymore. 2013-06-25 09:30:31 +02:00
Vassil Vassilev
87a4b6bd63 From Baozeng: Add .printIR meta command, printing the llvm::Module. 2013-06-17 21:00:58 +02:00
Axel Naumann
09bf261456 Fix for __float128 / c++11; define __CLING__CXX11 for c++11 2013-06-13 14:03:03 +02:00
Axel Naumann
11e71f5c76 Make result evaluation optional again. 2013-06-10 17:12:50 +02:00
Axel Naumann
0c1c22f002 Return action result and Value from all interfaces. Force callers to rpovide them, to make them handle errors etc. 2013-06-07 15:19:51 +02:00
Vassil Vassilev
53d39b672e Revert "Nested transactions share the parent's llvm::Module."
This reverts commit 9ae79df05006247cfed1e7e89e0fd371f3eba459.
2013-06-05 16:26:51 +02:00
Vassil Vassilev
947054ccec Revert "Constness and semi."
This reverts commit bbb8e62b1d8bc58ec157cb2ad8e0fe67f751a6ca.
2013-06-05 16:26:51 +02:00
Vassil Vassilev
e74e7655d0 Revert "Progress on the llvm multi-module support."
This reverts commit 9d78faef6a45cb16c05fe7a96d9e2eb9fb2c1298.
2013-06-05 16:26:51 +02:00
Vassil Vassilev
b1d11c2987 Progress on the llvm multi-module support.
Now we build a llvm::Module per cling::Transaction and link them in on commit.
2013-06-05 16:26:51 +02:00
Vassil Vassilev
52b5d39f7d Constness and semi. 2013-06-05 16:26:50 +02:00
Vassil Vassilev
42c4d235a2 Nested transactions share the parent's llvm::Module. 2013-06-05 16:26:50 +02:00
Axel Naumann
334b389936 Move delimiter / separator printing to caller. 2013-05-15 11:43:12 +02:00
Axel Naumann
4219c4e1a9 Split value printing interface into printValue(), printType().
TString is missing a newline; will refactor printing of delims (to be done by pcaller).
2013-05-15 11:43:12 +02:00
Axel Naumann
9a9f49f129 printValue() now returns a std::string to reduce dependency on cling / llvm. 2013-05-15 11:43:12 +02:00
Axel Naumann
3a5d293518 Fix documentation. 2013-05-15 11:43:12 +02:00
Axel Naumann
f507a8da1b Rename public value printer function to cling::printValue. 2013-05-15 11:43:12 +02:00
Vassil Vassilev
782d2568ea Factor our common functionality and replace CreateTypeSourceInfo with getTrivialTypeSourceInfo.
git-svn-id: http://root.cern.ch/svn/root/trunk@49347 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-25 12:48:15 +00:00
Axel Naumann
70695fe2be Update to clang/llvm r179269 (llvm vendor branch r49215):
Parser::Scope versus Sema::DeclContext are now checked for cross-vailidity.
Emit the TU-transaction explicitly instead of relying on a first transaction.
The typename extraction now takes a stream instead of a string to write to.
The llvm::Linker has much reduced functionality; use llvm::sys::Path instead to find dynamic libraries.


git-svn-id: http://root.cern.ch/svn/root/trunk@49325 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 16:28:08 +00:00
Vassil Vassilev
343a649e42 Reorder enum. Add enum constant for the size, fix a wrong condition in an assert.
git-svn-id: http://root.cern.ch/svn/root/trunk@49320 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 15:04:09 +00:00
Vassil Vassilev
5e47631c1c Check whether the begun transaction is the one being committed.
git-svn-id: http://root.cern.ch/svn/root/trunk@49315 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 12:53:08 +00:00
Vassil Vassilev
a02f334f7f Don't be too harsh if somebody asks for the last nested transaction.
git-svn-id: http://root.cern.ch/svn/root/trunk@49314 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 12:52:07 +00:00
Vassil Vassilev
852606b028 Reuse the empty nested transactions too.
git-svn-id: http://root.cern.ch/svn/root/trunk@49307 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 09:57:30 +00:00
Vassil Vassilev
2d770ce24c Move resetting of the transaction in the transaction itself.
git-svn-id: http://root.cern.ch/svn/root/trunk@49303 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 09:06:58 +00:00
Vassil Vassilev
0fac9d5de3 Empty is a transaction with no decls and no nested transactions.
git-svn-id: http://root.cern.ch/svn/root/trunk@49302 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 08:51:27 +00:00
Vassil Vassilev
8817cef9ca Reduce the creation of empty top-most transactions. Instead if the last
transaction was empty just reuse it.


git-svn-id: http://root.cern.ch/svn/root/trunk@49301 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-24 06:55:38 +00:00
Vassil Vassilev
ec7bc1e519 Move the set of llvm::Module from the Transaction ctor to commitTransaction.
git-svn-id: http://root.cern.ch/svn/root/trunk@49295 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-23 21:36:41 +00:00
Axel Naumann
48b4a4e934 For Decls coming from a parsed file that describes the content of a library:
the callbacks must be triggered for those, too.
As they are not part of a transaction (think "module") they are now sent to the deserialization listener.
This can be removed once the modules work.

Set the state of the transaction to Committing before the static init - which might trigger more decls even though CodeGen has been run over the decls.

Forward DeclCollector::HandleInterestingDecl() to DeclCollector::HandleTopLevelDecl() for decls from the AST reader / from headers describing libraries.

Empty transactions must be passed to TCling; they trigger the sending of deserialized decls to ROOT/Meta.

Don't start TCling's artificial TU Transaction if the transaction coming in is empty - we need a decl to get the ASTContext.

Swap the deserialized decls before handling them in TCling, such that nested calls don't see the same decls again.


git-svn-id: http://root.cern.ch/svn/root/trunk@49197 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-10 15:15:49 +00:00
Vassil Vassilev
3ce238085f Reorder: put the nested transaction container right after the decl container.
git-svn-id: http://root.cern.ch/svn/root/trunk@49140 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-09 08:55:54 +00:00
Vassil Vassilev
4760be34eb Remove redundant method. Improve style.
git-svn-id: http://root.cern.ch/svn/root/trunk@49138 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-09 08:44:51 +00:00
Vassil Vassilev
564659c170 Fix a misnomer.
git-svn-id: http://root.cern.ch/svn/root/trunk@49125 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-08 14:35:35 +00:00
Vassil Vassilev
df0dc16c07 Make cling::Transaction cheaper to construct. Lazy-create the container of the
nested transactions. 

Now sizeof(cling::Transaction()) == 56.


git-svn-id: http://root.cern.ch/svn/root/trunk@49124 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-08 14:27:57 +00:00
Axel Naumann
a91112365b Add documentation!
git-svn-id: http://root.cern.ch/svn/root/trunk@49105 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-05 21:55:12 +00:00
Axel Naumann
2e153295ff Make the default compilation options compatible with a compiler.
Add comparison ops: I needed them for a dead end and now I have them and the compiler won't generate its own.


git-svn-id: http://root.cern.ch/svn/root/trunk@49101 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-05 15:10:05 +00:00
Axel Naumann
8c680be610 Implement hasFunction().
Rephrase !(a==b).

This file still needs major refactoring to remove code duplication.


git-svn-id: http://root.cern.ch/svn/root/trunk@49099 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-05 13:50:01 +00:00
Axel Naumann
89d418feb6 Remove Completed flag; integrated it into state:
collecting->completed->committing->committed
Make m_DeclQueue lazily allocated to reduce sizeof(Transaction) in an effort to make the TransactionRAII cheaper - second part is coming up.
Remove unused thus unneeded and annoying (non-const) iterator interfaces; they clash with the constness of the EmptyQueue.


git-svn-id: http://root.cern.ch/svn/root/trunk@49097 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-05 13:43:01 +00:00
Axel Naumann
ce0752f698 Rename state kUnknown to kCollecting.
Implement Transaction::printStructure().
Remove unnecessary non-const overload of getWrapperFD().


git-svn-id: http://root.cern.ch/svn/root/trunk@49095 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-05 13:12:57 +00:00
Vassil Vassilev
1e8aee2da4 Resurrect the trunk:
The issue is that sometimes we don't have a begun transaction. This can happen
mostly in cases when the code doesn't come from text representation but:
  * From lookup, where template is being instantiated
  * From a PCH/PCM, where a decl was deserialized.

This patch solves the first case: When we do findScope we have to instantiate
the declaration if needed.
Every time there is a chance that generated code's declarations can be orphaned,
we have to explicitly push a transaction so that we can keep the integrity.


git-svn-id: http://root.cern.ch/svn/root/trunk@49070 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-03 16:25:08 +00:00
Vassil Vassilev
2b054ac81d Remove files from cling's trunk. They are in clang's mainline and our vendor drop.
git-svn-id: http://root.cern.ch/svn/root/trunk@49069 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-03 14:55:23 +00:00
Axel Naumann
8389c5b1e1 Merge development from branches/dev/root6-pch into the trunk: enable PCH for ROOT.
git-svn-id: http://root.cern.ch/svn/root/trunk@48958 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-27 18:07:03 +00:00
Axel Naumann
4a0c1c6e1f Merge with trunk, r48857 - r48937.
git-svn-id: http://root.cern.ch/svn/root/branches/dev/root6-pch@48938 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-26 15:23:24 +00:00
Vassil Vassilev
25e1924b5f *Lay the foundation of return by-value support.
Some functions return temporary objects. Eg:

  std::string getName() {
    return "ROOT";
  }

  In that case the lifetime of the temporary variable is defined by the caller. 
  Such function called by TClingCallFunc would cause undefined behaviour, because
  there is no actual caller and the compiler cannot define any lifetime. 

  In order to provide such concept we have implemented cling::StoredValueRef, which
  is a reference counted cling::Value. As long as somebody "has" a copy of it, the
  boxed value (and the occupied memory) will live.

  However cling::Value and cling::StoredValueRef expose LLVM/clang/cling internals
  to ROOT. We want to avoid for now exposing LLVM/clang/cling internals, so we have
  TInterpreterValue, which makes cling::StoredValueRef opaque.

*New interface taking TInterpreterValue is added to the TInterpreter to allow the
users to manage the lifetime of the returned temporaries.

*Replace the occurrances of cling::Value with cling::StoredValueRef to avoid 
any lifetime management issues.

*Minor optimizations of the existing implementation

*Tweaks to the build system so that TInterpreterValue.cxx could 
#include cling/Interpreter/StoredValueRef.h

PLEASE NOTE: This is not the final implementation it needs polishing. Eg. there
is a bug that should be fixed soon, which doesn't allow to get the actual result
out of the TInterpreterValue.


git-svn-id: http://root.cern.ch/svn/root/trunk@48895 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-18 21:30:00 +00:00
Fons Rademakers
a3cb06c5e6 Fixes for compiling with C++11 and libcxx on OSX.
git-svn-id: http://root.cern.ch/svn/root/trunk@48886 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-17 13:31:45 +00:00
Axel Naumann
0de0164c3f Add a deserialization listener: we do not receive all decls through the ASTConsumer interface.
git-svn-id: http://root.cern.ch/svn/root/branches/dev/root6-pch@48864 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-13 09:26:55 +00:00
Axel Naumann
77ba6929b0 v5 of patches.
Remaining:
* callfunc issues finding functions
* vtable issues (likely related)
* in stressHistogram: Test  3: Projection with Range for Histograms and Profiles................OK
  Error in <TStreamerInfo::Build>: TProfile, unknown type: EErrorType fErrorMode


git-svn-id: http://root.cern.ch/svn/root/branches/dev/root6-pch@48858 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-11 13:11:15 +00:00
Axel Naumann
5408532f3b Don't expose DynamicLookupRuntimeUniverse.h to G__Meta.o (missing symbol gCling).
Reshuffle gCling; definition is now provided by the Interpreter internally, not in any header.
This will cause missing symbols in libraries instead of silently creating dumplicated (JIT / library).
Still requires Vassil to add a parameter to LifetimeHandler() - but this will cause a cling test failure as a reminder.


git-svn-id: http://root.cern.ch/svn/root/trunk@48817 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-05 17:03:49 +00:00
Vassil Vassilev
e6a53da83d Add documentation and silence doxygen warning.
git-svn-id: http://root.cern.ch/svn/root/trunk@48812 27541ba8-7e3a-0410-8455-c3a389f83636
2013-03-05 11:18:59 +00:00
Vassil Vassilev
12a6b029e3 Typo.
git-svn-id: http://root.cern.ch/svn/root/trunk@48762 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-28 10:03:29 +00:00
Axel Naumann
1acbc2d486 GenericValue::op= is smart; it takes *this into account.
That won't work for construction; so replace with placement new.
Also need default c'tor for Value() to initialize m_GV correctly.


git-svn-id: http://root.cern.ch/svn/root/trunk@48709 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-26 11:14:05 +00:00
Axel Naumann
46bd172859 Add proper include guard.
This header gets included by enabling dynamic lookup, and by RegisterModule() of G__Meta.
We need the latter for the many-pcm case.


git-svn-id: http://root.cern.ch/svn/root/trunk@48703 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-26 09:46:50 +00:00
Axel Naumann
b364112d1d Don't expose SmallVector (which needs DataTypes.h).
Use vector instead.


git-svn-id: http://root.cern.ch/svn/root/trunk@48691 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 15:54:36 +00:00
Axel Naumann
5279835d41 Add explicit copy c'tor + assign op so no uninit memory gets copied.
git-svn-id: http://root.cern.ch/svn/root/trunk@48689 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 15:20:49 +00:00
Axel Naumann
9d69f41211 Move llvm::sys::DynamicLibrary out of the Interpreter header.
git-svn-id: http://root.cern.ch/svn/root/trunk@48685 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 13:38:54 +00:00
Axel Naumann
c835d37455 Don't store Paths but strings. Reduces dependencies.
git-svn-id: http://root.cern.ch/svn/root/trunk@48683 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-25 13:14:24 +00:00
Axel Naumann
664e8b22ac Reduce the amount of headers needed by the dynamic scopes at runtime:
* Make GenericValue, clang::QualType opaque in Value
* Move LifetimeHandler implementation into source; requires separate header
* 

Also:
* Value: replace CPP macros by overloads


git-svn-id: http://root.cern.ch/svn/root/trunk@48675 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-22 15:59:54 +00:00
Axel Naumann
e0397a6d4c Be specific about which gCling we are talking about (ROOT has its own...)
git-svn-id: http://root.cern.ch/svn/root/trunk@48667 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-21 17:34:59 +00:00
Vassil Vassilev
3bcfc8b25e Prepare dynamic scopes for integration in ROOT;
* Merge the DynamicIDHandler into InterpreterCallbacks. The DynamicIDHandler was
used to define the failed lookup names as dependent, so that later on they could
be "healed" by the EvaluateTSynthesizer - by generating a call to gCling->EvaluateT...

* Add a flag in the InterpreterCallbacks giving a hint when the failed lookup is
performed - during compilation time or during evaluation type, maybe its name is
misnomer. Maybe I should rename it to IsInRuntimeEvalMode or smth like that...

* Simplify the evaluation routine. The idea is to be merged with one of the 
existing - either echo or evaluate

* Implement proper mock object as test dynamic symbol resolver callback. Now it
fully relies on InterpreterCallbacks.

* Implement dynamic expression node marking. Every node that needs runtime 
resolution is marked as dependent. However, clang marks other nodes as dependent,
too (eg. templates). Until now it was very difficult to distinguish between both.
Now every "artificially" (marked by us) node's declaration is annotated so that 
it could be found back easily by using a simple RecursiveASTVisitor.

Generally we have two issues when using dynamic scopes - filtering the failed 
lookups that need to be evaluated at runtime, and filtering the "artificially"
marked as dependent dynamic nodes/decls. Whereas the second issue is solved by
using the annotations, the first one is more tricky to solve because clang doesn't
give us enough information to conclude what should be done. For now I have 
narrowed down the cases so that dynamic nodes can appear only in function decls.


git-svn-id: http://root.cern.ch/svn/root/trunk@48575 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 17:29:30 +00:00
Vassil Vassilev
ca634731e2 Tabs.
git-svn-id: http://root.cern.ch/svn/root/trunk@48569 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-14 11:36:41 +00:00
Vassil Vassilev
729b170788 Enrich the implementaion of Interpreter::mangleName, make it public and rename it
to maybeMangleDeclName (which is more talkative).
Use Interpreter::maybeMangleDeclName instead of duplicating code.


git-svn-id: http://root.cern.ch/svn/root/trunk@48545 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-12 15:38:44 +00:00
Vassil Vassilev
7abc2a8334 Add support in TClingCallFunc for calling virtual functions: when we have a
CallFunc representation of a member function, we have its concrete address, and
if there is derived class there is no way how to evaluate the vtable and call the
correct virtual.

In order to evaluate the member's vtable, we either have to calculate it (which
is platform/implementation dependent) or create a trampoline function which calls
the target function. Thus codegen will generate code for vtable evaluation. The
trampolines are created for functions that could be possibly virtual - non-static
member functions, declared as virutal. A trampoline looks like this:

void unique_name(Base* This, MyClass2* a, MyClass3* b, double c, MyClass* ret) {
  if (ret) 
    *ret = This->function(*a, *b, c);
  else 
    This->function(*a, *b, c);
}

where we pass in explicitly the address that CallFunc is given (This), followed
by set of arguments (possibly needing conversion) and if the target is non-void
a last argument that is used to provide a storage for the return result.

The given arguments and the required by *LLVM* IR may differ - in that case 
simple argument conversions are done. For now primary pointers and builtins, which
covers pretty much entire LLVM type system.

Note that the first implementation is very rough and suboptimal, however it is 
very good starting point (milestone):
* Common code is extracted out in its separate routines (here a lot of refactoring more
could be done).
* cling::Value now stores besides clang::QualType, describing (soft-of inaccurately)
the llvm::GenericValue, LLVM-type which is the actual description of the generic value.
* cling::Value naming conventions improved;
* cling::Interpreter::getLLVMType is added temporarily and soon will be removed.

* TClingCallFunc now preallocates space for the this ptr and the return result.
(instead of multiple array copies)
* TClingCallFunc now stores not llvm::GenericValues but cling::StoredValueRefs
because the type conversions need llvm::GenericValue's description (which 
essentially is the type).
* Does better default argument evaluation: it could be even *more betterer* if
we query Sema to fold for us the constant expressions instead of decompiling them
to source and using cling for evaluation.
* Return storage implemented.


And, yes that is the longest commit message in my life...
Implementation of argument conversion is revised.


git-svn-id: http://root.cern.ch/svn/root/trunk@48537 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-11 17:30:03 +00:00
Vassil Vassilev
d14cab524a Add TODO.
git-svn-id: http://root.cern.ch/svn/root/trunk@48536 27541ba8-7e3a-0410-8455-c3a389f83636
2013-02-11 17:03:50 +00:00
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
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
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
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
8c385cf901 Use better naming.
git-svn-id: http://root.cern.ch/svn/root/trunk@46809 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-25 14:07:19 +00:00
Vassil Vassilev
5d4af3ddc7 Add a way to disable the complaints of HandleMissing symbol, when it is ok for
the symbol to be missing.


git-svn-id: http://root.cern.ch/svn/root/trunk@46795 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-25 09:17:45 +00:00
Vassil Vassilev
f398425dbb Add note.
git-svn-id: http://root.cern.ch/svn/root/trunk@46791 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-25 08:33:40 +00:00
Vassil Vassilev
88bd362c63 Keep the const version only for now.
git-svn-id: http://root.cern.ch/svn/root/trunk@46742 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-23 13:03:08 +00:00
Vassil Vassilev
71ccaf68b7 Fix a typo, which will silence doxygen warnings.
git-svn-id: http://root.cern.ch/svn/root/trunk@46734 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-23 08:52:48 +00:00
Vassil Vassilev
acef61e88f Fix not only the address but the string too.
git-svn-id: http://root.cern.ch/svn/root/trunk@46681 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:49:34 +00:00
Vassil Vassilev
94994c05dc Publish the head of the transaction list so that the transactions become
iteratable. (We will use it in TCintWithCling)


git-svn-id: http://root.cern.ch/svn/root/trunk@46677 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:30:06 +00:00
Vassil Vassilev
da3a51f5f8 Make the transaction class single list.
git-svn-id: http://root.cern.ch/svn/root/trunk@46676 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 13:29:03 +00:00
Vassil Vassilev
d916876642 RunFunction takes FunctionDecl as an argument. Thus it avoids a lookup and
simplifies the implementation.


git-svn-id: http://root.cern.ch/svn/root/trunk@46673 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 11:56:52 +00:00
Vassil Vassilev
dac353c6df Each transaction has one wrapper function that we use all over.
Register the wrapper function in the transaction so that we can find it without
having to iterate over the rest of the declarations.


git-svn-id: http://root.cern.ch/svn/root/trunk@46672 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 11:49:49 +00:00
Vassil Vassilev
24cdb599f7 In many modes (eg like evaluate and value print) we need to find the last
expression in the wrapper function and do things with it. In some cases we 
must consider variable declarations as expressions (eg. int i = 5;) and take
the l-value and build a DeclRefExpr and return it.
Extract that common functionality out in a utility function and call it whenever
needed.


git-svn-id: http://root.cern.ch/svn/root/trunk@46668 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-19 09:22:36 +00:00
Axel Naumann
9327a62ee1 Revert test r46655
git-svn-id: http://root.cern.ch/svn/root/trunk@46656 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 17:43:39 +00:00
Axel Naumann
5b0f6be89c Test for struct/class: who is complaining?
git-svn-id: http://root.cern.ch/svn/root/trunk@46655 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 17:42:39 +00:00
Vassil Vassilev
7f6039444b When we evaluate we *must* provide a value where the evaluated result to be stored
git-svn-id: http://root.cern.ch/svn/root/trunk@46642 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 12:24:04 +00:00
Vassil Vassilev
bdc04cd18e Extract the code duplication in separate routine.
git-svn-id: http://root.cern.ch/svn/root/trunk@46638 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 12:05:53 +00:00
Vassil Vassilev
f48a4881cd Add super efficient execute function. It doesn't do any fancy things with the
declarations - it just compiles and runs given expression or statement.


git-svn-id: http://root.cern.ch/svn/root/trunk@46636 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 11:56:20 +00:00
Vassil Vassilev
fe93a54d61 Silence doxygen warning.
git-svn-id: http://root.cern.ch/svn/root/trunk@46628 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-18 08:19:19 +00:00
Vassil Vassilev
ec129305af Centralize the unique name prefix (the names generated by the interpreter use it)
and provide utility function which checks if a decls has such name.


git-svn-id: http://root.cern.ch/svn/root/trunk@46593 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-17 08:52:24 +00:00
Vassil Vassilev
ae3a0dfdad * Factor out the duplicate code.
* Avoid alloc/dealloc of the entire body of the function (the CompoundStmt) by
using ugly iterator + offset tricks.


git-svn-id: http://root.cern.ch/svn/root/trunk@46553 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-15 16:57:53 +00:00
Vassil Vassilev
c5a8df6c88 Prepare cling for fixing bug #98146. In principle the bug could be fixed in 10
seconds, but I don't like where EvaluateInternal is going.
At first place it shouldn't do any smart guessing what the transformers would do.
Second it shouldn't try to attach expression evaluation (storing the result in 
cling::Value) while preparing for value printing.

To sum up:
* Simplify the old craft in EvaluateInternal
  - Move the value printing logic into the value printer transformer. 
  - Move the expression evaluation login (mainly coming through the 
Interpreter::evaluate interface) into separate transformer.
* Attach the new transformer to the list of transformers (the size of it was 
increased as well.)
* Add new compilation option switch that the new transformer will react on.
* Turn on the switch where necessary.
* Simplify value printer logic. Now everything is at one place, which makes it
simpler and easier to debug.
* Make IncrementalParser::Parse to take compilation options' reference instead of
constructing it's own.
* As consequence of the new implementation - two bugs in the testsuite were 
uncovered. Propose a fix for them.
* Improve documentation.
* TODO: There is some code duplication, which will be factored out soon.


git-svn-id: http://root.cern.ch/svn/root/trunk@46549 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-15 13:42:09 +00:00
Vassil Vassilev
01896277e2 Centralize the common code in to a method and just call it. Reduces a *lot* the
code duplication.
Adjust the creation of ParserStateRAII object used to recover the parser on exit.


git-svn-id: http://root.cern.ch/svn/root/trunk@46510 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-12 16:09:04 +00:00
Vassil Vassilev
be7177b93c Extract out the common part of setting up and recovering the parser.
git-svn-id: http://root.cern.ch/svn/root/trunk@46508 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-12 15:27:02 +00:00
Axel Naumann
4908b97968 Don't allocate twice for small values.
The StoredValue has to be heap allocated, so it can be deleted when refcount == 0.
But the value it points to now is simply contained inside the StoredValue if
* it fits into the GenericValue (double,...)
* it is <= 80 bytes.
This grows StoredValue (not Ref!) from 48 to 128 bytes on Linux 64bit.
Given that many OSes allocate an extra 16 bytes for each allocation (i.e. the actual cost is 80-16 bytes), this is still reasonable.


git-svn-id: http://root.cern.ch/svn/root/trunk@46491 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-12 13:22:12 +00:00
Vassil Vassilev
475ad9a757 * SymbolResolverCallback should create DynamicIDHandler as its InterpreterExternalSemaSource.
* InterpreterExternalSemaSource::setCallbacks is not needed any more. 
  It can be set in the constructor instead.


git-svn-id: http://root.cern.ch/svn/root/trunk@46444 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 15:50:17 +00:00
Vassil Vassilev
9d654b26f9 No need to enable/disable, check for enabled/disabled callback. Either they are
there and we use them or not.


git-svn-id: http://root.cern.ch/svn/root/trunk@46440 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 14:50:45 +00:00
Vassil Vassilev
a047926b87 Usually we have to distinguish between lookup failures. Eg. there are certain
lookups that are expected (by the compiler) to fail and those which should not fail.

I was misled (wasn't thinking at all: Thanks Axel for questioning the checkin) 
because I thought we cannot distinguish those two different cases in the test
callback. 
Silly mistake:
  Revert the changes in the testsuite.
  Revert the default setup of the test callback in enableDynamicLookup

The problem is solved by extracting out the function which determines whether
a lookup is not expected to fail. (It still needs better place.)


git-svn-id: http://root.cern.ch/svn/root/trunk@46438 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 14:37:10 +00:00
Vassil Vassilev
3bba03cf9f *The JIT is configured to compile with RTTI so when we #include the SymbolResolverCallback
it looks for typeinfo of the InterpreterCallbacks (compiled with fno-rtti).

*Move the SymbolResolverCallback into InterpreterCallbacks.(h,cpp). Ideally it is 
used only in the testsuite so we could hack in the build system to build the 
SymbolResolverCallback with fno-rtti and include just the header file but that's
for later.
*Set the symbol resolver callback in enableDynamicLookup for now.
*Clear up the logic behind InterpreterExternalSemaSource and InterpreterCallbacks.
*Now the DynamicIDHandler derives from InterpreterExternalSemaSource.
*Adapt the testsuite to the change.
*Request the InterpreterCallback constructor to be put in the binary.


git-svn-id: http://root.cern.ch/svn/root/trunk@46435 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-10 13:00:17 +00:00
Vassil Vassilev
e75c9b1a13 The callback class implements LookupObject callback, which should be called even
no dynamic scopes are involved. The information about a failed lookup comes from 
slightly different channel - ExternalSemaSource (if attached to sema).

In order to make the callback LookupObject work when we attach an arbitrary 
callback class we should attach ExternalSemaSource to Sema as well. This require
a default implementation for an ExternalSemaSource.


git-svn-id: http://root.cern.ch/svn/root/trunk@46396 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-09 10:17:19 +00:00
Vassil Vassilev
6e341e8376 Implement functions that check whether a name was interpreter-generated.
git-svn-id: http://root.cern.ch/svn/root/trunk@46395 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-09 09:48:54 +00:00
Vassil Vassilev
a67f0ebca8 * Add another overload taking DeclarationName as an argument. This is useful when
we have to deal with failed lookups.
* Improve documentation.


git-svn-id: http://root.cern.ch/svn/root/trunk@46394 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-09 09:41:26 +00:00
Axel Naumann
0a9ed8027c Remove cling::Value-compatible overloads.
Use "m_" as member prefix.
Remove adopt() - not needed.
Remove hasValue() - it's meaningless (use isValid() to check validity of value).


git-svn-id: http://root.cern.ch/svn/root/trunk@46341 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 13:10:28 +00:00
Axel Naumann
bc18a88f10 Essential part of r46334. Log was:
Add cling::StoredValueRef: a ref-counted value with automatic storage management.
Update Interpreter to use that instead of cling::Value.
This fixes an issue where the called neded to guess the return type of the wrapper function, such that for instance Interpreter::Evaluate() has storage for the wrapper's aggregate SRet return value if needed.
Instead, the Interpreter now allocates the proper storage for return values, and hands out references to it.
StoredValueRef is tiny (8bytes on 64bit Linux); default allocation is cheap.


git-svn-id: http://root.cern.ch/svn/root/trunk@46335 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 12:18:14 +00:00
Axel Naumann
3ec1741cf9 Add cling::StoredValueRef: a ref-counted value with automatic storage management.
Update Interpreter to use that instead of cling::Value.
This fixes an issue where the called neded to guess the return type of the wrapper function, such that for instance Interpreter::Evaluate() has storage for the wrapper's aggregate SRet return value if needed.
Instead, the Interpreter now allocates the proper storage for return values, and hands out references to it.
StoredValueRef is tiny (8bytes on 64bit Linux); default allocation is cheap.

Update TCintWithCling and friends; don't pass the returnValue in if the caller does not need it.
TClingCallFunc: provide storage for fArgs.


git-svn-id: http://root.cern.ch/svn/root/trunk@46334 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 12:09:51 +00:00
Vassil Vassilev
5e4f599000 Typo.
git-svn-id: http://root.cern.ch/svn/root/trunk@46331 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-05 10:32:03 +00:00
Vassil Vassilev
f8d42d206f Add sensible constructor.
git-svn-id: http://root.cern.ch/svn/root/trunk@46319 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-04 16:03:05 +00:00
Vassil Vassilev
a7261215a3 Add multiplex external sema source, which is a list of sema sources. When it is
used it dispatches the events to every element of the list of sources.

This is used because we want to have ASTDeclReader and our custom external source
catching LookupUnqualified callbacks, happening on failed lookup.


git-svn-id: http://root.cern.ch/svn/root/trunk@46317 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-04 15:47:10 +00:00
Vassil Vassilev
32f4bd161b Add non-const getter.
git-svn-id: http://root.cern.ch/svn/root/trunk@46288 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-03 12:57:09 +00:00
Vassil Vassilev
a41c19237c * Remove the craftwork from dealing with setting callbacks.
* Simplify the impelentation of DynIDHandler.
* Create a shortcut for getting the semantic analysis object.


git-svn-id: http://root.cern.ch/svn/root/trunk@46287 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-03 12:40:41 +00:00
Vassil Vassilev
0ada6afba2 Silence doxygen warnings
git-svn-id: http://root.cern.ch/svn/root/trunk@46279 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-03 09:21:57 +00:00
Vassil Vassilev
e087402f78 * Implement interpreter callbacks, which the Interpreter owns.
* Implement new callback functions - on transaction committed and transaction unloaded.
* Publish the Transaction class so that it can be visible by TCintWithCling.
* Publish the CompilationOptions needed by Transaction.
* Fix the references of Transaction and CompilationOptions.
* Forward declare where possible.
* Add missing keywords.
* Improve include style.


git-svn-id: http://root.cern.ch/svn/root/trunk@46264 27541ba8-7e3a-0410-8455-c3a389f83636
2012-10-02 10:30:25 +00:00
Vassil Vassilev
9cc45252ae Use more meaningful names - irrelevant for the users, priceless for developers.
git-svn-id: http://root.cern.ch/svn/root/trunk@46210 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-27 08:51:01 +00:00
Vassil Vassilev
d057925245 Improve documentation.
git-svn-id: http://root.cern.ch/svn/root/trunk@46198 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-26 13:27:48 +00:00
Axel Naumann
afd46ea54a Rename getMangledName() into mangleName().
git-svn-id: http://root.cern.ch/svn/root/trunk@46147 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-24 15:20:19 +00:00
Axel Naumann
621c0173c2 Cache MangleContext as a private member of the interpreter, so we don't have to re-create it all the time.
Implement JITed version of ExecutionContext::getAddressOfGlobal(), which now also needs a Module.


git-svn-id: http://root.cern.ch/svn/root/trunk@46139 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-24 12:11:46 +00:00
Axel Naumann
6323e0e50c Implement Interpreter::getAddressOfGlobal(const clang::NamedDecl*) (test comes "in a minute")
Factor out mangling into Interpreter::getMangledName().
Spelling.


git-svn-id: http://root.cern.ch/svn/root/trunk@46136 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-24 09:57:43 +00:00
Vassil Vassilev
c38e4407ef Use better names for the internal functions so that they are more visible while
debugging.


git-svn-id: http://root.cern.ch/svn/root/trunk@46024 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 15:14:58 +00:00
Vassil Vassilev
3bcd83bf79 Cleanup redundant includes.
git-svn-id: http://root.cern.ch/svn/root/trunk@46023 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 15:08:22 +00:00
Vassil Vassilev
5bc1387d38 Remove old lookup functions from the Interpreter. Now we have dedicated object
for string-based lookup (LookupObject) and cling::utils::Lookup class for quick
simple lookups.

This checkin slows down the testsuite because there is no LookupHelper::findVarDecl
and we have to #include a lot of headers at runtime.


git-svn-id: http://root.cern.ch/svn/root/trunk@46022 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 15:05:53 +00:00
Vassil Vassilev
7c08e8c678 Get rid of interpreter pointer in one of the transformers.
git-svn-id: http://root.cern.ch/svn/root/trunk@46017 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 13:13:22 +00:00
Vassil Vassilev
f2d691971f Get rid of interpreter pointer in one of the transformers. More to follow.
git-svn-id: http://root.cern.ch/svn/root/trunk@46016 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-18 12:46:30 +00:00
Axel Naumann
268a844e25 Re-apply r45839; got lost during move of cling
git-svn-id: http://root.cern.ch/svn/root/trunk@45870 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 15:35:00 +00:00
Axel Naumann
286910cee0 Reapply Vassil's r45838 which got lost during the move of cint/cling to interpreter/
git-svn-id: http://root.cern.ch/svn/root/trunk@45868 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 15:27:17 +00:00
Axel Naumann
05ba8a3a07 Move cling from cint/ to interpreter/ (Will add a "we have moved" readme to cint/cling.)
git-svn-id: http://root.cern.ch/svn/root/trunk@45844 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 09:37:39 +00:00