aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Interpreter
AgeCommit message (Collapse)AuthorFilesLines
12 days[clang-repl] Disable out of process JIT tests on non-unix platforms (#159404)Abhinav Kumar1-2/+2
Co-authored-by: kr-2003 <kumar.kr.abhinav@gmail.com> Co-authored-by: Anutosh Bhat <andersonbhat491@gmail.com>
2025-09-13[clang-repl] Add support for running custom code in Remote JIT executor ↵Abhinav Kumar2-1/+225
(#157358) Introduce a custom lambda mechanism that allows injecting user-defined code into the Remote JIT’s executor. --------- Co-authored-by: kr-2003 <kumar.kr.abhinav@gmail.com>
2025-08-20[clang-repl] Fix InstantiateTemplate & Value test while building against ↵Anutosh Bhat2-16/+5
emscripten (#154513) Building with assertions flag (-sAssertions=2) gives me these ``` [ RUN ] InterpreterTest.InstantiateTemplate Aborted(Assertion failed: undefined symbol '__clang_Interpreter_SetValueWithAlloc'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Error in loading dynamic library incr_module_3.wasm: RuntimeError: Aborted(Assertion failed: undefined symbol '__clang_Interpreter_SetValueWithAlloc'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Could not load dynamic lib: incr_module_3.wasm RuntimeError: Aborted(Assertion failed: undefined symbol '__clang_Interpreter_SetValueWithAlloc'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) [ RUN ] InterpreterTest.InstantiateTemplate Aborted(Assertion failed: undefined symbol '__clang_Interpreter_SetValueNoAlloc'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Error in loading dynamic library incr_module_3.wasm: RuntimeError: Aborted(Assertion failed: undefined symbol '__clang_Interpreter_SetValueNoAlloc'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Could not load dynamic lib: incr_module_3.wasm RuntimeError: Aborted(Assertion failed: undefined symbol '__clang_Interpreter_SetValueNoAlloc'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) [ RUN ] InterpreterTest.InstantiateTemplate Aborted(Assertion failed: undefined symbol '_ZnwmPv26__clang_Interpreter_NewTag'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Error in loading dynamic library incr_module_23.wasm: RuntimeError: Aborted(Assertion failed: undefined symbol '_ZnwmPv26__clang_Interpreter_NewTag'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Could not load dynamic lib: incr_module_23.wasm RuntimeError: Aborted(Assertion failed: undefined symbol '_ZnwmPv26__clang_Interpreter_NewTag'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) [ RUN ] InterpreterTest.Value Aborted(Assertion failed: undefined symbol '_Z9getGlobalv'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Error in loading dynamic library incr_module_36.wasm: RuntimeError: Aborted(Assertion failed: undefined symbol '_Z9getGlobalv'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Could not load dynamic lib: incr_module_36.wasm [ RUN ] InterpreterTest.Value Aborted(Assertion failed: undefined symbol '_Z9getGlobalv'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Error in loading dynamic library incr_module_36.wasm: RuntimeError: Aborted(Assertion failed: undefined symbol '_Z9setGlobali'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment) Could not load dynamic lib: incr_module_36.wasm ``` **So we have some symbols missing here that are needed by the side modules being created here.** First 2 are needed by both tests Last 3 are needed for these lines accordingly in the Value test. https://github.com/llvm/llvm-project/blob/dc23869f98452ca2c4086f12bb431a8d6fdb8169/clang/unittests/Interpreter/InterpreterTest.cpp#L355 https://github.com/llvm/llvm-project/blob/dc23869f98452ca2c4086f12bb431a8d6fdb8169/clang/unittests/Interpreter/InterpreterTest.cpp#L364 https://github.com/llvm/llvm-project/blob/dc23869f98452ca2c4086f12bb431a8d6fdb8169/clang/unittests/Interpreter/InterpreterTest.cpp#L365 Everything should work as expected after this ``` [----------] 9 tests from InterpreterTest [ RUN ] InterpreterTest.Sanity [ OK ] InterpreterTest.Sanity (18 ms) [ RUN ] InterpreterTest.IncrementalInputTopLevelDecls [ OK ] InterpreterTest.IncrementalInputTopLevelDecls (45 ms) [ RUN ] InterpreterTest.Errors [ OK ] InterpreterTest.Errors (29 ms) [ RUN ] InterpreterTest.DeclsAndStatements [ OK ] InterpreterTest.DeclsAndStatements (34 ms) [ RUN ] InterpreterTest.UndoCommand /Users/anutosh491/work/llvm-project/clang/unittests/Interpreter/InterpreterTest.cpp:156: Skipped Test fails for Emscipten builds [ SKIPPED ] InterpreterTest.UndoCommand (0 ms) [ RUN ] InterpreterTest.FindMangledNameSymbol [ OK ] InterpreterTest.FindMangledNameSymbol (85 ms) [ RUN ] InterpreterTest.InstantiateTemplate [ OK ] InterpreterTest.InstantiateTemplate (127 ms) [ RUN ] InterpreterTest.Value [ OK ] InterpreterTest.Value (608 ms) [ RUN ] InterpreterTest.TranslationUnit_CanonicalDecl [ OK ] InterpreterTest.TranslationUnit_CanonicalDecl (64 ms) [----------] 9 tests from InterpreterTest (1014 ms total) ``` This is similar to how we need to take care of some symbols while building side modules during running cppinterop's test suite !
2025-08-14Enable running ClangReplInterpreterTests in an Emscripten environment (#150977)mcbarton6-13/+102
@vgvassilev @anutosh491 This is what it took for me to enable running ClangReplInterpreterTests in an Emscripten environment. When I ran this patch for llvm 20 we could run InterpreterTest.InstantiateTemplate , but now it crashes gtest when running in node. Let me know what you think.
2025-08-12Revert "[clang-repl] Enable extending `launchExecutor` (#152562)" (#153180)Abhinav Kumar3-180/+1
Reverts #152562. Seems to be causing test failures on Solaris bot. Co-authored-by: kr-2003 <kumar.kr.abhinav@gmail.com>
2025-08-08[clang-repl] Enable extending `launchExecutor` (#152562)Abhinav Kumar3-1/+180
This patch introduces the ability to customize the fork process with an external lambda function. This is useful for downstream clients where they want to do stream redirection.
2025-07-23[clang-repl] Improve error message on failed undos (#149396)Aaron Danen1-2/+2
Updated error message logic for undo function. Throws different errors for the case of there being nothing to undo, and for the case of requesting more undos than there are operations to undo. Fixes https://github.com/llvm/llvm-project/issues/143668
2025-07-20[clang-repl] Another try on system-z.Vassil Vassilev1-3/+0
This patch should make msan happy as it found a real bug where we always try to read an unsigned long long without respecting the underlying enum type. Another follow-up on llvm/llvm-project#102858
2025-07-19[clang-repl] Mark asan and systemz as unsupported for now.Vassil Vassilev1-0/+5
While waiting for the bot owners it seems that this is not a major issue due to the big endianness of the systemz platform. Instead it looks like we are not modelling something well for enum types. Probably `va_arg` has a bug for that platform or similar. The asan failure seems to be a crash in asan and maybe related to the issues we've mentioned in llvm/llvm-project#102858. This patch should appease the bots that were broken by llvm/llvm-project#148701
2025-07-19[clang-repl] Lay the basic infrastructure for pretty printing of types (#148701)Vassil Vassilev1-0/+20
The idea is to store a type-value pair in clang::Value which is updated by the interpreter runtime. The class copies builtin types and boxes non-builtin types to provide some lifetime control. The patch enables default printers for C and C++ using a very minimalistic approach. We handle enums, arrays and user types. Once we land this we can focus on enabling user-defined pretty-printers which take control over printing of types The work started as part of https://reviews.llvm.org/D146809, then we created a giant in https://github.com/llvm/llvm-project/pull/84769
2025-05-22Reapply "[clang] Remove intrusive reference count from `DiagnosticOptions` ↵Jan Svoboda1-6/+9
(#139584)" This reverts commit e2a885537f11f8d9ced1c80c2c90069ab5adeb1d. Build failures were fixed right away and reverting the original commit without the fixes breaks the build again.
2025-05-22Revert "[clang] Remove intrusive reference count from `DiagnosticOptions` ↵Kazu Hirata1-9/+6
(#139584)" This reverts commit 9e306ad4600c4d3392c194a8be88919ee758425c. Multiple builtbot failures have been reported: https://github.com/llvm/llvm-project/pull/139584
2025-05-22[clang] Remove intrusive reference count from `DiagnosticOptions` (#139584)Jan Svoboda1-6/+9
The `DiagnosticOptions` class is currently intrusively reference-counted, which makes reasoning about its lifetime very difficult in some cases. For example, `CompilerInvocation` owns the `DiagnosticOptions` instance (wrapped in `llvm::IntrusiveRefCntPtr`) and only exposes an accessor returning `DiagnosticOptions &`. One would think this gives `CompilerInvocation` exclusive ownership of the object, but that's not the case: ```c++ void shareOwnership(CompilerInvocation &CI) { llvm::IntrusiveRefCntPtr<DiagnosticOptions> CoOwner = &CI.getDiagnosticOptions(); // ... } ``` This is a perfectly valid pattern that is being actually used in the codebase. I would like to ensure the ownership of `DiagnosticOptions` by `CompilerInvocation` is guaranteed to be exclusive. This can be leveraged for a copy-on-write optimization later on. This PR changes usages of `DiagnosticOptions` across `clang`, `clang-tools-extra` and `lldb` to not be intrusively reference-counted.
2025-04-29[clang] Merge gtest binaries into AllClangUnitTests (#134196)Reid Kleckner2-2/+2
This reduces the size of the clang/unittests build directory by 64% and my overall build dir size by 5%. Static linking is the real driving factor here, but even if the default build configuration used shared libraries, I don't see why we should be building so many unit test binaries. To make the project more approachable for new contributors, I'm attempting to make the build a bit less resource-intensive. Build directory size is a common complaint, and this is low-hanging fruit. I've noticed that incremental builds leave behind the old, stale gtest binaries, and lit will keep running them. This mostly doesn't matter unless they use shared libraries, which will eventually stop working after successive builds. You can clean up the old test binaries with this command in the build directory: $ find tools/clang/unittests/ -iname '*Tests' -type f | xargs rm ... or you can simply clean the build directory in a more holistic way. --------- Co-authored-by: Petr Hosek <phosek@google.com>
2025-04-19[clang] llvm::append_range (NFC) (#136440)Kazu Hirata2-2/+2
2025-04-02Reapply "[cmake] Refactor clang unittest cmake" (#134195)Reid Kleckner2-24/+21
This reapplies 5ffd9bdb50b57 (#133545) with fixes. The BUILD_SHARED_LIBS=ON build was fixed by adding missing LLVM dependencies to the InterpTests binary in unittests/AST/ByteCode/CMakeLists.txt .
2025-04-01Revert "[cmake] Refactor clang unittest cmake" (#134022)dpalermo2-21/+24
Reverts llvm/llvm-project#133545 This change is breaking several buildbots as well as developer's builds. Reverting to allow people to make progress.
2025-04-01[cmake] Refactor clang unittest cmake (#133545)Reid Kleckner2-24/+21
Pass all the dependencies into add_clang_unittest. This is consistent with how it is done for LLDB. I borrowed the same named argument list structure from add_lldb_unittest. This is a necessary step towards consolidating unit tests into fewer binaries, but seems like a good refactoring in its own right.
2025-03-06[IR] Store Triple in Module (NFC) (#129868)Nikita Popov1-1/+1
The module currently stores the target triple as a string. This means that any code that wants to actually use the triple first has to instantiate a Triple, which is somewhat expensive. The change in #121652 caused a moderate compile-time regression due to this. While it would be easy enough to work around, I think that architecturally, it makes more sense to store the parsed Triple in the module, so that it can always be directly queried. For this change, I've opted not to add any magic conversions between std::string and Triple for backwards-compatibilty purses, and instead write out needed Triple()s or str()s explicitly. This is because I think a decent number of them should be changed to work on Triple as well, to avoid unnecessary conversions back and forth. The only interesting part in this patch is that the default triple is Triple("") instead of Triple() to preserve existing behavior. The former defaults to using the ELF object format instead of unknown object format. We should fix that as well.
2025-02-14[clang-repl] fix error recovery while parsing completely fails (#127087)Vipul Cariappa1-0/+7
Fixes the following crash in clang-repl ```c++ clang-repl> try { throw 1; } catch { 0; } In file included from <<< inputs >>>:1: input_line_1:1:23: error: expected '(' 1 | try { throw 1; } catch { 0; } | ^ | ( clang-repl: /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/AST/DeclBase.cpp:1757: void clang::DeclContext::addHiddenDecl(clang::Decl*): Assertion `D->getLexicalDeclContext() == this && "Decl inserted into wrong lexical context"' failed. #0 0x000059b28459e6da llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/llvm/lib/Support/Unix/Signals.inc:804:22 #1 0x000059b28459eaed PrintStackTraceSignalHandler(void*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/llvm/lib/Support/Unix/Signals.inc:880:1 #2 0x000059b28459bf7f llvm::sys::RunSignalHandlers() /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/llvm/lib/Support/Signals.cpp:105:20 #3 0x000059b28459df8e SignalHandler(int, siginfo_t*, void*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/llvm/lib/Support/Unix/Signals.inc:418:13 #4 0x000077cdf444ea50 (/usr/lib/libc.so.6+0x42a50) #5 0x000077cdf44aee3b pthread_kill (/usr/lib/libc.so.6+0xa2e3b) #6 0x000077cdf444e928 raise (/usr/lib/libc.so.6+0x42928) #7 0x000077cdf443156c abort (/usr/lib/libc.so.6+0x2556c) #8 0x000077cdf44314d2 __assert_perror_fail (/usr/lib/libc.so.6+0x254d2) #9 0x000077cdf4444c56 (/usr/lib/libc.so.6+0x38c56) #10 0x000059b28495bfc4 clang::DeclContext::addHiddenDecl(clang::Decl*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/AST/DeclBase.cpp:1759:3 #11 0x000059b28495c0f5 clang::DeclContext::addDecl(clang::Decl*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/AST/DeclBase.cpp:1785:37 #12 0x000059b28773cc2a clang::Sema::ActOnStartTopLevelStmtDecl(clang::Scope*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Sema/SemaDecl.cpp:20302:18 #13 0x000059b286f1efdf clang::Parser::ParseTopLevelStmtDecl() /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Parse/ParseDecl.cpp:6024:62 #14 0x000059b286ef18ee clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Parse/Parser.cpp:1065:35 #15 0x000059b286ef0702 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Parse/Parser.cpp:758:36 #16 0x000059b28562dff2 clang::IncrementalParser::ParseOrWrapTopLevelDecl() /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Interpreter/IncrementalParser.cpp:66:36 #17 0x000059b28562e5b7 clang::IncrementalParser::Parse(llvm::StringRef) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Interpreter/IncrementalParser.cpp:132:8 #18 0x000059b28561832b clang::Interpreter::Parse(llvm::StringRef) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Interpreter/Interpreter.cpp:570:8 #19 0x000059b285618cbd clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/lib/Interpreter/Interpreter.cpp:649:8 #20 0x000059b2836f9343 main /home/vipul-cariappa/Documents/Workspace/cpp-py/llvms/llvm-project-a/clang/tools/clang-repl/ClangRepl.cpp:255:59 #21 0x000077cdf443388e (/usr/lib/libc.so.6+0x2788e) #22 0x000077cdf443394a __libc_start_main (/usr/lib/libc.so.6+0x2794a) #23 0x000059b2836f7965 _start (./bin/clang-repl+0x73b8965) fish: Job 1, './bin/clang-repl' terminated by signal SIGABRT (Abort) ``` With this change: ```c++ clang-repl> try { throw 1; } catch { 0; } In file included from <<< inputs >>>:1: input_line_1:1:23: error: expected '(' 1 | try { throw 1; } catch { 0; } | ^ | ( error: Parsing failed. clang-repl> 1; clang-repl> %quit ```
2024-10-23[clang-repl][CMake][MSVC] Wrap /EXPORT linker option for ICX (#112867)Mészáros Gergely1-5/+2
The Intel C++ Compiler (ICX) passes linker flags through the driver unlike MSVC and clang-cl, and therefore needs them to be prefixed with `/Qoption,link` (the equivalent of -Wl, for gcc on *nix). Use the `LINKER:` prefix for the `/EXPORT:` options in clang-repl, this expands to the correct flag for ICX and nothing for MSVC / clang-cl. RFC: https://discourse.llvm.org/t/rfc-cmake-linker-flags-need-wl-equivalent-for-intel-c-icx-on-windows/82446
2024-10-02[Clang] Update Interpreter tests to use clang_target_link_libraries (#110154)Thomas Fransham1-2/+4
This will fix duplicate and missing linker symbol errors when using CLANG_LINK_CLANG_DYLIB on windows and explicit visibility macros are used. This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.
2024-09-27[clang] return first Decl for CanonicalDecl in TranslationUnitDecl (#110101)Vipul Cariappa1-0/+22
Return the first `Decl` when using `TranslationUnitDecl::getCanonicalDecl`
2024-09-23[clang-repl] Simplify the value printing logic to enable out-of-process. ↵Vassil Vassilev2-42/+24
(#107737) This patch improves the design of the IncrementalParser and Interpreter classes. Now the incremental parser is only responsible for building the partial translation unit declaration and the AST, while the Interpreter fills in the lower level llvm::Module and other JIT-related infrastructure. Finally the Interpreter class now orchestrates the AST and the LLVM IR with the IncrementalParser and IncrementalExecutor classes. The design improvement allows us to rework some of the logic that extracts an interpreter value into the clang::Value object. The new implementation simplifies use-cases which are used for out-of-process execution by allowing interpreter to be inherited or customized with an clang::ASTConsumer. This change will enable completing the pretty printing work which is in llvm/llvm-project#84769
2024-08-07Reapply "[CMake] Fold export_executable_symbols_* into function args. ↵Steven Wu2-4/+4
(#101741)" (#102138) Fix the builds with LLVM_TOOL_LLVM_DRIVER_BUILD enabled. LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES is not completely compatible with export_executable_symbols as the later will be ignored if the previous is set to NO. Fix the issue by passing if symbols need to be exported to llvm_add_exectuable so the link flag can be determined directly without calling export_executable_symbols_* later.
2024-08-06Revert "[CMake] Fold export_executable_symbols_* into function args. (#101741)"Steven Wu2-4/+4
This reverts commit 5c56b46a32a8856a022a54291bc9294068f7ddbd. This break lld build when using GENERATE_DRIVER.
2024-08-05[CMake] Fold export_executable_symbols_* into function args. (#101741)Steven Wu2-4/+4
`LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES` is not completely compatible with `export_executable_symbols` as the later will be ignored if the previous is set to NO. Fix the issue by passing if symbols need to be exported to `llvm_add_exectuable` so the link flag can be determined directly without calling `export_executable_symbols_*` later.
2024-07-03[clang-repl] Fix RuntimeInterfaceBuilder for 32-bit systems (#97071)Stefan Gränitz1-4/+0
When generating runtime interface bindings, extend integral types to the native register size rather than 64-bit per se Fixes #94994
2024-06-30[clang] Avoid 'raw_string_ostream::str' (NFC)Youngsuk Kim1-2/+2
Since `raw_string_ostream` doesn't own the string buffer, it is desirable (in terms of memory safety) for users to directly reference the string buffer rather than use `raw_string_ostream::str()`. Work towards TODO comment to remove `raw_string_ostream::str()`.
2024-06-14[clang-interp] Use -fno-sized-deallocation in two tests (#95546)Nico Weber1-1/+2
At least on my Windows machine, these two tests fail due to not being able to look up `??3@YAXPEAX_K@Z` (which is `void __cdecl operator delete(void *, unsigned __int64)` in demangled) after 130e93cc26ca. Since they don't test anything related to sized deallocation, just disable sized allocation for them. Possibly fixes #95451.
2024-06-10[clang][test] Update link for Arm clang-repl test disableDavid Spickett1-1/+1
The original bug is legitimate UB, but this is in the clang constant expression interpreter, not clang-repl. https://github.com/llvm/llvm-project/issues/94994 covers investigation of this specific bug in clang-repl.
2024-06-07[clang][test] Skip interpreter value test on Arm 32 bitDavid Spickett1-0/+4
https://github.com/llvm/llvm-project/pull/89811 caused this test to fail, somehow. I think it may not be at fault, but actually be exposing some existing undefined behaviour, see https://github.com/llvm/llvm-project/issues/94741. Skipping this for now to get the bots green again.
2024-05-30[clang-repl] Fix SetUp in CodeCompletionTest fixture (#93816)Stefan Gränitz5-27/+13
And sort out some unused headers
2024-05-30[clang-repl] Introduce common fixture class in unittests (NFC) (#93816)Stefan Gränitz5-295/+186
Reduce code bloat by checking test requirements in a common test fixture
2024-05-30[clang-repl] Even more tests create the Interpreter and must check host JIT ↵Stefan Gränitz2-5/+13
support 2 (#84758)
2024-05-28Fix build: [clang-repl] Even more tests create the Interpreter and must ↵Stefan Gränitz1-0/+8
check host JIT support (#84758) fea7399e97b73a3209fcbe3338d412069769a637 had removed the unused function that was still there when I tested.
2024-05-28[clang-repl] Even more tests create the Interpreter and must check host JIT ↵Stefan Gränitz2-0/+88
support (#84758)
2024-05-28[clang] Fix a warningKazu Hirata1-8/+0
This patch fixes: clang/unittests/Interpreter/IncrementalProcessingTest.cpp:39:13: error: unused function 'HostSupportsJit' [-Werror,-Wunused-function]
2024-05-28[clang-repl] Check host JIT support in all tests that create an Interpreter ↵Stefan Gränitz3-31/+82
(#84758)
2024-05-28[clang-repl] Set up executor implicitly to account for init PTUs (#84758)Stefan Gränitz1-88/+24
Until now the IncrExecutor was created lazily on the first execution request. In order to process the PTUs that come from initialization, we have to do it upfront implicitly.
2024-05-22Reland "[clang] Enable sized deallocation by default in C++14 onwards" (#90373)Pengcheng Wang1-0/+43
Since C++14 has been released for about nine years and most standard libraries have implemented sized deallocation functions, it's time to make this feature default again. This is another try of https://reviews.llvm.org/D112921. The original commit cf5a8b4 was reverted by 2e5035a due to some failures (see #83774). Fixes #60061
2024-05-02Triple::normalize: Use none as OS for XX-none-ABI (#89638)YunQiang Su1-1/+1
When parsing a 3-component triple, after we determine Arch and Env, if the middle component is "none", treat it as OS instead of Vendor. See: https://discourse.llvm.org/t/rfc-baremetal-target-triple-normalization/78524 Fixes: #89582.
2024-04-26Revert "[clang] Enable sized deallocation by default in C++14 onwards ↵Vitaly Buka1-59/+0
(#83774)" (#90299) https://lab.llvm.org/buildbot/#/builders/168/builds/20063 (should be fixed with #90292) More details in #83774 This reverts commit cf5a8b489464d09dfdd7a48ce7c8b41d3c9bf819.
2024-04-26[clang] Enable sized deallocation by default in C++14 onwards (#83774)Pengcheng Wang1-0/+59
Since C++14 has been released for about nine years and most standard libraries have implemented sized deallocation functions, it's time to make this feature default again. This is another try of https://reviews.llvm.org/D112921. Fixes #60061
2024-04-08[zOS] Turn CLANG_INTERPRETER_PLATFORM_CANNOT_CREATE_LLJIT on for zOS (#87797)bahareh-farhadi1-1/+1
PR [https://github.com/llvm/llvm-project/pull/84461](https://github.com/llvm/llvm-project/pull/84461) disabled `clang/unittests/Interpreter/InterpreterExtensionsTest.cpp` for AIX by turning on `CLANG_INTERPRETER_PLATFORM_CANNOT_CREATE_LLJIT`. This PR turns `CLANG_INTERPRETER_PLATFORM_CANNOT_CREATE_LLJIT` on for zOS as well, since LLJIT cannot be created on zOS either. Co-authored-by: Bahareh <bahareh.farhadi@ibm.com>
2024-03-25Fix build with shared librariesKrzysztof Parzyszek1-0/+1
/usr/bin/ld: CMakeFiles/ClangReplInterpreterTests.dir/InterpreterExtensi onsTest.cpp.o: undefined reference to symbol '_ZN4llvm14TargetRegistry12 lookupTargetENS_9StringRefERNSt7__cxx1112basic_stringIcSt11char_traitsIc ESaIcEEE' /usr/bin/ld: /work/kparzysz/git/llvm.org/b/x86/lib/libLLVMMC.so.19.0git: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status The missing symbol is `llvm::TargetRegistry::lookupTarget`, which interestingly enough is in MC. Add `MC` to the list of LLVM dependencies.
2024-03-25[clang-repl] Skip cross-JIT tests if specified target is not available (#84461)Stefan Gränitz1-6/+22
2024-03-25[clang-repl] Factor out CreateJITBuilder() and allow specialization in ↵Stefan Gränitz1-2/+119
derived classes (#84461) The LLJITBuilder interface provides a very convenient way to configure the ORCv2 JIT engine. IncrementalExecutor already used it internally to construct the JIT, but didn't provide external access. This patch lifts control of the creation process to the Interpreter and allows injection of a custom instance through the extended interface. The Interpreter's default behavior remains unchanged and the IncrementalExecutor remains an implementation detail.
2024-03-25[clang-repl] Fix Value for platforms where unqualified char is unsigned (#86118)Stefan Gränitz1-0/+6
Signedness of unqualified `char` is unspecified and varies between platforms. This patch adds `Char_U` in `REPL_BUILTIN_TYPES` to account for platforms that default to `unsigned char`.
2024-03-13[ClangRepl] Add missing hashtagJake Egan1-1/+1
Hashtag missing from commit 960b4aa6dab69125778f230c4c94f2d19c96cc87