Commit Graph

95 Commits

Author SHA1 Message Date
Jonas Hahnfeld
fc12e238fc Remove expected space before array brackets in tests 2023-12-11 08:59:21 +01:00
Vassil Vassilev
5add0d7732 Rename simplisticCast to castAs. 2023-02-03 07:29:07 +01:00
Axel Naumann
b118f4dee3 Get rid of extra-complex built_cling:
that is anyway what we want to test, always.
And nothing seems to set the env var.
2021-02-25 20:44:18 +01:00
Simeon Ehrig
2489cf13b1 Replaced incremental PTX compiler with a internal implementation
Replaced the old version of the PTX compiler which used external tools and llvm::ExecuteAndWait with an internal implementation. The new incremental PTX compiler uses a modified version of the cling::Interpreter instance. The instance can process the PTX built-ins and generates LLVM IR. The LLVM IR is be compiled to PTX via an additional NVPTX backend implemented in the IncrementalCUDADeviceCompiler.

The new implementation has many advantages:
- it's much faster than the old version
- less error-prone because the ASTPrinter and some unnecessary cling transformations are avoided
- reduction of problems in searching for external tools (can be very complicated on HPC systems)

The IncrementalCUDADeviceCompiler is moved from the cling::IncrementalParser to the cling::Interpreter, because the second interpreter needs the input without wrappers or transformations.
2019-11-07 19:29:15 +01:00
Simeon Ehrig
6c46b65754 Extend cling::Intpereter to incremental compile PTX code for CUDA devices
- change CUDA to CUDAHost and add CUDADevice to the InvocationOptions
- in the PTX mode, some ASTTransformer will not be used, which are useful for the x86 mode
2019-11-07 19:29:15 +01:00
Axel Naumann
4fef27091e Add storage to test types, to trigger dtor call. 2019-07-15 17:29:08 +02:00
Yuka Takahashi
80fa13b41e Fix print.C
Remove semicolon to print out
2018-10-12 14:30:16 +02:00
Yuka Takahashi
d77a3252dc Fix print.C
ToString takes typename and an object pointer
2018-10-12 08:44:07 +02:00
Yuka Takahashi
53476daf4b Fix printing test in Cling
Testsuit was actually looking at '"' for match, comparing literal 21
should be enough.
2018-10-10 14:59:07 +02:00
Yuka Takahashi
9c7abadde0 Implement toString interface to gInterpreter
This is the final version of "printValue" discussion.

We agreed that printValue interface should be altered to ToString
interface, which can be invoked `gInterpreter->ToString(XYZ)`. (ToString is in TCling and toString is in Interpreter :D)

This patch contains:

- Implementation of toString in Interpreter.cpp
- Re-Implementation of ClingPrintValue to use ToString because I changed to use Evaluate some time ago.
- Removing of RVec version of printValue which wasn't used at all
- Fix test/vecops_rvec.cxx, printValue is never supposed to be called by a normal user.
2018-10-04 17:13:34 +02:00
Simeon Ehrig
4f73d1b93d reduce arguments at start of cling -xcling
the argument --cuda-host-only and the default c++ stardard will be set at start of cling -xcuda
2018-03-23 18:29:07 +01:00
Axel Naumann
88edc07e65 Adjust after increased fp precision. 2017-12-05 15:40:37 +01:00
Axel Naumann
a662db9c4c Adapt to new=old value printer: "1.000000" for a double 1 instead of "1".
Revert "Adapt to format changes in floating point value printing."

This reverts commit a15ef54fb4c5152eeff740cc1f3be6249ede26e6.
2017-12-05 15:40:37 +01:00
Axel Naumann
a9808afd40 Adapt to format changes in floating point value printing. 2017-11-07 19:44:33 +01:00
Frederich Munch
cdf5c72f1d Fix tests on platforms with __float128 without forcing C++14.
This reverts commit c11224dce0.
2017-07-05 10:00:05 +02:00
Axel Naumann
c11224dce0 Force -std=c++14 to enable __STRICT_ANSI__.
This removes __float128 warnings (enabled when building cling, disabled at runtime due to missing
support in clang) on MacOS with GCC.
2017-07-04 11:29:45 +02:00
Frederich Munch
e641e0e837 Compress bools into bitfields. 2017-06-21 08:29:11 +02:00
Vassil Vassilev
8f257e74d3 Create a virtual file entry for each input line.
This is the only way not to confuse the diagnostics engine of upgraded clang.

Also, this gives us a few advantages:
  * We can compare more precisely the source locations of diagnostics;
  * We can merge the code completion code path which works with file entries;
  * We can rely better when specifying //expected-note-s in different files.
2017-06-08 10:29:13 +02:00
Frederich Munch
77bda84fb2 Destroy elements in reverse order of construction.
Prevents possibility of last element referencing now invalid first element.
2017-06-06 13:59:18 +02:00
Frederich Munch
2d141ff840 Change evaluation test to track instances better. 2017-06-06 13:59:18 +02:00
Axel Naumann
93869de6c7 Test ROOT-7016. 2017-05-05 12:14:05 +02:00
Frederich Munch
f28c04c1a2 Add Interpreter::getMacroValue method. 2017-03-23 15:59:04 +01:00
Frederich Munch
311a557be1 Windows: Interpret -nostdinc++ as -nostdinc which clang does not use on Windows backend. Fixes ABI and NoStdInc tests. 2017-02-17 15:14:06 +01:00
Frederich Munch
1aabc2dbe0 Add simple wrappers for buffered LLVM streams. Use them to control Value printing format. 2016-12-19 13:59:11 +01:00
Frederich Munch
bf3c8052d8 Windows: Fix various test failures. 2016-12-12 12:44:09 +01:00
Frederich Munch
d4aed2527d Add CLING_EXPORT macro. 2016-12-12 12:44:09 +01:00
Roman Zulak
74cb06a22f Fixes issues where symbols can be improperly aligned for llvm::PointerIntPair Use std::pair instead of llvm::PointerIntPair.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-10-19 13:54:07 +02:00
Frederich Munch
be7769aa5d Remove .rawInput from a variety of tests to test unwrapped function input. 2016-09-05 12:44:13 +02:00
Frederich Munch
bbfd61d897 Share -v flag with clang, and use it during startup to log info about header search paths.
Also fix trying to report why compiler invocation failed when it was never attempted.
Add message about build being probably being configured incorrectly.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
5ee1cfb7c3 Refactor all argument parsing into InvocationOptions.cpp.
Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
2142853de6 Don't call clang::ApplyHeaderSearchOptions from Interpreter::AddIncludePaths.
Instead call it at the end of cling::createCI (that should probably change too).

clang::ApplyHeaderSearchOptions is a very heavy-weight function that does a lot
of work to determine and add system headers. More importantly it can also wind
up invalidating clangs internal cache making inclusion of files later impossible.

By using the lighter HeaderSearchOptions::AddSearchPath we not only avoid redoing
a lot of work that has been done, but can adjust the method in clang to avoid
cache invalidation so that calling Interpreter::AddIncludePath will actually
make the files in that path accessible to clang.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
2016-08-18 15:44:18 +02:00
Frederich Munch
e3265d1d8c Add %built_cling substitution for lit so tests can be run from either the build or installations directories. 2016-08-12 14:14:06 +02:00
Boris Perovic
800c644352 Removed "VALID" after address output, fixes roottest. Various fixes based on comments after second round. 2015-08-18 18:08:20 +02:00
Boris Perovic
2d317b983d Fixes based on cling test suite ("make test"). 2015-08-18 18:08:20 +02:00
Boris Perovic
c44940b223 New printValue() integration (printing unified through overloading of printValue() function and template resolution). Modified tests to conform to the new prints. 2015-08-17 18:45:03 +02:00
Axel Naumann
9c383fcef3 clang is built without rtti; no chance to find its typeinfo. 2015-02-11 10:57:39 +01:00
Vassil Vassilev
0764694c14 Do not try to fixup return statements in lambdas. 2014-10-08 17:42:04 +02:00
Vassil Vassilev
6bbc4fa200 Disable feature until we get the upgrade settled. 2014-08-15 14:53:01 +02:00
Vassil Vassilev
212259918a Implement continuation for #if* #endif. 2014-08-15 12:34:00 +02:00
Philippe Canal
576ca3ca96 Remove trailing spaces 2014-08-13 16:08:36 +02:00
Vassil Vassilev
f5250400d4 Remove the junk I accidentally committed. 2014-06-05 17:38:59 +02:00
manasij7479
024b16df11 Init TagsExtension Module, for extending cling to provide interactive hints
AutoloadCallback: Implementing InterpreterCallbacks to attach the module to cling
   The main focus is on overriding LookupObject so that the information about
   lookup failures are obtained from clang.
   The type of the name is not taken into consideration for now.

TagManager: To manage and lookup information from various sorts of tag files.
   Currently a TagManager object is owned by the callback system.
   This may change in future.

Wrapper: As a base class for handling particular types of tagfiles.
   The TagManager maintains a container of Wrappers.

CtagsFileWrapper: Implementing a wrapper for ctags.
   This class is responsible for generating a tagfile from a given path or list of files.
   It also performs lookups in the file generated by it.

And a few simple file system utils to complement llvm::sys::fs and path utilities
2014-06-04 09:20:14 +02:00
Axel Naumann
39ed28c03e Void has no address. 2014-05-26 17:37:57 +02:00
Vassil Vassilev
c86fbc27b9 Rewire the dumping on cling::Value to its new implementation.
Dump cling::Value within setNoAlloc routines because this is its lifespan,
otherwise gets deleted if nobody requested it. I.e it was created only for
value printing purposes.

Dump cling::Value outside setWithAlloc because the actual value is not put inside
until the call to ::new finishes, thus we need to do it outside, i.e in EvaluateInternal.

Switch on the ValueExtraction synthesizer even when 'just' value printing. We
depend on it. Must be factored out properly in one class.

Stop attaching the value printing template magic, which didn't work in some cases.

Update the ref file, because now there is better type information.

Adapt the user-defined printout functions (TDatime).
2014-05-18 18:08:58 +02:00
Vassil Vassilev
9b4ea193c0 If cling::Value is provided turn result evaluation on. 2014-04-14 09:09:01 +02:00
Axel Naumann
628618f2b9 Add test for copy ctor and dtor in Value for array-of-structs. 2014-04-11 09:00:01 +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
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
Axel Naumann
d00d9e8d54 Simplify; adapt to new Value. 2014-04-01 18:31:58 +02:00
Axel Naumann
574b7751f9 Test the behavior of the ValueExtractionSythesizer for objects.
Still missing: arrays incl arrays of objects.
2014-02-26 09:22:05 +01:00