Commit Graph

888 Commits

Author SHA1 Message Date
Philippe Canal
7b7e237d81 adapt to new interface 2013-09-03 15:26:56 +02:00
Philippe Canal
5572e076ac Do not desugar typedef pointing to compiler 'details'.
Rather than skipping the desugaring of typedef pointing to anything in std, we
skip the desugaring of typedef pointing to a type starting with an underscore.
2013-09-03 13:18:55 +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
Philippe Canal
3777a7194e Try without 'blocking' desugaring of typedef to std entities 2013-09-03 13:18:55 +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
Philippe Canal
f13c81470a We must have a function implementation to take its address 2013-08-31 20:49:07 +02:00
Philippe Canal
fc90db23ba In ReturnSynthesizer add better support for RecordType.
When we dectect that the last expression is a record type and is not
a temporary, we now return it by reference, hence avoiding an unnecessary
and sometimes impossible (cout) copy.   If it is a temporary we still
return a 'copy'.
2013-08-31 20:49:07 +02:00
Paul Russo
d96e4132f7 Support function to function pointer decay in return value. 2013-08-31 00:42:52 +02:00
Axel Naumann
1a69f792c4 Add newline; (some?) fwd decls do not have one. 2013-08-30 18:08:55 +02:00
Vassil Vassilev
431a716ac3 Remove unused variable. 2013-08-29 11:50:53 +02:00
Philippe Canal
52da28145b Fix ROOT-5442, wrong normalization of std::vector<myNamespace::myClass1*>::const_iterator
GetPartiallyDesugaredType was 'forgetting' to add full qualification of the
template parameters in some case (where the template paramter in the
QualType was not yet an elaborated type).  Extend the internal interface to
distinguish when we need to add full qualification to the type itself or its
template parameters.
2013-08-29 08:59:59 +02:00
Philippe Canal
f127f8797f Add missing operators in ParseWithShortcuts. 2013-08-28 17:48:53 +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
59ced3f193 Move codegenning of deserialized declarations in the IncrementalParser.
We had two different codepath for codegeneration. The first one was for
declarations that came from text and the second one for declarations that came
from 'ExternalSource' such as PCH. In the latter case we had to do some
extra equilibristics to emulate a PCM and ignore generating code for decls with
static storage, because it will clash with the loading of the library that already
contains them.

The advantage of the new implementation is that instead of communicating the
deserialized decls to ROOT via some fishy deserialization listeners we can use
the cling::Transaction as we use it for decls that came from code.
2013-08-28 16:44:01 +02:00
Vassil Vassilev
2e97001848 Print the decls coming from deserialization, too. 2013-08-28 16:44:01 +02:00
Vassil Vassilev
53d4cbc184 There is no need of checking the size of the transaction. 2013-08-28 16:44:00 +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
476e36c348 Add another sanity check. It will cry whenever we extend the enum. 2013-08-28 16:44:00 +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
0ed039355a The ASTContext is a ref. 2013-08-28 16:43:58 +02:00
Vassil Vassilev
c3f2c31583 Use the ASTContext stored in the Transaction. 2013-08-28 16:43:58 +02:00
Vassil Vassilev
94853302a7 Forward to the const getter. 2013-08-28 16:43:58 +02:00
Axel Naumann
c822c7c81d UserInterface must be compiled with -fexceptions. 2013-08-28 09:39:53 +02:00
Paul Russo
63cb406f2f Add support for TClingCallFunc function wrappers to transactions. 2013-08-28 03:46:06 +02:00
Paul Russo
7fa8507477 Support returning values of arbitrary class type.
This restriction prevents us from evaluating function argument
expressions of class type (by value), and prevents us from
returning values with a class type (by value), if that class
has a non-trivial constructor or copy constructor.

For now we will allow the StoredValue to do a bit copy, with
the expectation that in the future StoredValue will hold
values of class type by pointer or reference instead of making
a copy.
2013-08-28 03:46:06 +02:00
Paul Russo
b4e6d23d4c Add support for member data pointer type.
Given:

class A {
private:
   int fInt;
};

We need to support storing the return value of
a function like this:

int A::*
f()
{
   return &A::fInt;
}
2013-08-28 03:46:06 +02:00
Vassil Vassilev
7179804c46 Move the handling of unhandled exceptions in the loop.
Indeed if the UserInterface.cpp is compiled without -fno-exceptions I get:
****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ throw 12;
Exception occurred. Recovering...
[cling]$ .q

So the issue is still in the build system, because I built UserInterface.cpp 'by hand'.
2013-08-27 23:46:41 +02:00
Vassil Vassilev
dc47e5f3b5 The standard said use catch(...) and not catch() 2013-08-27 23:42:03 +02:00
Vassil Vassilev
77b0bb0a30 Try to handle exceptions coming from the JIT.
The idea is whenever there is an exception cling to be able to recover from it
and continue working. For example:
[cling] throw 12;
shouldn't crash the current session in the interpreter. Now that we have compiled
the UserInterface with exceptions on, I hoped to be able to catch exceptions
coming from the JIT easily, but obviously I am still missing something.
2013-08-27 23:05:53 +02:00
Baozeng Ding
69c20e16b9 Make shouldProceed C++ function. 2013-08-27 22:18:54 +02:00
Axel Naumann
1430c5ee35 Remove debug output 2013-08-26 18:17:55 +02:00
Axel Naumann
107c073d58 Allow the UserInterface to use exceptions. 2013-08-26 17:26:53 +02:00
Axel Naumann
be70c52ce7 This patch affects files in llvm, not clang. 2013-08-26 12:07:52 +02:00
Axel Naumann
1e2f3a7a23 Adjust patch paths. 2013-08-26 12:07:52 +02:00
Philippe Canal
0fb9bb08f7 Removed unused variable 2013-08-26 00:50:52 +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
Philippe Canal
7312683eda Allocate Expr on a custom address to be able to release memory.
We now use operator new with placement to memory explicit
allocated in the routine (rather than the ASTContext) so
that we can release this memory at the end of the function.
The memory is allocated via a vector of object large enough
to hold the OpaqueExprRef.
2013-08-26 00:10:54 +02:00
Philippe Canal
dfc4b7b1c1 Remove unused variable 2013-08-26 00:10:54 +02:00
Bertrand Bellenot
3575eb44f1 Check if fileName *starts* with /usr/ 2013-08-24 16:00:56 +02:00
Vassil Vassilev
c6e144f046 Fix param name. 2013-08-23 21:44:53 +02:00
Baozeng Ding
3f256225e9 Iterate over the redecl chain to find the non null attribute. 2013-08-23 21:44:53 +02:00
Bertrand Bellenot
9daf1d7571 List loaded header and source files with the .files command
List the loaded source files when typing .files on the command line, including the system headers, but whithout the ones in /usr/..../bit/
2013-08-23 16:49:54 +02:00
Vassil Vassilev
277988492f Commit forgotten file. Documentation improvements. 2013-08-22 16:02:53 +02:00
Vassil Vassilev
aa5240d5b9 Fix init order warning. 2013-08-22 15:43:55 +02:00
Vassil Vassilev
67b9ac4784 Use better method name. Improve documentation. 2013-08-22 15:43:55 +02:00
Vassil Vassilev
36b6e36b1a Move the PPCallbacks in InterpreterCallbacks too. 2013-08-22 13:50:57 +02:00