235 Commits

Author SHA1 Message Date
Philippe Canal
0476b4d4dc Move '-Wno-ambiguous-member-template' from cling to CallFunc 2013-11-20 21:40:00 +01:00
Philippe Canal
ca1b4775d4 Disable Wambiguous-member-template.
In CallFunc we currently always (intentionally and somewhat necessarily)
always fully specify member function template, however this can lead to
an ambiguity with a class template.  For example in
roottest/cling/functionTemplate we get:

  input_line_171:3:15: warning: lookup of 'set' in member access expression is ambiguous; using member of 't'
        ((t*)obj)->set<int>(*(int*)args[0]);
                   ^
  /local2/pcanal/cint_working/rootcling/root/roottest/cling/functionTemplate/t.h:19:9: note: lookup in the object type 't' refers here
        void set(T targ) {
             ^
  /usr/lib/gcc/x86_64-redhat-linux/4.4.5/../../../../include/c++/4.4.5/bits/stl_set.h:87:11: note: lookup from the current scope refers here
         class set
               ^
  This is an intention warning implemented in clang, see
  http://llvm.org/viewvc/llvm-project?view=revision&revision=105518

This fixes a failure in pythoncintrun in roottest/cling/functionTemplate.
2013-11-20 15:07:57 +01:00
Vassil Vassilev
7a4fcf39ed Make sure we call the dtor for the state object. 2013-11-14 15:24:02 +01:00
Axel Naumann
bd3c03cc17 80cols. 2013-10-31 14:43:56 +01:00
Vassil Vassilev
e6b54ae93a Remap only if not in -fsyntax-only. 2013-10-31 14:43:56 +01:00
Vassil Vassilev
4294b35b0c Remap the cxa_at_exit earlier.
The problem was that the remapping happened on the first executeFunction, which
was fine. Now that we have the Transaction's empty wrapper functions removed it's
not enough.

NOTE: that any decls coming within the RuntimeUniverse.h which need 'managed'
storage will still trigger the same problem.
2013-10-31 14:43:56 +01:00
Vassil Vassilev
ceb7eaf1fc Remove useless code. 2013-10-31 14:43:56 +01:00
Axel Naumann
4ec5d9380f Report if an absolute filename cannot be found. 2013-10-31 11:30:54 +01:00
Vassil Vassilev
0f6901e8b8 The transaction may not contain a wrapper. This may be due to the fact that if the wrapper was empty it is removed. Of course this should be asserted properly in future. 2013-10-29 20:19:27 +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
dc410b73b8 Even in cases where the transaction was empty return success. 2013-10-29 20:19:20 +01:00
Vassil Vassilev
69eb1a59a6 Enforce integrity of getGlobalAddress, too. 2013-10-29 20:19:19 +01:00
Vassil Vassilev
5c3b327acc Compile might return empty transaction, i.e transaction with no decls.
Then we should cut off interpreting early.
2013-10-29 20:19:15 +01:00
Vassil Vassilev
f531e3d196 Add TODO. 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
Vassil Vassilev
f0152f8772 Remove code duplication. 2013-10-29 20:19:10 +01:00
Vassil Vassilev
2872bc06d4 From me and Cristina: Fix removal of out-of-line definitions.
If we had:
struct MyClass {
  void f() {}
}
MyClass::f(){} // expected error redefinition of f.

In that case we would have tried to remove the lookup entry for the decl from
the primary decl context of the lexical decl context, which entry doesn't exist.
It is registered in the semantic decl context of the decl itself.
2013-10-16 16:37:58 +02:00
Vassil Vassilev
082f3feab4 Dump the llvm::Module too. 2013-10-14 09:11:40 +02:00
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