166 Commits

Author SHA1 Message Date
Vassil Vassilev
308de089be Compare the reverse so that the newer changes appear with + in the diff. 2013-10-14 09:11:40 +02:00
Vassil Vassilev
98c6a9d5bc The compare/store state can trigger deserialization. 2013-10-14 09:11:40 +02:00
Vassil Vassilev
f4fc65893c Send shutdown signal only when the ExecutionContext exists.
ExecutionContext doesn't exist in '-fsyntax-only' mode.
2013-10-14 09:11:40 +02:00
Vassil Vassilev
409324ef76 Implement shutdown action for the ExecutionContext.
When we tear down, the ExecutionContext must destroy all 'managed' addresses.
For example the LifetimeHandlers that came from the DynamicLookup. This needs
the interpreter to be in a 'sane' state, because they might call back the
Interpreter. For example gCling->execute("delete ...");
2013-10-14 09:11:39 +02:00
Axel Naumann
5706d4bdef Workaround broken JIT exceptions, use longjmp instead. 2013-10-03 09:54:00 +02:00
Axel Naumann
b62b5d7937 Combine include path -D; pass src and obj for LLVMDEV/ROOT; remove unused -Ds 2013-09-30 18:09:03 +02:00
Axel Naumann
68c8bb74e8 By Vassil: update to current llvm. 2013-09-26 17:54:19 +02:00
Axel Naumann
954b089b2f More Path fixes, remove dupe headers. 2013-09-26 17:54:19 +02:00
Axel Naumann
f4f518ba9c Remove more Paths. 2013-09-26 17:54:18 +02:00
Vassil Vassilev
f1a128f825 Reduce the amount of #included files. 2013-09-24 12:07:07 +02:00
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