Commit Graph

530 Commits

Author SHA1 Message Date
Axel Naumann
93970e8c35 Replace StoredValueRef by Value. 2014-04-01 18:31:58 +02:00
Axel Naumann
de2b4ed039 A "usually" allocation-free cling::Value (ROOT-6075). 2014-04-01 18:31:57 +02:00
Vassil Vassilev
234bfb7770 Simplify some of the changes due to the new diag mapping. 2014-04-01 17:09:58 +02:00
Vassil Vassilev
33676c14a9 Implement dump of MacroDirectiveInfo. 2014-03-31 14:03:08 +02:00
Vassil Vassilev
1f25fe3a00 CXX consistency. 2014-03-31 14:03:03 +02:00
Vassil Vassilev
0250ffe457 Fwd declare the clang::DiagnosticsEngine. 2014-03-31 14:03:01 +02:00
Vassil Vassilev
5e3a83bd3b Set the ignored diags before the driver does parse from args.
This allows the driver to override our custom diagnostics if the user wants any
special treatment.
2014-03-31 14:03:01 +02:00
Axel Naumann
e85e30e290 Fix MacOS missing symbol __ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi.
This is triggered by emitting operator<< 'class std::__1::basic_ostream<char,
struct std::__1::char_traits<char> > &(int)' even though its marked as exported
in general. Now that clang and libc++ agree on the handling of exported
templates we can remove our work-around.
2014-03-28 15:51:03 +01:00
Vassil Vassilev
f0fe89669c Fix doxygen typos. Thank you clang. 2014-03-27 11:18:57 +01:00
Axel Naumann
297d6a0019 First step away from SVN versioning. 2014-03-04 19:55:00 +01:00
Axel Naumann
57a84ab394 Move some code around to chop Interpreter() into smaller pieces. 2014-03-04 19:55:00 +01:00
Axel Naumann
baca204185 Simplify cxa_atexit(), first part.
Remove trigger__cxa_atexit(), we will just remap until successful.
Remove unused dso parameter.
Instead of friending just provide a function.
Pass a transaction, the typesafe way.
2014-03-04 19:54:59 +01:00
Axel Naumann
1e86611693 Remove unused function. 2014-03-04 19:54:59 +01:00
Axel Naumann
6b647a89cd Force symbol for ~__trigger__cxa_atexit (ROOT-6074); avoid reserved name. 2014-03-03 18:45:21 +01:00
Vassil Vassilev
c7e7156ce1 Remove Interpreter::getModule. 2014-03-03 15:27:05 +01:00
Vassil Vassilev
8d457e947f StringRef-y. 2014-03-03 15:27:05 +01:00
Vassil Vassilev
15918cd889 Remove unused interface. 2014-03-03 15:27:05 +01:00
Vassil Vassilev
e4383ecf7d Remove unused interface. 2014-03-03 15:27:05 +01:00
Vassil Vassilev
1851604b8c Rename printAST to printDebug. 2014-03-03 15:27:05 +01:00
Vassil Vassilev
c745dcc29c Remove useless flag. 2014-03-03 15:27:04 +01:00
Vassil Vassilev
f29b09e054 Remove .printIR and replace it with smarter debug class reusing the latest state tracker. 2014-03-03 15:27:04 +01:00
Vassil Vassilev
71b05e8321 Use the new CodeGen debug printouts in .storeState 2014-02-27 15:57:11 +01:00
Vassil Vassilev
eea3bf1f3d This should be reimplemented. So far it is a nop. 2014-02-27 12:49:10 +01:00
Axel Naumann
9b678f2829 Allow updating of the MetaProcessor's output stream, to redirect a meta command. 2014-02-25 14:18:01 +01:00
Axel Naumann
c88d5a4f19 More doxygen. 2014-02-21 12:11:56 +01:00
Vassil Vassilev
c92a68efc4 Implement cling::Transaction unique id. 2014-02-20 15:16:59 +01:00
Vassil Vassilev
340461a57a Trailing blanks 2014-02-20 15:16:59 +01:00
Axel Naumann
efb09a4d77 Fix doxygen. 2014-02-20 15:16:58 +01:00
Vassil Vassilev
398e97eb40 If the value is not set (due to errors in the runtime evaluation), return default. 2014-02-20 14:43:05 +01:00
Vassil Vassilev
c992cf3047 Implement reloading on .L
We keep the FileEntry -> Transaction mapping so that next time there is .L
we can figure out that it was already loaded and unload it and reload it again.
2014-02-20 10:36:10 +01:00
Axel Naumann
b27e430c89 Implement setValueNoAlloc() for long double. 2014-02-19 14:55:00 +01:00
Vassil Vassilev
2309fc097e Rename ExecutionContext -> IncrementalExecutor 2014-02-19 12:55:00 +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
Axel Naumann
789648df2d Add switch for lookup diags; enable it for gDebug>5 (ROOT-6070, ROOT-6044).
Use enum to avoid ambiguities between consecutive bollean args.
Use less default args to avoid Type* -> bool conversion.
2014-02-19 08:39:58 +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
Vassil Vassilev
ac4c77fe0a Add const to the void* so that the const overloads falls into this case too. 2014-02-18 17:22:58 +01:00
Vassil Vassilev
ad7054000c Improve implementation, shorter argument names, less overloads. 2014-02-18 17:22:58 +01:00
Axel Naumann
81c8c454b6 Keep constness of &; no need for const T* (folds into T*). 2014-02-18 17:22:58 +01:00
CristinaCristescu
9eb0ffbfcd Lay the foundations of return value alloc/noalloc. The JIT's runFunction is unreliable on 32 bit. Thus we provide a similar functionality in cling to deal with the cases where runFunction cannot.
The underlying issue is that the caller need to provide argument setup
and cleanup, which for 32bit is different than in 64, for example.
The approach we propose should be independent on the concrete platform
implementation, because we pass in the storage and depending on the
return result, we let cling runtime to deside whether and how to alloc
storage.
2014-02-18 17:22:58 +01:00
Vassil Vassilev
bf57dc0424 Move isOnScopeChains to a common ground. Erase the decl from the resolver chain only if it existed there. 2014-02-12 15:30:59 +01:00
Vassil Vassilev
698c8f16fc Fix windows warnings. 2014-02-06 14:51:00 +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
938326566e Blanks. 2014-02-06 14:50:57 +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
e5a0df500e Add support for C tentative definitions. 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
c20eb269ad Add ref-getters for GenericValue; do not copy it unnecessarily. 2014-02-04 16:16:55 +01:00
Philippe Canal
6a957ea310 Fix typo in doxygen doc 2014-02-03 16:08:56 +01:00
Philippe Canal
c6501ffe97 Introduce Transform::Config::DropDefaultArg
Currently only implemented for the STL collection.

This could eventually be used to allow customization
of which default argument to strip and which class template.

For now, it is only used to prevent the addition of template
default template argument to the STL collection ... which
we would any strip.

This fixes the secondary issue in ROOT-6020 (one class template
instance having more than one corresponding TClass due to the
inconsistency in the normalization (not adding vs not stripping)
2014-02-01 03:18:02 +01:00
Philippe Canal
1004034c75 Move IsStdClass to cling::utils::Analyze 2014-02-01 03:18:02 +01:00
Bertrand Bellenot
8ca703c272 Implement Interpreter's InclusionDirective() callback
InclusionDirective() callback tells us that an inclusion directive has been processed, allowing us to try to autoload classes using their header file name.
For example try to autoload TGClient (libGui) when seeing #include "TGClient.h"
This should prevent potential crash when executing macros using globals (e.g. gClient), with the following error:
ExecutionContext: use of undefined symbol 'gClient'!
2014-01-28 15:07:56 +01:00
CristinaCristescu
6414870d7a Correct doxygen doc. 2014-01-28 14:52:53 +01:00
CristinaCristescu
383911dc6a Tab completion, stacked redirection, unredirect to pipe, platform independence.
Tab completion works using the changed (but ROOT 5 compatible) syntax .> A.txt.
.> now uses dup2() that exists on Windows, too, instead of ttyname().
Tnis enables unredirection even during root > out.txt - which did not work in ROOT5.
Multiple ".> X.txt" can be stacked; ".>" unredirects back to the previous one on the stack.
2014-01-24 16:36:59 +01:00
Axel Naumann
b81a44d7e9 Rename ParseCFunction->DeclareCFunction. 2014-01-23 10:29:55 +01:00
Axel Naumann
601a53884c Define _LIBCPP_EXTERN_TEMPLATE even if it was undef before. 2014-01-17 09:45:15 +01:00
Axel Naumann
3a80d08010 __float128 decl not needed anymore since clang r184476. 2014-01-17 09:45:14 +01:00
CristinaCristescu
1465ec4d8a Warning and error fix.
(cherry picked from commit 9eb5a29d7c6d6430fb70a76f19b9a0e6d259da62)
2014-01-15 17:10:54 +01:00
Axel Naumann
618d574582 Missing change for be0b571. 2014-01-15 15:52:58 +01:00
Axel Naumann
0e51c64077 Follow current clang/llvm Option syntax (late fix from llvm/clang upgrade). 2014-01-15 15:52:58 +01:00
Axel Naumann
9b27f187aa Need virtual d’tors (XCode warning) 2014-01-15 15:52:57 +01:00
Axel Naumann
f9b047d85f Use the portable FILE. 2014-01-15 14:14:55 +01:00
CristinaCristescu
b3ba3f5804 Redirect changes touse SmallString. 2014-01-15 12:02:04 +01:00
CristinaCristescu
c9ec997188 Redirection special 2>&1 case. 2014-01-15 12:02:04 +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
5da6e646a5 Correct licenses in Makefiles. 2014-01-07 11:13:56 +01:00
Axel Naumann
c73e6eb493 Re-implement (explicitly) handling of typedefs as nested name specs: TD::A.
This got lost in 2b6ae0aed / 96a4437c8 where typedefs were handled.
Simplify logic (and thus shorten code).
Fixes error in roottest/root/tree/addresses:
Error in <TStreamerInfo::Build>: Embedded_objects, unknown type: EmbeddedTypedef::Embedded3 m_emb4
2014-01-06 18:27:00 +01:00
Philippe Canal
6850b1db86 Add IsStdOrCompilerDetails 2013-12-17 15:58:55 +01:00
Philippe Canal
3216896e6e Declare local function static (For consistency) 2013-12-17 15:58:54 +01:00
Philippe Canal
a3499ac49a Declare namespace-like classes to be namespace 2013-12-17 15:58:54 +01:00
Bertrand Bellenot
e443f83a0b Fix a compilation error C2872: 'Value' : ambiguous symbol on Windows 2013-12-11 14:29:50 +01:00
Axel Naumann
c1c49658e2 Adjust sizeof(m_Buf) now that we have a new member. Re-order to avoid padding.
(cherry picked from commit d5508a3c3b963928270933f307dab97a2d1630bf)
2013-12-10 10:34:11 +01:00
Axel Naumann
7dffdfc1bd Destruct the Value. Needs Interpreter and thus interface adjustments.
(cherry picked from commit da54d73c5cb6dedc9159f52467f016493ec25338)
2013-12-10 10:34:10 +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
Vassil Vassilev
50a1acade4 Make members local, so that they will close and flush earlier. 2013-12-06 12:03:34 +01:00
Vassil Vassilev
51d27bf1e5 Improve uncaching of unloaded files.
*Merge PreVisitDecl and PreVisitMacro and rename to CollectFilesToUncache.
*Add FID to the transaction storing the memory buffer file ID caused the
transaction.
2013-12-06 12:03:33 +01:00
Vassil Vassilev
384196310c Improve style. 2013-12-06 12:03:32 +01:00
Axel Naumann
a1e922c839 Remove stray ; 2013-12-04 20:37:59 +01:00
Axel Naumann
0eb9ac042f Make full qualification an option.
Allows GetPartiallyDesugaredType() and GetFullyQualifiedName() to share functionality.
2013-12-04 19:09:59 +01:00
Axel Naumann
97987030f5 Move several TypeName functions from MetaUtils to cling/Utils.
They were once identical but then got bug fixed out of sync.
Moved routines:

GetFullyQualifiedLocalType()
GetFullyQualifiedType()
CreateNestedNameSpecifier()
CreateNestedNameSpecifierForScopeOf()
GetFullyQualifiedTypeNNS()
2013-12-04 19:09:59 +01:00
Axel Naumann
67f5e5bf64 Add option to disable rollback. Handle missing ExecEngine. 2013-12-02 13:53:30 +01:00
Fons Rademakers
523b65eb7b Make sure _LIBCPP_EXTERN_TEMPLATE is not defined (used by libc++).
The default definition of this macro causes extern template
symbols to be undefined when running with cling. It has been fixed in
the meanwhile in the libc++ sources but the libc++ that ships with OSX 10.9
still has this macro defined. For the discussion on this see:
http://clang-developers.42468.n3.nabble.com/LIBCPP-INLINE-VISIBILITY-and-std-string-length-td4030879.html
and
http://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg79202.html
2013-11-27 12:49:00 +01:00
CristinaCristescu
49a39b3deb Fix warnings from Macros. 2013-11-26 15:18:57 +01:00
Vassil Vassilev
d74740df1d Size doesn't make sense for a transaction. Iteration doesn't cause side effects anymore. 2013-11-25 17:32:56 +01:00
Vassil Vassilev
a0912520ee Reduce the hacky-ness of the state collector setup.
The second compilerInstance doesn't need to collect anything, thus we don't
need to attach it to the PP.
2013-11-25 13:56:02 +01:00
CristinaCristescu
1d06b2725b Workaround multiple DeclCollector instances. 2013-11-25 13:56:02 +01:00
CristinaCristescu
d6e2f85d1c Fix and improve macro error recovery. 2013-11-25 13:56:02 +01:00
CristinaCristescu
5d42bd5e8c Improvements on Macro removal. 2013-11-25 13:56:02 +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
c423ae3bc8 Add LookupHelper::findDataMember to retrive a field or variable. 2013-11-19 04:37:11 +01:00
Vassil Vassilev
dfcb11ad0b Document a parameter. 2013-11-15 16:10:02 +01:00
Vassil Vassilev
d70c1702dc Ignore the noise coming from the lazily-created builtins. 2013-11-14 15:24:03 +01:00
Philippe Canal
388271f9e9 Add cling::LookupHelper::findFunctionTemplate
Given a context and a name (and a constness), return the corresponding
function template decl.
2013-11-13 19:46:00 +01:00
Bertrand Bellenot
d9f80eb51b Use canonicalized absolute pathname
This should fix Jira #ROOT-5636 Be more precise on whether a shared library was loaded
2013-11-11 12:19:59 +01:00
Philippe Canal
6f87119b4b Add LookupHelper::findAnyFunction 2013-11-02 13:55:02 +01:00
Axel Naumann
ceaa2ce579 Add documentation. 2013-10-31 12:59:55 +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
69eb1a59a6 Enforce integrity of getGlobalAddress, too. 2013-10-29 20:19:19 +01:00
Vassil Vassilev
a97a2811c9 maybeMangleDeclName should take GlobalDecl. This enforces integrity. 2013-10-29 20:19:17 +01:00
Vassil Vassilev
bd34a1ca16 Erase takes iterator and sets the wrapper fd to 0 if the wrapper is being erased. 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
Axel Naumann
11f9065caa Misseplled oxygen tag. 2013-10-28 10:57:00 +01:00
Vassil Vassilev
082f3feab4 Dump the llvm::Module too. 2013-10-14 09:11:40 +02:00
Axel Naumann
5706d4bdef Workaround broken JIT exceptions, use longjmp instead. 2013-10-03 09:54:00 +02:00
Axel Naumann
790c34b4f4 Change in option sort order in llvm head. 2013-09-26 17:54:19 +02:00
Vassil Vassilev
8ffa2e2d8b Fix the doxygen only. 2013-09-26 09:42:57 +02:00
Vassil Vassilev
9a2b9913ce Fix doxygen warnings 2013-09-26 09:27:58 +02:00
Philippe Canal
e9376dd7a6 Re-add missing (at least on C+11) header file.
cstdlib is required for std::getenv.
2013-09-25 01:44:55 +02:00
Vassil Vassilev
f1a128f825 Reduce the amount of #included files. 2013-09-24 12:07:07 +02:00
Vassil Vassilev
f7a0987ac9 Move dynamic library handling in separate class. 2013-09-24 12:07:06 +02:00
Vassil Vassilev
9d87f9b56e Move dynamic library handling in separate class. 2013-09-24 12:07:05 +02:00
Vassil Vassilev
0421df1d22 Cleanup the temporary files. 2013-09-24 12:07:04 +02:00
Vassil Vassilev
19181a1392 Move the ExecutionContext-specific parts from the Interpreter. 2013-09-20 10:12:57 +02:00
Philippe Canal
4f81441b51 Add missing #include <cstdlib> 2013-09-19 23:55:55 +02:00
Vassil Vassilev
b74f068aaf Temporary fix to the build. This will be factored out by our future DynamicLibraryManager. 2013-09-18 21:08:54 +02:00
Vassil Vassilev
26a3abe1db Reset the cache only if there is a fileentry associated with it.
This avoids removing the cache of the virual file, wrapping the memory buffers
in cling.
2013-09-18 20:33:07 +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
cc13c4c79c Publish the useful helper class. 2013-09-18 20:33:05 +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
16243be584 Add getter and silence a warning. 2013-09-13 15:18:57 +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
Axel Naumann
4222ba870d Add more rationale as to how this exception is different from others. 2013-09-11 09:14:56 +02:00
Vassil Vassilev
c35e529cd6 Remove unused code. 2013-09-10 15:41:01 +02:00
Vassil Vassilev
d2b1e288a4 Spaces. 2013-09-10 15:41:01 +02:00
Axel Naumann
8f435ec57a File renamed 2013-09-09 18:02:53 +02:00
Axel Naumann
0782d4d515 Make CompilationException public, (also) use new cling runtime exception as base. 2013-09-09 18:02:53 +02:00
Vassil Vassilev
bffd16ea1d RuntimeExceptions got renamed. 2013-09-09 15:24:51 +02:00
Vassil Vassilev
8e9970d472 Rename filename. We don't use plural in the names... 2013-09-09 15:04:51 +02:00
Baozeng Ding
04d71f9f82 Pass in the Expr* instead of the SourceLocation. 2013-09-09 14:45:51 +02:00
Vassil Vassilev
aa1cd1d208 Fix doxygen warning. 2013-09-09 13:14:55 +02:00
Vassil Vassilev
1a2a7862c5 Propagate the new callback to our InterpreterCallbacks interface. 2013-09-09 13:14:55 +02:00
Vassil Vassilev
89d47f66d1 Improve the look&feel of the exception classes. 2013-09-07 10:46:54 +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
34d2c33c18 Handle the default interpreter's runtime exception. 2013-09-06 23:47:55 +02:00
Vassil Vassilev
7c6324d79b Add base class for the interpreter's runtime exceptions. 2013-09-06 23:47:55 +02:00
Vassil Vassilev
683a11e9e9 Use default cling style for naming classes. 2013-09-06 23:47:55 +02:00
Vassil Vassilev
eff9830b09 Add missing header method declarations. 2013-09-06 23:47:54 +02:00
Vassil Vassilev
7e7951185b Add special exception type for the null deref exceptions. 2013-09-05 19:08:55 +02:00
Philippe Canal
44891a9b46 Update doxygen doc 2013-09-05 13:52:52 +02:00
Axel Naumann
5e68396609 Fix constness. 2013-09-04 15:51:54 +02:00
Axel Naumann
88077c7e68 Add getter for dylib handle (against unused warning); remove unused kBitcode 2013-09-04 15:51:53 +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
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
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
f043c36192 Constify. 2013-08-28 16:43:59 +02:00
Vassil Vassilev
94853302a7 Forward to the const getter. 2013-08-28 16:43:58 +02:00
Paul Russo
63cb406f2f Add support for TClingCallFunc function wrappers to transactions. 2013-08-28 03:46:06 +02:00
Baozeng Ding
69c20e16b9 Make shouldProceed C++ function. 2013-08-27 22:18:54 +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
Vassil Vassilev
c6e144f046 Fix param name. 2013-08-23 21:44:53 +02:00
Vassil Vassilev
36b6e36b1a Move the PPCallbacks in InterpreterCallbacks too. 2013-08-22 13:50:57 +02:00
Vassil Vassilev
2445d8b5fe Fix typo. 2013-08-22 13:50:57 +02:00
Vassil Vassilev
8c168320f0 Hide the callback adaptor classes in the implementation. 2013-08-22 13:50:56 +02:00
Vassil Vassilev
c8f4ac8beb Remove private ctor. 2013-08-22 13:50:54 +02:00
Vassil Vassilev
1c04a16ae6 Hide InterpreterExternalSemaSource class as an implementation detail. 2013-08-22 13:50:54 +02:00
Vassil Vassilev
6527a15123 We don't need the the members and the accessors. 2013-08-21 14:29:58 +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
Axel Naumann
327dbb72cc Fix doxygen param doc 2013-08-17 12:21:53 +02:00
Philippe Canal
39d8a3e8a6 Add matchFunctionProto returning the decl only in case of exact match.
The new call is:

const clang::FunctionDecl* matchFunctionProto(const clang::Decl* scopeDecl,
                                              llvm::StringRef funcName,
                                              llvm::StringRef funcProto,
                                              bool objectIsConst
                                              ) const;

and the function must match in name and prototype (including constness).
The only thing not checked is the actual declaration context.
2013-08-17 01:45:56 +02:00
Philippe Canal
31b60e0ab5 Add support for restricting the function search to const functions.
Add an optional argument objectIsConst to findFunctionArgs and
findFunctionProto:

   const clang::FunctionDecl* findFunctionProto(const clang::Decl* scopeDecl,
                                                llvm::StringRef funcName,
                                                llvm::StringRef funcProto,
                                                bool objectIsConst) const;

   const clang::FunctionDecl* findFunctionArgs(const clang::Decl* scopeDecl,
                                               llvm::StringRef funcName,
                                               llvm::StringRef funcArgs,
                                               bool objectIsConst) const;
2013-08-17 01:45:55 +02:00
Vassil Vassilev
31da52cca3 Add iterators over the deserialized declarations. 2013-08-07 14:58:00 +02:00
Vassil Vassilev
3643b28116 Change the state when the transaction gets returned in the pool. Simplifies debugging. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
67a8bbfd1f Make setNext public and thus the IncrementalParser will be no more friend of the transaction. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
01314c9d78 Transaction takes and stores the ASTContext, otherwise it is too much of an effort to get it from the DeclQueue, which might contain null DGRs. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
dfe1c172b6 Style. 2013-08-04 18:44:55 +02:00
Vassil Vassilev
a8c9e880e9 Transactions that triggered deserialization shouldn't be considered as empty, because logically they are not and because ROOT needs the callbacks to be fired. 2013-08-02 17:34:57 +02:00
Vassil Vassilev
a6fbc75dfa Move the TransactionPool in its own file. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
4230a3cc6c Remove redundant transaction state. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
cb27a8c694 Since we have the transaction pool we can afford to construct the decl collection non-lazy. This is because we know that this will be reused. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
c21695c982 Implement a transaction pool. This will help reusing empty transactions and reduce the number of alocations. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
c03e35696e Add more brief transaction structure printout for debugging purposes. 2013-08-02 17:34:56 +02:00
Vassil Vassilev
d25550e955 Sync names. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
abeaf4b6d7 Fix an issue with deleting the nested transaction marker. Improve style. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
8de890ee52 Add default constructor and move the initialization in a separate routine. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
63f1ce5082 Outline method. 2013-08-02 17:34:55 +02:00
Vassil Vassilev
f841f0bc8d Add extra assert enforcing integrity. 2013-08-02 17:34:55 +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
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
a2bb0b2b46 codegen() really does emitAllDecls(); use new IncrementalParser interfaces. 2013-06-28 00:33:17 +02:00
Vassil Vassilev
777a44ad37 Define operator== and operator!= for DelayCallInfo. 2013-06-25 09:30:35 +02:00
Vassil Vassilev
ef0c731ecb Add method removing nested transactions. Move reset implementation in the cpp file. 2013-06-25 09:30:34 +02:00
Vassil Vassilev
93d0d81de2 The null DGR is a marker for nested transactions. Instead using isNull DGR protected interface append, push back the marker in the decls queue. 2013-06-25 09:30:34 +02:00