Commit Graph

150 Commits

Author SHA1 Message Date
Vassil Vassilev
6ef68e5512 Fix potential pre-existing issue for big endian 2023-02-03 07:29:07 +01:00
Vassil Vassilev
07c4469328 Improve consistency in cling::Value.
The improvements are:
  * We provide getX and setX interfaces instead of returning the address for the
    non const methods. This allows us to be more consistent in terms of
    lifetimes as now users cannot take the address of block of memory which can
    be freed by the cling::Value.
  * We remove the storage types and we rely on the clang::Type which we have in
    the cling::Value.
2023-02-03 07:29:07 +01:00
Jonas Hahnfeld
d8451f6822 Print default template arguments
Fixes (at least) roottest-cling-stl-default-VectorSort and
roottest-cling-templateMembers-runoperatorEqual.
2022-12-09 08:44:19 +01:00
Jonas Hahnfeld
b7aaa96719 Print 'a<b<c> >' rather than 'a<b<c>>' in ValuePrinter
See earlier commit for the Transform.C test.
2022-12-09 08:44:19 +01:00
Vassil Vassilev
0c183d3adf APSInt::toString returning std::string was removed.
See llvm/llvm-project@61cdaf66fe
2022-12-09 08:44:17 +01:00
Vassil Vassilev
c8c61d7aa9 llvm::StringRef does not support automatic conversion to string anymore.
See llvm/llvm-project@777180a32b
2022-12-09 08:44:16 +01:00
Javier Lopez-Gomez
e9474a2fc9 ValuePrinter: minor readability improvement 2022-02-22 17:59:04 +01:00
Javier Lopez-Gomez
ba4ece8f3d ValuePrinter: for auto decls, we should use the deduced type
Value printing an expression of type `AutoType` ended up in calling the general
fallback `printValue(const void *)`.
To call the appropriate overload, the deduced type should be used instead.

Fixes ROOT-9687.
2022-02-22 17:59:04 +01:00
Axel Naumann
3bd3ff18cb Make sure required symbols are exported:
and use a standard mechanism that plays well with -fvisibility.
Given that several symbols now use declspec(dllexport), remove them from
the ad-hoc cling_exports in ROOT's CMakeLists.txt.
2021-05-25 16:29:06 +02:00
Vassil Vassilev
f2e5f43acf Fix warnings about the ignored quals. 2021-02-25 20:44:19 +01:00
Vassil Vassilev
deafa47202 Remove unused parameters. Fixes -Wunused-parameter. 2021-02-25 20:44:18 +01:00
Vassil Vassilev
b4daff130e LLVM_ON_WIN32 was dropped.
See llvm-mirror/llvm@4833be0
2021-02-25 20:44:18 +01:00
Vassil Vassilev
dbc4d6631a first and second were renamed to getBegin and getEnd. 2021-02-25 20:44:17 +01:00
Vassil Vassilev
60bed9429d CompoundStmt::setStmts was reimplemented to save a pointer.
Unfortunately this break external tools such as cling which alters CompoundStmts
to implement its interactive extensions.

We have implemented a patch in clang which brings the old facilities only when
the new interface CompoundStmt::replaceStmts is called.

See llvm-mirror/clang@d0ee47a
2021-02-25 20:44:16 +01:00
Javier Lopez-Gomez
1f3b05bd64 DefinitionShadower: modifications suggested in the PR 2019-09-27 14:59:05 +02:00
Axel Naumann
6a73fd08d2 Help ValuePrinter find the transaction:
If the ValuePrinter runtime header gets included,
a transaction might be emitted, and the transaction
containing the function body cannot be found anymore.
This causes roottest/root/meta/getFuncBody.C to fail
with runtime modules.
2019-09-01 09:15:17 +02:00
xloem
8acc94bfd6 Protect possibly predefined preprocessor symbol
On my systems (RHEL7 and Android Termux) PAGE_SIZE is defined to 4096 in /usr/include/sys/user.h .  The enum then produces a compile-term error.
Adding this change resolves this error for me.
2019-05-13 15:01:11 +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
Axel Naumann
2a60e2a750 Implicit array decay, some printValue-s need arrays! Fix value pointer calculation. 2018-04-30 16:29:42 +02:00
Axel Naumann
47dde3b27f Cache result of type transform. 2018-04-30 16:29:42 +02:00
Axel Naumann
ef2fc34520 Also allow char16, char32 for string value printing. 2018-04-26 12:14:31 +02:00
Axel Naumann
9d3e144814 Allow "same types" to be printed as const char*.
Fixes printing of std::string::c_str().
2018-04-26 12:14:31 +02:00
Axel Naumann
0793802867 Fix const char* printing, take 2. 2018-04-25 22:00:16 +02:00
Axel Naumann
edef97f368 Fix const char* printing! 2018-04-25 21:29:08 +02:00
Axel Naumann
ea4efd2a75 Generate the value string through AST manipulation (ROOT-8897). 2018-04-25 16:44:05 +02:00
Axel Naumann
56b0e8e184 Print float with number of signif digits, double with 8. 2017-12-05 15:40:37 +01:00
Axel Naumann
582af5e250 Print "1.000000" for a double 1 instead of "1", as in 6.10.
Uses the # modifier to printf using the "alternate form".
2017-12-05 15:40:37 +01:00
Axel Naumann
3bf7bc1a48 Use %g instead of %f, to preserve precision. 2017-11-06 21:20:19 +01:00
Axel Naumann
f033d3024f RAII, not RTTI: rename class and #includes. 2017-09-18 14:29:05 +02:00
Axel Naumann
363deeffa1 Use LockCompilationDuringUserCodeExecutionRAII when compiling during user code execution. 2017-09-18 14:29:05 +02:00
Axel Naumann
dc04fb555c Show diagnostics of possible value print errors. 2017-06-23 17:14:12 +02:00
Axel Naumann
27aea4b5a0 Use proper function name. 2017-06-23 17:14:12 +02:00
Frederich Munch
7504234e21 Cache all string types. 2017-06-22 13:10:37 +02:00
Frederich Munch
8fab0d5be8 Fix caching of std::string type.
If the Transaction that holds std::string type is unloaded LookupHelper::m_StringTy will point to invalid memory.
LookupHelper::findType can return an invalid QualType causing dereference of null.
2017-06-22 13:10:37 +02:00
Frederich Munch
6753263bf4 Refactor specializations of executePrintValue. Having ExecutePrintValue templated codegens duplicate functions unneccessarily. Removes re-direction, duplicate signatures, and line count for executePrintValue. 2017-06-21 12:59:08 +02:00
Frederich Munch
c11b3fdecc Enclose more stuff in anonymous namespaces. 2017-06-21 12:59:08 +02:00
Frederich Munch
14d88d2d86 Move wchar_t type branching out of runtime. 2017-06-21 08:29:11 +02:00
Vassil Vassilev
45209f520a The llvm conversion routines went into namespace llvm. 2017-06-08 10:29:13 +02:00
Axel Naumann
dec2b8aa60 Use LookupHelper cache instead of local static. 2017-05-08 11:44:07 +02:00
Axel Naumann
de06e519fd Do not print std::string through Interpreter.
Increases performance for all printValue() calls that do go through the Interpreter.
2017-05-05 18:44:38 +02:00
Axel Naumann
e25880b49d Do not allocate Values/strings for printing simple types.
Still missing is calling a printValue(std::string) overload from printUnpackedClingValue.
That is needed for optimizing the generic printValue() invocation through the interpreter:
it should not have to create a *second* Value for printing the string returned from printValue().
2017-05-05 18:44:38 +02:00
Axel Naumann
871b304f8c Assemble array dimensions recursively (ROOT-7016). 2017-05-05 12:14:05 +02:00
Frederich Munch
de62978dad Fix error from ParseTopLevelDecl not always being propagated to the current Transaction. Fix LangOpts.AccessControl not begin set in AccessCtrlRAII_t, a regression this exposed. 2017-02-17 20:45:03 +01:00
Frederich Munch
b3834b1dcf Add Interpreter::getDiagnostics method. 2017-02-09 16:59:38 +01:00
Frederich Munch
2e2d44e995 Fix API usage error in LLVM unicode routines. Use reinterpret_cast to force compile time errors. 2017-01-20 20:59:08 +01:00
Frederich Munch
5e0a4b1fb1 Use LLVM for Unicode conversion on gcc < 5. Force export of toUTF8 specializations otherwise. 2017-01-18 15:59:12 +01:00
Frederich Munch
b48d0c3779 Windows: Fix wchar_t and wstring_convert on MSVC. 2017-01-18 15:59:12 +01:00
Frederich Munch
08f8c4fa80 Move to UTF-8 string conversion into separate module. Support UTF-8 output on Windows. 2017-01-18 15:59:12 +01:00
Frederich Munch
f39f1f7318 Fix C-string printing for safety, speed, and data loss. Prior behavior assumed both pointer and pointer+10000 were valid memory. Add override for const char arrays so that they can be printed faster. Make cling::printValue a lossless operation. Previously strings with non-ASCII printable chars were transformed into an invalid c-string and the data could not be used to recreate the string. 2017-01-18 15:59:11 +01:00
Frederich Munch
fb96f9c040 Support unicode std::strings. 2017-01-18 15:59:11 +01:00