Commit Graph

1547 Commits

Author SHA1 Message Date
Axel Naumann
af66248191 Accessor to current transaction, useful e.g. for callbacks. 2014-05-14 15:32:58 +02:00
Philippe Canal
f7aaac2c07 Avoid the risk of type creation if we can 2014-05-14 09:03:56 +02:00
Philippe Canal
d1e545b60d In Partial desugar add support for array type 2014-05-14 09:03:56 +02:00
Pere Mato
45635cf4a2 Pass the CLING_VERSION as compiler flag and remove it from cling_compiledata.h file 2014-05-13 16:47:56 +02:00
Vassil Vassilev
764f126c70 Simplify. 2014-05-09 15:28:06 +02:00
Vassil Vassilev
5bea5d34ec Add the notion of version in both build systems. Remove redundant code. 2014-05-09 14:52:57 +02:00
Axel Naumann
961cc8d7bf Add protection against missing CodeGen. 2014-05-06 12:18:00 +02:00
Lukas Vacek
ce008b07fc Fix input files processing (cling foo.c should work now) 2014-05-02 19:01:01 +02:00
Axel Naumann
b8c48f15f8 CLING_CXXABI* is unused for MSVC. 2014-04-30 15:27:01 +02:00
Bertrand Bellenot
a39879b286 Check in the system registry for the version of Visual Studio with which we compiled cling (instead of the highest version) 2014-04-30 15:27:01 +02:00
Bertrand Bellenot
a172bc0e07 Fix some of the error messages when starting cling.exe on Windows
Fixes the following error messages:
The system cannot find the path specified.
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
    echo | LC_ALL=C C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe  /DWIN32 /D_WINDOWS /W3    -xc++ -E -v - 2>&1 >/dev/null | awk '/^#include
 </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | grep -E "(c|g)\+\+"
results in
The system cannot find the path specified.
with exit code 255
Warning in cling::CIFactory::createCI():
  C++ ABI check not implemented for this standard library

Note there are still a few remaining errors at startup time:

error: cannot mangle RTTI descriptors for type 'exception' yet
error: cannot mangle the name of type 'exception' into RTTI descriptors yet

Apparently coming from the following statement (at line 284 in Interpreter.cpp, in Interpreter::IncludeCXXRuntime()):

    declare("#include \"cling/Interpreter/ValuePrinter.h\"");
2014-04-30 15:27:01 +02:00
Axel Naumann
5a63dff8e9 Survive lookup in a forward declared context. 2014-04-29 17:47:58 +02:00
Axel Naumann
8b60eaf361 Survive and signal non-unique lookup results. 2014-04-29 17:47:58 +02:00
Axel Naumann
04d0d17f3e Protect from missing CodeGen. 2014-04-29 17:47:57 +02:00
Philippe Canal
94219bdc83 Work-around transaction unload not informing MetaSema.
When a file is unloaded its entry should be removed from MetaSema::m_WaterMarks.
At the moment the corresponding callback is not implemented.

Instead, we also record the relation <Transaction*,Entry*>, so that upon
MetaSema requesting an unload, we can clean-out the corresponding data
from m_WaterMarks.

In addition, to catch the case where the target transaction (unloadPoint)
is not longer present we issue an error and do not unload anything.
2014-04-29 03:46:59 +02:00
Axel Naumann
ed65edecb3 Fix func/ptr cast warning; work around MSVC2012 lack of C++11. 2014-04-28 15:55:58 +02:00
Axel Naumann
05e3be6503 Fix non-GCC (and non-thread-safe!) case. 2014-04-28 15:13:57 +02:00
Axel Naumann
e85b873a26 Also replace boost::detail::atomic_exchange_and_add for the interpreter.
Generalize the __cxa_atexit replacement to cover more symbols.
Because the JIT cannot handle inline asm, provide compiled symbols for relevant
functions until cling has switched to MCJIT.
This fixes the use of many boost libraries (e.g. regex) in cling on x86_64/i386.
Kudos to Marco Clemencic for the idea!
2014-04-28 12:38:15 +02:00
CristinaCristescu
bd47ead006 Multiple line of leading comments. (ROOT-5930 and ROOT-4791). 2014-04-23 15:47:55 +02:00
CristinaCristescu
d0a4c2c819 Unanamed macros not detecting leading and trailing comments. (ROOT-5930 and ROOT-4791). 2014-04-23 15:47:55 +02:00
Axel Naumann
ae53222221 Fix warning. 2014-04-22 10:53:56 +02:00
Axel Naumann
f0f8fe0fae Disable inliner/CallGraph pass where not needed: it is slow. 2014-04-22 09:14:57 +02:00
Axel Naumann
d736e5d862 Skip trailing space, we never need it. Fixes cling tests. 2014-04-18 00:06:46 +02:00
Axel Naumann
fd7790dc53 Use actual class name to make it easier to find the source of errors. 2014-04-16 17:41:08 +02:00
Axel Naumann
a1bf77d47a If we cannot find the canonical file, try to load the original one. 2014-04-16 17:33:59 +02:00
Axel Naumann
e45cfd1afa Enable parsing of ".L ./dir with space/foo.C" 2014-04-16 17:33:59 +02:00
Axel Naumann
bc0c3877f7 Only run initializers (of all committed transactions!) if topmost. 2014-04-16 12:08:03 +02:00
Axel Naumann
5648b8fc7f No nested transactions for initializers! (Test coming up.) 2014-04-16 12:08:03 +02:00
Axel Naumann
40d2135253 Tell the new transaction what its parent is. 2014-04-16 12:08:02 +02:00
Axel Naumann
b935579c55 From Vassil: only commit what endTransaction() returns. 2014-04-16 12:08:01 +02:00
Axel Naumann
164686caf1 Fix assert. Thanks, Timur! 2014-04-16 09:13:07 +02:00
Axel Naumann
cc04f68f1d Assert consistency: if we get a canonical name it must exist. 2014-04-15 18:22:55 +02:00
Bertrand Bellenot
ecd7f64941 Add missing cast from DyLibHandle (const void *) to HMODULE
This should fix the following compilation error on Windows:
error C2664: 'FreeLibrary' : cannot convert parameter 1 from 'cling::DynamicLibraryManager::DyLibHandle' to 'HMODULE'
2014-04-15 17:50:57 +02:00
Vassil Vassilev
d5cfd91025 Disable assertion and add an FIXME explaining why. 2014-04-15 17:33:00 +02:00
Vassil Vassilev
818d9826cd Implement a debug mode for the transaction pool, which can be enabled in gdb. This happens by altering the m_Debug value. 2014-04-15 17:33:00 +02:00
Vassil Vassilev
047391706d Return don't break, because it causes #including of so files. 2014-04-15 17:32:59 +02:00
Axel Naumann
1f9a259c33 Propagate cache flags from LookupFile() to FileManager::getFile(). 2014-04-15 17:32:59 +02:00
Vassil Vassilev
40db9f5903 Unload decls came from parseForModule. 2014-04-14 22:48:56 +02:00
Vassil Vassilev
f75cef233f Implement callbacks for the DynamicLibraryManager. 2014-04-14 20:58:15 +02:00
Vassil Vassilev
e52457601c No need of flagging which is library and which not. The lib manager knows. 2014-04-14 20:58:14 +02:00
Vassil Vassilev
68a0a45eab Use normalized filenames. 2014-04-14 20:58:13 +02:00
Vassil Vassilev
3d0ba9aed3 Do not use translateFile, because it pulls in parts of the pch. 2014-04-14 20:58:13 +02:00
Axel Naumann
c46a539b2f Before deleting, make the parent forget. 2014-04-14 17:53:00 +02:00
Vassil Vassilev
362480a7c9 Revert unintentionally checked in code. 2014-04-14 13:57:57 +02:00
Vassil Vassilev
d4df15ee88 Fix windows. 2014-04-14 12:59:58 +02:00
Vassil Vassilev
f4d3356515 Use the canonical path. 2014-04-14 12:59:58 +02:00
Vassil Vassilev
9b353ee8a5 Normalize the file names. 2014-04-14 12:59:58 +02:00
Vassil Vassilev
bf1031a840 Fix error msg. 2014-04-14 12:59:57 +02:00
Vassil Vassilev
37e234c715 Name order. 2014-04-14 12:59:57 +02:00
Vassil Vassilev
c3eced298a Typo. 2014-04-14 11:15:00 +02:00
Vassil Vassilev
9b4ea193c0 If cling::Value is provided turn result evaluation on. 2014-04-14 09:09:01 +02:00
Vassil Vassilev
59c7b7b2d7 Coding convention. 2014-04-14 09:09:00 +02:00
Vassil Vassilev
6bb29c9130 Consistent argument names. 2014-04-14 09:09:00 +02:00
Vassil Vassilev
ebad01a510 Simplify and extend the dynamic library manager.
Now it provides an interface which can lookup library names. It can unload a
library and the implementation of loading and resolving a library name is much
simpler.

The extensions are greatly used by the unloading facilities in cling its users.
2014-04-14 09:09:00 +02:00
Vassil Vassilev
5b49009ec8 Use the canonical paths to the files/libraries to unload. 2014-04-14 09:09:00 +02:00
Vassil Vassilev
0abad4f1ff Implement an interface for file/librarly lookup, given the interpreter and system inc paths. 2014-04-14 09:09:00 +02:00
Vassil Vassilev
c44b4a3803 Move the restore point before the actual unload, i.e exclusive restore point.
Thus we can handle the cases where libraries are loaded. That case is tricky
because during library's static initialization, header parsing might occur (resulting
in more decls that need to be unloaded). With the exclusive restore point, we
will undo everything up to it, which implicitly will unload the library and
it's friends.
2014-04-14 09:08:59 +02:00
Vassil Vassilev
0ebd74dcfc Don't unload decls came from vtable emission. 2014-04-14 09:08:59 +02:00
Timur Pocheptsov
035f23752b Clean up. 2014-04-14 09:08:59 +02:00
Timur Pocheptsov
cc6ae43942 .namespace command. 2014-04-14 08:55:03 +02:00
Axel Naumann
1b9910ea28 Fix destruction of array-of-structs.
Iterate over the elements, calling the dtor on each.
Requires two more fields in the AllocatedValue to track the array size and
element offset.
Note that this is only implemented for constant size arrays; all others are expected to not be returned (and thus not stored) by value.
2014-04-11 09:00:01 +02:00
Axel Naumann
895e8eaf51 Init member (thanks, valgrind). 2014-04-11 09:00:00 +02:00
Pere Mato
b4baf22be7 Fix for ROOT-6194 - ROOT6 build for LHCb seems to have hardcoded dependencies on AFS 2014-04-09 18:19:03 +02:00
Vassil Vassilev
05c66f769b Style. 2014-04-09 11:19:00 +02:00
Vassil Vassilev
0314a15148 Shorten the unnecessary long interface name. 2014-04-09 11:19:00 +02:00
Vassil Vassilev
da8237fb86 Use comparison not assignment. 2014-04-09 11:18:59 +02:00
Vassil Vassilev
40b3940666 Adapt to the new (non-const) interface. 2014-04-09 09:27:09 +02:00
Vassil Vassilev
e740840388 Skip removing the system function _Unwind_Resume, needed by the JIT. 2014-04-09 09:27:09 +02:00
Vassil Vassilev
d49c03b10c Files that are .x-ed must be unloadable too. Simplify. 2014-04-09 09:27:08 +02:00
Vassil Vassilev
a85e45178e Unload all kinds of decls that came in. 2014-04-04 17:31:57 +02:00
Vassil Vassilev
198e89d305 Run caching before using the cached vars. 2014-04-04 15:22:00 +02:00
Vassil Vassilev
d1a416ddc0 When variadic return stmt doesn't have a return value, invalidate the calculation of the last expr for evaluation.
In the same cases we still need to synthesize the setValueNoAlloc, to initialize
the cling::Value to void.
2014-04-04 09:42:07 +02:00
Vassil Vassilev
529088b816 There might be returns without return values. 2014-04-03 13:56:59 +02:00
Vassil Vassilev
1c237c2844 In order to run the void expression we need to put it inside a binary operator.
This is the shorthand of syntesizing two statements, which will dramatically
increase the complexity of the implementation.
Now we use setValueToVoid, runExpression
2014-04-02 16:56:58 +02:00
Vassil Vassilev
c868ddfd49 In cases of cling::Value reuse we need to update its settings even if we evaluated void expression. 2014-04-02 16:56:58 +02:00
Vassil Vassilev
76c4024d1d Polish the implementation. Each pragma equivalent must use different source location. 2014-04-02 15:29:58 +02:00
Axel Naumann
26d409e472 Work around pointer/function cast warning. 2014-04-02 15:29:58 +02:00
Axel Naumann
d80be78891 No vector for time-critical i'faces; use SmallVectorImpl in libCling i'faces.
The use of vector forces an allocation for each call, something we don't need to
impose.

SmallVectorImpl doesn't expose the static alloc size; and our interfaces don't
care. Only the actual storage definition needs to define the size, no subsequent
reference.
2014-04-01 18:31:59 +02:00
Axel Naumann
fd71458a5f Implement cheap move ctor/op=. Member-init order. 2014-04-01 18:31:58 +02:00
Axel Naumann
d00d9e8d54 Simplify; adapt to new Value. 2014-04-01 18:31:58 +02:00
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
ffc9fe50b5 Disable useless warnings only for the wrapper functions.
We simulate programatically:
void __cling_Unique {
  #pragma push
  #pragma ... ignore ...
  {code}
  #pragma pop
}
2014-04-01 17:09:58 +02:00
Vassil Vassilev
f9f6c937d3 Remove from the last to the first from the DeclContext 2014-04-01 17:09:58 +02:00
Vassil Vassilev
ab9dad6917 Soft reset the diagnostics in the LH, too. 2014-04-01 10:57:58 +02:00
Vassil Vassilev
1b6c52abf0 Implement removal of ClassTemplatePartialSpecializationDecls. Disable an assert, which doesn't seem to exist in clang.git. 2014-04-01 10:57:58 +02:00
Vassil Vassilev
b303728d76 Add to cmake. 2014-03-31 16:53:55 +02:00
Axel Naumann
700a647a2a Support new name of std::string in libc++. 2014-03-31 15:15:57 +02:00
Vassil Vassilev
96319aa30f Implement .U FileName. 2014-03-31 14:03:08 +02:00
Vassil Vassilev
33676c14a9 Implement dump of MacroDirectiveInfo. 2014-03-31 14:03:08 +02:00
Vassil Vassilev
3e7f2aa7aa If -verify specified don't apply any custom diagnostic mappings. 2014-03-31 14:03:07 +02:00
Vassil Vassilev
4b0b984d63 Use the proper arguments to remove items. 2014-03-31 14:03:06 +02:00
Vassil Vassilev
3dd8d2e900 The CompilerInvocation is the owner of the DiagnosticOptions, all the rest point to them.
It used some default diagnostic options, which are different from the ones that
come from the driver passing the invocation options.
2014-03-31 14:03:06 +02:00
Vassil Vassilev
4d53e0fd33 Access sema internals and revert the list of unused decls. 2014-03-31 14:03:05 +02:00
Vassil Vassilev
33ece80d2b Move renaming. 2014-03-31 14:03:04 +02:00
Vassil Vassilev
230638b648 Rename the class to smth more meaningful. 2014-03-31 14:03:04 +02:00
Vassil Vassilev
d87e58b4f5 Simplify. 2014-03-31 14:03:03 +02:00
Vassil Vassilev
5e6b8590be Do not leak the diagnostics engine. 2014-03-31 14:03:03 +02:00
Vassil Vassilev
1f25fe3a00 CXX consistency. 2014-03-31 14:03:03 +02:00
Vassil Vassilev
73113c2c4b Reduce includes. 2014-03-31 14:03:02 +02:00
Vassil Vassilev
d86e86086f Use better, more accurate include. 2014-03-31 14:03:02 +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
Vassil Vassilev
59b980dd69 Don't recreate the diagnosic client, just set it to the tweaked instance. 2014-03-31 14:03:00 +02:00
Vassil Vassilev
d28bc43cd1 Suppress warnings coming from system headers. 2014-03-31 14:02:59 +02:00
Vassil Vassilev
d1a8efcd55 Implement soft reset of the diagnostics engine. 2014-03-31 14:02:59 +02:00
Axel Naumann
ba642a2869 Be more precise when comparing compilation and runtime libc++.
For instance XCode 5.1 braught a libc++ that was sufficiently different to cause havok
all over the place. Thus ABI_VERSION is clearly not enough.
2014-03-29 15:38:56 +01:00
Axel Naumann
a73b5c98c1 Add new file. 2014-03-28 16:52:56 +01:00
Axel Naumann
b3f0aa4120 Add new llvm lib dependencies. 2014-03-28 16:52:55 +01:00
Axel Naumann
ac4aaa3c76 Fix warning; be explicit about overriding the overload. 2014-03-28 16:13:00 +01:00
Axel Naumann
358764f8c0 Implement custom inliner to skip doFinalization. 2014-03-28 15:51:03 +01:00
Axel Naumann
d7b99d80fc Disable module validation: it takes ages. 2014-03-28 15:51:03 +01:00
Axel Naumann
f2da5f7cb7 Add backend passes (inlining etc) to cling.
They are usually provided by clang's BackendUtil - which we don't use and which
has no support for incremental ("streaming") compilation but runs the passes on
the whole module the whole time, and does end-of-TU cleanup (e.g. "dead" code
removal) that we cannot use because subsequent transactions might create new
uses - think force_inline functions that must stay.

Instead BackendPass wraps what's in clang's BackendUtil into a
TransactionTransformer. It gets added to the IR transformers. In the future this
should only transform the delta of one Transaction instead of the whole Module.

This fixes the libc++ issue we worked around by
templates' symbols are not exported anymore and cause missing symbols with
XCode 5.1.

We include ObjC passes even though this blows up the list of linked libraries to
make it easier to port cling to ObjC(++).
2014-03-28 15:51:03 +01:00
Axel Naumann
3aea38dd3d CXXExceptions are C++, not Exceptions. 2014-03-25 10:25:01 +01:00
Axel Naumann
c65443727d Only turn on C++11 (and other C++ LangOpts) if C++ is enabled. 2014-03-24 16:25:00 +01:00
Vassil Vassilev
2c9fe16a56 Remove dead branch. 2014-03-24 14:25:58 +01:00
Vassil Vassilev
4d5e607256 Merge unloadTransaction and rollbackTransaction. 2014-03-24 14:25:58 +01:00
Vassil Vassilev
cad76c3090 Reset diags is done in the node eraser. 2014-03-24 14:25:58 +01:00
Vassil Vassilev
b1f4287c67 Reduce includes. 2014-03-24 14:25:58 +01:00
Axel Naumann
7390550dfe Add comment explaining (part of) the bootstrap sequencing. 2014-03-23 21:13:54 +01:00
Philippe Canal
93ce42bdc3 Preliminary support for template alias.
GetPartiallyDesaguredType now desugar template alias
but does not yet properly propagate the opaque typedef
and thus:

  template <typename T> using myvector = std::vector<T>;
  myvector<Double32_t> vd32d;

  template<class T> using ptr = T*;
  ptr<Double32_t> p3;

Both currently result in the Double32_t being ignored.
2014-03-21 16:57:07 +01:00
Philippe Canal
45895aec23 No longer hide the compiler detail.
The partial desugaring (part of normalization) now strips a typedef
even when it original from std and points to compiler details (__gnu_cxx, etc.).

The cost of this convenience was the fact the same entity could have different
'name' and thus different class even-though they were supposed to be strictly
equivalent. i.e. depending on the way to get to the class it could be name
vector<int*>::iterator or __gnu_cxx::iterator<int*> or std::iterator<int*>.

This different from the case where we have a strictly bidirectional equivalent
between the class and its unique typedef (yes, we are talking about you std::string).

This also different from the case where there is a semantic difference between
the two possible name.  I.e. where an opaque typedef is used.  For example,
vector<Double32_t> and vector<double> and where the 'way' to get to the type[name]
is relevant.
2014-03-21 16:57:07 +01:00
Timur Pocheptsov
3115300308 Protect against recursive definitions (for example,
data members of a type we're already priting - either static data member or "cross-references").
2014-03-21 11:24:58 +01:00
Vassil Vassilev
68e01b936b Implement FileManager uncaching. 2014-03-19 14:52:21 +01:00
Axel Naumann
931608551b Enforce that cling uses clang with our patches, not a user-provided clang. 2014-03-18 09:18:07 +01:00
CristinaCristescu
6422e03e30 Unloading of functions, enums, globals (ROOT-5701). 2014-03-17 14:48:07 +01:00
Vassil Vassilev
890c1df223 Remove unused variable. 2014-03-17 12:03:02 +01:00
Vassil Vassilev
ff57cb4da0 Collect all functions that we need to delete and delete them 2014-03-15 10:08:24 +01:00
Vassil Vassilev
1aa3c27c06 @_GLOBAL__I_aN can have multiple calls also 2014-03-15 10:08:24 +01:00
Vassil Vassilev
344657830e Add clarification comment. 2014-03-15 10:08:24 +01:00
Bertrand Bellenot
f74816cfdf Another attempt to fix compilation warnings like: Command line warning D9025: overriding '/EHs' with '/EHs-' 2014-03-14 11:40:55 +01:00
Vassil Vassilev
5d959e9190 Doxygen warning 2014-03-14 10:52:29 +01:00
Vassil Vassilev
1b85e6e20d We may not have incr executor. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
b371e33e23 We may not have code gen. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
1f7d6836f8 Remove the functions after the loop is done. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
fff83003a6 Protect against calling a function with an unexpected signature. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
4e4d39d389 Make it power of 2. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
bb46c353f0 Style consistency. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
0e9ea976e0 Remove unused var. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
b5e6cb8dee Use runFunction for running inits. Let's see whether it imporves LHCb builds 2014-03-14 10:52:29 +01:00
Vassil Vassilev
a54f51cdee Remove dead code. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
2323fea34c Collect properly the references and remove orphaned globals due to death of a GV.
Cleanup and optimize the code.
2014-03-14 10:52:29 +01:00
Vassil Vassilev
12f47878bc Invert order, because Dtor_Base calls Dtor_complete. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
f6f4c707d4 Add a dead code removal pass. The test is expected to succeed now.
Removing a GlobalValue from the module might make other values (referenced only
by the one being removed) available for removal. Those should go as well. The
initial implementation is a bit greedy - it removes more: i.e dtors because they
are not referenced (because IncrementalExecutor takes care of them in an custom
way)
2014-03-14 10:52:29 +01:00
Vassil Vassilev
d763cfb137 Remove the members first, because they might need the redecl chain. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
887645367e Pass in codegen. 2014-03-14 10:52:29 +01:00
Vassil Vassilev
c0e918f506 Since we append the extracted decls in the transaction the wrapper must go last.
The reason is it introduces a fake dependency with which the unloaded chokes up.
2014-03-14 10:52:29 +01:00
Vassil Vassilev
66c59788d5 Remove @_GLOBAL__I_a and @__cxx_global_var_init after running them. 2014-03-14 10:52:28 +01:00
Vassil Vassilev
5e5e7e9d1f Improve consistency. IncrementalExecutor should use llvm by default. 2014-03-14 10:52:28 +01:00
Vassil Vassilev
62318fcbc7 80 cols 2014-03-14 10:52:28 +01:00
Vassil Vassilev
6f11ad9b1e Pass in codegen as an entity to be recovered. 2014-03-14 10:52:28 +01:00
Axel Naumann
f30e498afd Try again: fix standalone cling; now verified on Win. 2014-03-10 13:43:01 +01:00
Axel Naumann
5634799c7b Typo. 2014-03-09 21:17:01 +01:00
Axel Naumann
f24006695a Try again with CMake-ism: handle empty COMPILE_FLAGS. 2014-03-09 13:34:00 +01:00
Axel Naumann
1ecfebabdb Apparently COMPILE_FLAGS can be empty. 2014-03-09 12:52:59 +01:00
Axel Naumann
772a9e5036 Add new dependency. 2014-03-08 19:05:02 +01:00
Axel Naumann
e7982e022d Clean linked libs. 2014-03-08 19:05:02 +01:00
Axel Naumann
d27125d2e6 Extract git commit and use it to version cling. 2014-03-08 18:47:10 +01:00
Axel Naumann
d7ca5b7759 Use new libdep syntax; parameterize target libs to link. 2014-03-08 18:47:09 +01:00
Axel Naumann
ab0e63a547 Only use native target, avoids --enable-targets=host. 2014-03-08 18:47:08 +01:00
Axel Naumann
ed1069786f Improve version string; adapt test. 2014-03-05 09:46:09 +01:00
Axel Naumann
c505d76e2f Fix constness warning. 2014-03-05 09:46:09 +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
5045248a76 Dealy running static init until gCling is defined; local_cxa_atexit() needs it. 2014-03-04 19:55:00 +01:00
Axel Naumann
6325e7ed19 Keep trying to remap __cxa_atexit until succeeded.
__cxa_atexit is generated by clang::CodeGen upon seeing the first static
destructor. Instead of trying to provoke that we just continue to search for it.
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
a2ccf158bd Remove stray semicolon. 2014-03-03 23:48:10 +01:00
Axel Naumann
5294658610 Update to llvm/clang r202469. 2014-03-03 18:45:21 +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
d5abdd34f6 Remove unused variable. 2014-03-03 17:49:56 +01:00
Vassil Vassilev
b5d7af7566 Remove accidentally checked in file. 2014-03-03 15:44:01 +01:00
Vassil Vassilev
f7425b323d Fix init order. 2014-03-03 15:27:05 +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
c7503fbe79 Inline. 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
be8b6e8db1 Fix cmake. 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
2ecd78a0aa Move the callback invocation in the interpreter. 2014-03-03 15:27:04 +01:00
Vassil Vassilev
2073194a6e Trailing blanks, tabs. 2014-02-28 10:36:00 +01:00
Vassil Vassilev
943350a7c2 Implement .stats command printing out statistics about internal ADT 2014-02-28 10:35:59 +01:00
Vassil Vassilev
03010a5af1 Revert failed instantiations ROOT-6070. 2014-02-28 10:35:59 +01:00
Vassil Vassilev
71b05e8321 Use the new CodeGen debug printouts in .storeState 2014-02-27 15:57:11 +01:00
Vassil Vassilev
a6c682a670 Add more handy interface. 2014-02-27 12:49:13 +01:00
Vassil Vassilev
50fe8b7a32 Clarification comment. 2014-02-27 12:49:12 +01:00
Vassil Vassilev
98283abd49 Replace the craftwork with the sophisticated node eraser. 2014-02-27 12:49:12 +01:00
Vassil Vassilev
99d9ac11b2 Add support for dtor removal. 2014-02-27 12:49:12 +01:00
Vassil Vassilev
c22ea2a25e Run the dtors first, before they get unloaded and forgotten. 2014-02-27 12:49:12 +01:00
Vassil Vassilev
3f1984dd38 Blank space artifact. 2014-02-27 12:49:12 +01:00
Vassil Vassilev
150231c357 Run only dtors of the unloaded entities. 2014-02-27 12:49:11 +01:00
Vassil Vassilev
1bf7c49086 Move unloading of N transactions outside IncrementalParser 2014-02-27 12:49:11 +01:00
Vassil Vassilev
9afad24a05 Pop back in the worker routine. 2014-02-27 12:49:11 +01:00
Vassil Vassilev
dc6a46c67d Enforce more integrity. 2014-02-27 12:49:11 +01:00
Vassil Vassilev
e89b570618 Use iterators instead. 2014-02-27 12:49:11 +01:00
Vassil Vassilev
0774231e01 Use SmallVector for the dtor list. 2014-02-27 12:49:11 +01:00
Vassil Vassilev
8958ff07fa Order includes. 2014-02-27 12:49:11 +01:00
Vassil Vassilev
e7b0024c88 Doesn't depend on neither the module nor the execution engine. 2014-02-27 12:49:10 +01:00
Vassil Vassilev
eea3bf1f3d This should be reimplemented. So far it is a nop. 2014-02-27 12:49:10 +01:00
Vassil Vassilev
bd023123b0 No llvm.global_dtors variable in the module. 2014-02-27 12:49:09 +01:00
Vassil Vassilev
4eeddf8a8c Bind cxa_atexit to the Transaction instead of the Decl. 2014-02-27 12:49:09 +01:00
Vassil Vassilev
a3d6d2a32d Remove redundant fwd decl. 2014-02-27 12:49:09 +01:00
Vassil Vassilev
0de4bf4299 Fix a wrong init. 2014-02-27 12:49:09 +01:00
Axel Naumann
176ffc031b Stream refs by streaming the ref'ed object. 2014-02-26 09:22:05 +01:00
Axel Naumann
68d1b137b5 Pass lvalues like declRefExpr as references into the cling::Value (ROOT-6107).
This restores ReturnSynthesizer's behavior for ValueExtractionSynthesizer.
2014-02-26 09:22:04 +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
Bertrand Bellenot
bf14b93185 Suppress MSVC warning C4530: C++ exception handler used, but unwind semantics are not enabled 2014-02-21 10:52:58 +01:00
Vassil Vassilev
fe98663520 Rename var clashing with the param 2014-02-21 09:33:02 +01:00
Axel Naumann
9ef996db19 Keep -I unique: no need to add it if it already exists. 2014-02-20 18:05:58 +01:00
Axel Naumann
a7c08683ae Decl iteration can trigger deserialization; use PushTransactionRAII. 2014-02-20 17:12:58 +01:00
Vassil Vassilev
c92a68efc4 Implement cling::Transaction unique id. 2014-02-20 15:16:59 +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
Vassil Vassilev
db34098f9e 80cols. 2014-02-20 10:36:10 +01:00
Vassil Vassilev
a25c6b5ce5 Blanks. 2014-02-20 10:36:09 +01:00
Vassil Vassilev
1a59a8b87a Blanks. 2014-02-20 10:36:08 +01:00
Bertrand Bellenot
3dce92b1e2 Make sure the /EHsc flag is properly set 2014-02-19 17:43:59 +01:00
Axel Naumann
705ddaea64 Mark all extracted decls used.
Fixes
.rawInput 1
enum E {one, two};
.rawInput 0
const E var = one;
2014-02-19 15:59:01 +01:00
Vassil Vassilev
9481d37d5b Use the new signature. 2014-02-19 15:01:03 +01:00
Vassil Vassilev
9e1bfae897 Simplify. 2014-02-19 15:01:03 +01:00
Bertrand Bellenot
c70ddac80a Silent compilation warnings on Windows 2014-02-19 14:55:00 +01:00
Axel Naumann
c8e2740861 Implement value printing of a long double. 2014-02-19 14:55:00 +01:00
Axel Naumann
b27e430c89 Implement setValueNoAlloc() for long double. 2014-02-19 14:55:00 +01:00
Bertrand Bellenot
2927b40462 Add /EHsc exception handling compiler flag for MSVC 2014-02-19 14:32:57 +01:00
Vassil Vassilev
e92088a41e If RHS is dependent - skip value extraction. Add a testcase for auto vars. 2014-02-19 14:22:58 +01:00
Vassil Vassilev
2309fc097e Rename ExecutionContext -> IncrementalExecutor 2014-02-19 12:55:00 +01:00
Vassil Vassilev
4c8ca2b50b More merge fixups. 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
Vassil Vassilev
5120e219d5 Remove more redundant code 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
1598872fce Second try to silence warning cast from pointer-to-object to pointer-to-function. 2014-02-19 10:18:03 +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
77ae505186 Silence 'cast between pointer-to-function and pointer-to-object' 2014-02-18 18:35:01 +01:00
Vassil Vassilev
9ba4c591c6 Update cmake. 2014-02-18 18:19:09 +01:00
Vassil Vassilev
6435fb8ad1 Remove unused var. 2014-02-18 18:19:07 +01:00
Vassil Vassilev
19c381562d Update all references of ReturnSynthesizer. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
ca5db8bcce Use a bit better (more descriptive) name. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
4a62769b38 Return early in case of empty wrappers for example. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
03a0159cc4 Assign if not RS. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
d65a3ff810 Typo. 2014-02-18 17:22:59 +01:00
Vassil Vassilev
36618c9b94 Remove redundant fwd declaration. 2014-02-18 17:22: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
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