213 Commits

Author SHA1 Message Date
Vassil Vassilev
2309fc097e Rename ExecutionContext -> IncrementalExecutor 2014-02-19 12:55:00 +01:00
Vassil Vassilev
59c0989087 Remove leftovers from merge 2014-02-19 12:55:00 +01:00
Vassil Vassilev
72a089652f Remove llvm::Type from the cling::Value 2014-02-19 12:54:59 +01:00
Axel Naumann
8b151c893e Remove now unused Interpreter::getLLVMType(). 2014-02-19 10:53:58 +01:00
Axel Naumann
71cadd6ad2 Remove remaining traces of llvm::Type from cling::Value. 2014-02-19 10:53:58 +01:00
Vassil Vassilev
ca4fd9eb3a Improve encapsulation. Move ValueExtractionSynthesizer specifics to its implementation. Get rid of references to the interpreter class in the ExecutionContext. 2014-02-19 10:43:00 +01:00
Vassil Vassilev
1f85d7b725 Handle returns, temporary results, independent on JIT's runFunction.
Here we don't want to depend on the JIT runFunction, because of its limitations,
when it comes to return value handling. There it is not clear who provides the
storage and who cleans it up in a  platform independent way.

Depending on the type we need to synthesize a call to cling:
  0) void : do nothing;
  1) enum, integral, float, double, referece, pointer types :
       call to cling::internal::setValueNoAlloc(...);
  2) object type (alloc on the stack) :
       cling::internal::setValueWithAlloc
     2.1) constant arrays:
         call to cling::runtime::internal::copyArray(...)

We need to synthesize later (see RuntimeUniverse.h)
 Wrapper has signature: void w(cling::StoredValueRef SVR)
case 1):
  setValueNoAlloc(gCling, &SVR, lastExprTy, lastExpr())
case 2):
  new (setValueWithAlloc(gCling, &SVR, lastExprTy)) (lastExpr)
  case 2.1):
    copyArray(src, placement, N)
2014-02-18 17:22:58 +01:00
Axel Naumann
fae0d4037f Follow changes in llvm/clang. 2014-02-18 08:29:38 +01:00
Vassil Vassilev
7763150743 Keep the files diff files until the end of the session 2014-02-06 14:50:58 +01:00
Vassil Vassilev
13021e652b In rawInput mode we want to be as close as possible to the compiler. 2014-02-06 14:50:57 +01:00
Vassil Vassilev
0944f060ec In -fsyntax-only mode we don't have llvm::Module. 2014-02-06 14:50:56 +01:00
Axel Naumann
b81a44d7e9 Rename ParseCFunction->DeclareCFunction. 2014-01-23 10:29:55 +01:00
Axel Naumann
403816c646 No need to 0-terminate, SmallString handles that itself.
Fixes relocatability of standalone cling builds.
2014-01-17 14:05:54 +01:00
Axel Naumann
f6ac9d494b Enable relocatable binaries (ROOT-5939).
Even if CLING_INCLUDE_PATHS is set, cling might end up elsewhere.
So always look for the include/ that's next to bin/cling.
2014-01-16 17:03:50 +01:00
CristinaCristescu
b7cd4142b3 Updated wrong file version. 2014-01-15 12:02:03 +01:00
CristinaCristescu
6296b84ab3 Changes to redirection. 2014-01-15 12:02:03 +01:00
CristinaCristescu
0ec0ba48b6 Change redirection from Interpreter to MetaProcessor. 2014-01-15 12:02:03 +01:00
CristinaCristescu
d30b5a0a23 Change flag for redirection.
correct
2014-01-15 12:02:03 +01:00
CristinaCristescu
34dfd69b53 Redirect err. 2014-01-15 12:02:03 +01:00
CristinaCristescu
b4e3a9b6b5 Redirect 2014-01-15 12:02:02 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Axel Naumann
2cefd7e994 Adapt to StoredValueRef interface change.
(cherry picked from commit b5d991d9a06b604fc7a9edcf9bff96d2899b8655)
2013-12-10 10:34:10 +01:00
Axel Naumann
4dde17ab8e Functions are extern "C".
(cherry picked from commit c7caadda0902a0b5cf7194c584ffd3cc328827a1)
2013-12-06 15:36:00 +01:00
Axel Naumann
b4dea2cde6 Interpreter::compileFunction(): compile this function and give me its address.
(cherry picked from commit 04de3a90cddb2718dc263ee104854b5395bfd869)
2013-12-06 15:36:00 +01:00
Axel Naumann
67f5e5bf64 Add option to disable rollback. Handle missing ExecEngine. 2013-12-02 13:53:30 +01:00
CristinaCristescu
46f07198b0 Add comments and fix trailing spaces. 2013-11-25 13:56:01 +01:00
CristinaCristescu
85b4232729 Revert macro def for error recovery. 2013-11-25 13:56:01 +01:00
CristinaCristescu
0490caaa99 Macro recovery 2013-11-25 13:56:00 +01:00
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