256 Commits

Author SHA1 Message Date
Vassil Vassilev
9d87f9b56e Move dynamic library handling in separate class. 2013-09-24 12:07:05 +02:00
Vassil Vassilev
4f7a63f93d Lookup might trigger deserialization. 2013-09-20 10:12:57 +02:00
Vassil Vassilev
19181a1392 Move the ExecutionContext-specific parts from the Interpreter. 2013-09-20 10:12:57 +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
156e74b8dd Update references to the file. 2013-09-18 20:33:06 +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
408742eb71 80 Cols. 2013-09-13 15:18:56 +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
Vassil Vassilev
a204e40a01 Silence warnings for unused fields. 2013-09-10 17:04:55 +02:00
Vassil Vassilev
90a59ff3bc Comment out that unused variable until the new llvm import. 2013-09-10 17:04:55 +02:00
Vassil Vassilev
d057535f0a Add tmp prefix. 2013-09-10 11:43:57 +02:00
Vassil Vassilev
a779afdcc1 Don't use local type as template argument. 2013-09-07 12:26:52 +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
92ffc7afd7 Check if there were errors and only if there were not - run. 2013-09-01 16:52:53 +02:00
Vassil Vassilev
110fa5a460 Iterating over the AST might trigger deserialization. 2013-08-28 16:43:59 +02:00
Vassil Vassilev
f043c36192 Constify. 2013-08-28 16:43:59 +02:00
Vassil Vassilev
8c168320f0 Hide the callback adaptor classes in the implementation. 2013-08-22 13:50:56 +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
Philippe Canal
357182f857 To be consistent we need to mangle the destructor as the complete one.
This is what we already do with constructor and when we lookup and search
for destructor we want the actually destructor implementation not the
one which also does the delete.
2013-08-12 21:38:56 +02:00
Vassil Vassilev
aea73f5beb Simplify. 2013-08-07 17:58:56 +02:00
Vassil Vassilev
b202f00c12 We now keep track of the deserialized declarations in the transaction, because ROOT needs the callbacks to be fired on deserialized bunch of declarations.
Track down (almost) all places that might trigger deserialization of declarations
and wrap it with cling::PushTransactionRAII. I could solve it much more elegantly
by putting that RAII in the callback of the ExternalASTSource, but I wanted to be
verbose and denote all the places that trigger deserializations in ROOT. This
will help us in future optimize this code, because we want to deserialize as
rare as possible.

This should make roottest a bit happier.
2013-08-04 18:44:55 +02:00
Vassil Vassilev
3556a6cc13 Indents. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
2bab03fa58 Use the transaction pool to reduce the number of transaction allocations. Add extra assertions. Simplify *a lot* the implementation. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
f9fc521b89 Use the function that exists in the Interpreter class itself. 2013-08-02 17:34:56 +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
32f1010977 Make if-checks asserts, because those cases are not expected anymore. 2013-08-02 17:34:54 +02:00
Vassil Vassilev
059b031f4d Simplify the code and enforce stricter rules. 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
0c74a310d8 Rebase to master/HEAD; split commitTransaction(); select needed parts in emitAllDecls(). 2013-06-28 00:33:17 +02:00
Axel Naumann
07ee17e09b Use new interface 2013-06-28 00:33:17 +02:00
Axel Naumann
a2bb0b2b46 codegen() really does emitAllDecls(); use new IncrementalParser interfaces. 2013-06-28 00:33:17 +02:00
Vassil Vassilev
0ff9231adc Don't set the module in Interpreter::codegen. This is leftover from the cherrypick. 2013-06-25 09:30:35 +02:00
Vassil Vassilev
0fbca300d4 When codegenning a transaction we must set the active module in codegen to the given one.
Add an assertion checking if there is codegen.
2013-06-25 09:30:32 +02:00
Vassil Vassilev
52c25a3f40 Construct execution context only if there is codegen enabled. 2013-06-25 09:30:32 +02:00
Axel Naumann
502afb5e91 Move codegen forcing to IncrementalParser, skip transformers and callbacks. 2013-06-21 09:27:56 +02:00
Vassil Vassilev
87a4b6bd63 From Baozeng: Add .printIR meta command, printing the llvm::Module. 2013-06-17 21:00:58 +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
312a24266e Ignore some diagnostics, even when we declare. 2013-05-24 10:41:03 +02:00
Vassil Vassilev
7476ebe7df They say merging was easy, then I am stupid. 2013-05-24 10:37:34 +02:00
Vassil Vassilev
052976bf88 endTransaction should take a transaction to be ended.
Parsing code in ROOT can lead to lookups which open a nested transactions. Ending
the current transaction in these cases is misleading because usually the
transaction that is expected to be ended is different.

Add an argument to endTransaction to disambiguate. Please note that this fixes
the regular cases of ROOT autoloading.

One of the remaining issues is autoloading of classes, which are passed in as
template arguments. The second remaining is autoloading of classes residing in
unnamed namespaces. Eg. MyNamespace::MyClass, where the diagnostic is issued upon
seeing that MyNamespace is unknown.
2013-04-27 01:52:55 +02:00
Axel Naumann
14c6595959 Update cling's patches to be relative to its LastKnownGood.
Simplify some of the patches by reverting some of the changed llvm / clang files to the original ones.


git-svn-id: http://root.cern.ch/svn/root/trunk@49363 27541ba8-7e3a-0410-8455-c3a389f83636
2013-04-26 11:45:17 +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