[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,45 @@ +//===-- OutOfProcessJITConfig.h - Struct for Out-Of-Process JIT--*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -19,21 +19,32 @@ #include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Interpreter/CodeCompletion.h" #include "clang/Interpreter/Interpreter.h" +#include "clang/Interpreter/OutOfProcessJITConfig.h" #include "clang/Lex/Preprocessor.h" #include "clang/Sema/Sema.h"

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -460,10 +464,99 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +llvm::ExitOnError ExitOnErr; + +std::unique_ptr +Interpreter::outOfProcessJITBuilder(OutOfProcessJITConfig OutOfPr

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -33,6 +33,10 @@ using namespace llvm; using namespace llvm::orc; +#if LLVM_ON_UNIX +static std::vector LaunchedExecutorPID; vgvassilev wrote: We need a home for this. The process is not the right home. Either the Interpreter class or the IncrementalExecut

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -55,6 +57,8 @@ #include "llvm/TargetParser/Host.h" #include "llvm/Transforms/Utils/Cloning.h" // for CloneModule +#include vgvassilev wrote: We probably do not need this include. https://github.com/llvm/llvm-project/pull/155140 __

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -275,10 +331,10 @@ int main(int argc, const char **argv) { if (!CudaPath.empty()) CB.SetCudaSDK(CudaPath); -if (OffloadArch.empty()) { - OffloadArch = "sm_35"; +if (::OffloadArch.empty()) { + ::OffloadArch = "sm_35"; } -CB.SetOffloadArch

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -460,10 +464,99 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +llvm::ExitOnError ExitOnErr; + +std::unique_ptr +Interpreter::outOfProcessJITBuilder(OutOfProcessJITConfig OutOfPr

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,45 @@ +//===-- OutOfProcessJITConfig.h - Struct for Out-Of-Process JIT--*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-28 Thread Vassil Vassilev via cfe-commits
@@ -333,11 +317,10 @@ int main(int argc, const char **argv) { auto CudaRuntimeLibPath = CudaPath + "/lib/libcudart.so"; ExitOnErr(Interp->LoadDynamicLibrary(CudaRuntimeLibPath.c_str())); } - } else if (JB) { -Interp = -ExitOnErr(clang::Interpreter::

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-26 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,183 @@ +//===- unittests/Interpreter/OutOfProcessInterpreterTest.cpp --- Interpreter +// tests when Out-of-Process ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license informati

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-25 Thread Vassil Vassilev via cfe-commits
@@ -33,6 +33,10 @@ using namespace llvm; using namespace llvm::orc; +#if LLVM_ON_UNIX +static std::vector LaunchedExecutorPID; vgvassilev wrote: That should be a member of the Interpreter class I think. https://github.com/llvm/llvm-project/pull/155140 __

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-25 Thread Vassil Vassilev via cfe-commits
@@ -117,21 +128,11 @@ static llvm::Error sanitizeOopArguments(const char *ArgV0) { // Out-of-process executors require the ORC runtime. if (OrcRuntimePath.empty() && (OOPExecutor.getNumOccurrences() || OOPExecutorConnect.getNumOccurrences()

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-25 Thread Vassil Vassilev via cfe-commits
@@ -275,10 +331,10 @@ int main(int argc, const char **argv) { if (!CudaPath.empty()) CB.SetCudaSDK(CudaPath); -if (OffloadArch.empty()) { - OffloadArch = "sm_35"; +if (::OffloadArch.empty()) { + ::OffloadArch = "sm_35"; } -CB.SetOffloadArch

[clang] [Clang-Repl] Add Lambda Support, PID Retrieval, and Dynamic liborc_rt Path in Clang-Repl (PR #155140)

2025-08-25 Thread Vassil Vassilev via cfe-commits
@@ -81,6 +99,40 @@ static llvm::cl::opt OptHostSupportsJit("host-supports-jit", static llvm::cl::list OptInputs(llvm::cl::Positional, llvm::cl::desc("[code to run]")); +static std::string getCompilerRTPath() { + clang::DiagnosticO

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/154158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-21 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,143 @@ +// RUN: rm -rf %t vgvassilev wrote: I agree with that assessment. Let's move forward then. https://github.com/llvm/llvm-project/pull/154158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-20 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,143 @@ +// RUN: rm -rf %t vgvassilev wrote: I'd start from something like: ```cpp typedef int (*ifn)(); struct F { operator ifn(); }; int main() { int i1 = 0; ifn pfn = i1 ? F() : main; } ``` That would get us into the branch we added. I looked

[clang] [clang-repl] Delegate CodeGen related operations for PTU to IncrementalParser (PR #137458)

2025-08-20 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: It seems like the direction is reasonable. Could you update the PR description and the commit message to capture the intent of this PR? https://github.com/llvm/llvm-project/pull/137458 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [clang-repl] Address error recovery fixing infinite loop while parsing (PR #127569)

2025-08-20 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > This happens because the while loop is running only taking `eof` into account > and not `annot_repl_input_end` which is specific to clang-repl i'd assume > hence it never terminates. > > I need to add tests for the same. But that being said here is something > concern

[clang] [clang-repl] Fix InstantiateTemplate & Value test while building against emscripten (PR #154513)

2025-08-20 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/154513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,143 @@ +// RUN: rm -rf %t vgvassilev wrote: I was suggesting to use the tests in either `overload-decl.cpp` or `conditional-expr.cpp` to get us into the `ICS1.isUserDefined()` branch and then play with the canonical decls to trigger the issue outside

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Vassil Vassilev via cfe-commits
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S, SourceLocation Loc, Result = CompareStandardConversionSequences(S, Loc, ICS1.Standard, ICS2.Standard); else if (ICS1.isUserDefined()) { +auto ConvFunc1

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Vassil Vassilev via cfe-commits
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S, SourceLocation Loc, Result = CompareStandardConversionSequences(S, Loc, ICS1.Standard, ICS2.Standard); else if (ICS1.isUserDefined()) { +auto ConvFunc1

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,143 @@ +// RUN: rm -rf %t vgvassilev wrote: This test looks scary. Is there any chance at taking some inspiration from `clang/test/SemaCXX/overload-decl.cpp` which is supposed to test the surroundings of this code? 0d1da2298aaa8 also seems to have so

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Vassil Vassilev via cfe-commits
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S, SourceLocation Loc, Result = CompareStandardConversionSequences(S, Loc, ICS1.Standard, ICS2.Standard); else if (ICS1.isUserDefined()) { +auto ConvFunc1

[clang] [clang-repl] Remove invalid TopLevelStmtDecl from TU on parse failure (PR #153945)

2025-08-18 Thread Vassil Vassilev via cfe-commits
@@ -91,6 +93,53 @@ TEST_F(InterpreterTest, IncrementalInputTopLevelDecls) { EXPECT_EQ("var2", DeclToString(*R2DeclRange.begin())); } +TEST_F(InterpreterTest, BadIncludeDoesNotCorruptTU) { vgvassilev wrote: Can you try to `.undo` a `TopLevelStmtDecl` instead

[clang] [clang-repl] Remove invalid TopLevelStmtDecl from TU on parse failure (PR #153945)

2025-08-18 Thread Vassil Vassilev via cfe-commits
@@ -5696,8 +5696,11 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() { TopLevelStmtDecl *TLSD = Actions.ActOnStartTopLevelStmtDecl(getCurScope()); StmtResult R = ParseStatementOrDeclaration(Stmts, SubStmtCtx); Actions.ActOnFinishTopLevelStmtDecl(TLSD, R.get()); -

[clang] [clang-repl] Remove invalid TopLevelStmtDecl from TU on parse failure (PR #153945)

2025-08-16 Thread Vassil Vassilev via cfe-commits
@@ -91,6 +93,53 @@ TEST_F(InterpreterTest, IncrementalInputTopLevelDecls) { EXPECT_EQ("var2", DeclToString(*R2DeclRange.begin())); } +TEST_F(InterpreterTest, BadIncludeDoesNotCorruptTU) { vgvassilev wrote: Can we extend either `clang/test/Interpreter/execut

[clang] [clang-repl] Remove invalid TopLevelStmtDecl from TU on parse failure (PR #153945)

2025-08-16 Thread Vassil Vassilev via cfe-commits
@@ -5696,8 +5696,11 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() { TopLevelStmtDecl *TLSD = Actions.ActOnStartTopLevelStmtDecl(getCurScope()); StmtResult R = ParseStatementOrDeclaration(Stmts, SubStmtCtx); Actions.ActOnFinishTopLevelStmtDecl(TLSD, R.get()); -

[clang] [llvm] Enable running ClangReplInterpreterTests in an Emscripten environment (PR #150977)

2025-08-13 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. This looks like a reasonable incremental improvement to me. Thank you @mcbarton! https://github.com/llvm/llvm-project/pull/150977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [Clang-Repl] Adds custom lambda in launchExecutor and PID retrieval (PR #152562)

2025-08-08 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @kr-2003, we can probably disable the test for Solaris. https://github.com/llvm/llvm-project/pull/152562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang-Repl] Adds custom lambda in launchExecutor and PID retrieval (PR #152562)

2025-08-07 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/152562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang-Repl] Adds custom lambda in launchExecutor and PID retrieval (PR #152562)

2025-08-07 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/152562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-06 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Can you update the commit message to reflect the final changes? https://github.com/llvm/llvm-project/pull/147478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-06 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/147478 >From 79849c3ba76ebf66fd7856fa92cd98af56ac49a6 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Tue, 1 Jul 2025 18:55:21 +0530 Subject: [PATCH 01/16] pipes for redirection in oop jit --- .../clang/Interpreter/R

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-05 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/147478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] add %help, documentation, and tests for %commands (PR #150348)

2025-08-05 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! Probably more changes to the documentation is required but that's a good step! Thank you! https://github.com/llvm/llvm-project/pull/150348 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [clang-repl] add %help, documentation, and tests for %commands (PR #150348)

2025-08-05 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Please update the PR description to reflect the current changes. > > @vgvassilev what do you think of this? Quite nice piece of work. Than you both for doing this! > > Only question I have is whether there's a special way to print non-error > output, or whether stdout is

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-03 Thread Vassil Vassilev via cfe-commits
@@ -51,31 +51,23 @@ class InterpreterRemoteTest : public InterpreterTestBase { using Args = std::vector; +void removeFilename(int count, llvm::SmallString<256> &Path) { vgvassilev wrote: ```suggestion static void removePathComponent(unsigned N, llvm::SmallSt

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-03 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,160 @@ +//===- unittests/Interpreter/OutOfProcessInterpreterTest.cpp --- Interpreter +// tests when Out-of-Process ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license informati

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-03 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,160 @@ +//===- unittests/Interpreter/OutOfProcessInterpreterTest.cpp --- Interpreter +// tests when Out-of-Process ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license informati

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-03 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,160 @@ +//===- unittests/Interpreter/OutOfProcessInterpreterTest.cpp --- Interpreter +// tests when Out-of-Process ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license informati

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-01 Thread Vassil Vassilev via cfe-commits
@@ -26,6 +27,20 @@ add_distinct_clang_unittest(ClangReplInterpreterTests TargetParser ) +if(TARGET compiler-rt) + list(APPEND CLANG_REPL_TEST_SOURCES +OutOfProcessInterpreterTests.cpp + ) + add_dependencies(ClangReplInterpreterTests +llvm-jitlink-executor +

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-01 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,164 @@ +//===- unittests/Interpreter/OutOfProcessInterpreterTest.cpp --- Interpreter +// tests when Out-of-Process ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license informati

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-08-01 Thread Vassil Vassilev via cfe-commits
@@ -26,6 +27,20 @@ add_distinct_clang_unittest(ClangReplInterpreterTests TargetParser ) +if(TARGET compiler-rt) + list(APPEND CLANG_REPL_TEST_SOURCES +OutOfProcessInterpreterTests.cpp + ) + add_dependencies(ClangReplInterpreterTests +llvm-jitlink-executor +

[clang] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-07-31 Thread Vassil Vassilev via cfe-commits
@@ -26,6 +26,13 @@ add_distinct_clang_unittest(ClangReplInterpreterTests TargetParser ) +if(NOT WIN32) + add_dependencies(ClangReplInterpreterTests +llvm-jitlink-executor +compiler-rt vgvassilev wrote: Clang does not depend on compiler-rt by defa

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-28 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > Hi @ChuanqiXu9, could you please clarify the request to "update the mail"? > > I've double-checked that the commit author is currently set to my email, > > and I can't see any github autogenerated email addresses on the commit > > metdata. > > I want to make sure I unders

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-25 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: I'd wait to hear from @hahnjo before merging. Should not take too long. https://github.com/llvm/llvm-project/pull/150430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [Interp] Mark the test unsupported with Asan (PR #150242)

2025-07-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/150242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/150215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! @devajithvs, do you have commit access or should I merge? https://github.com/llvm/llvm-project/pull/150215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-23 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Here is the error I got on my local machine. (I use the latest commit on the > master so I could be a different PR that cause the buildbot fail) > > ``` > TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED > > Exit Code: 1 > Comman

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
@@ -18,4 +18,12 @@ extern "C" int printf(const char *, ...); int i = 42; auto r1 = printf("i = %d\n", i); // CHECK: i = 42 + +1aap = 42; // expected-error {{invalid digit 'a' in decimal constant}} +1aap = 42; i = 5; +// expected-error {{intended to fail the -verify test but not

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
@@ -18,4 +18,12 @@ extern "C" int printf(const char *, ...); int i = 42; auto r1 = printf("i = %d\n", i); // CHECK: i = 42 + +1aap = 42; // expected-error {{intended to fail the -verify test}} vgvassilev wrote: Can we spell out the actual diagnostic here? htt

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-23 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > So maybe there's a lifetime issue somewhere? Could be, but I wonder why valgrind does not detect it... https://github.com/llvm/llvm-project/pull/148701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-23 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Apologies, trying to reproduce it locally now. @qinkunbao, I am stuck reproducing this locally. My platform is ubuntu 22, x86x64: ``` cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER="Memory" -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=host -GNinja ~/works

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Apologies, trying to reproduce it locally now. https://github.com/llvm/llvm-project/pull/148701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Improve error message on failed undos (PR #149396)

2025-07-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. Lgtm! Thank you @aadanen! https://github.com/llvm/llvm-project/pull/149396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-07-20 Thread Vassil Vassilev via cfe-commits
@@ -68,6 +165,18 @@ TEST_F(InterpreterTest, Sanity) { EXPECT_EQ(1U, DeclsSize(R2.TUPart)); } +TEST_F(InterpreterTest, SanityWithRemoteExecution) { vgvassilev wrote: That probably will need to follow the what was done in `InterpreterExtensionsTest.cpp` wher

[clang] 6163b66 - [clang-repl] Another try on system-z.

2025-07-20 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2025-07-20T08:23:47Z New Revision: 6163b66e0aa7a3fa32b05fa4e1016d0631c20451 URL: https://github.com/llvm/llvm-project/commit/6163b66e0aa7a3fa32b05fa4e1016d0631c20451 DIFF: https://github.com/llvm/llvm-project/commit/6163b66e0aa7a3fa32b05fa4e1016d0631c20451.diff LO

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: https://github.com/llvm/llvm-project/commit/0a463bd43e626695b7221b0cf20cdaa5970cfe98 should bring piece in the galaxy. However, I am puzzled by the system-z (s390) -- it is a big endian -- it is a good test bed for the conformance for low-level primitives such as `clang::Val

[clang] 0a463bd - [clang-repl] Mark asan and systemz as unsupported for now.

2025-07-19 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2025-07-19T17:45:56Z New Revision: 0a463bd43e626695b7221b0cf20cdaa5970cfe98 URL: https://github.com/llvm/llvm-project/commit/0a463bd43e626695b7221b0cf20cdaa5970cfe98 DIFF: https://github.com/llvm/llvm-project/commit/0a463bd43e626695b7221b0cf20cdaa5970cfe98.diff LO

[clang] 50408ee - Revert "[clang-repl] Spell out the enum types to appease some bots."

2025-07-19 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2025-07-19T14:31:19Z New Revision: 50408eeff6020061ceb6685448e214f36c75f71b URL: https://github.com/llvm/llvm-project/commit/50408eeff6020061ceb6685448e214f36c75f71b DIFF: https://github.com/llvm/llvm-project/commit/50408eeff6020061ceb6685448e214f36c75f71b.diff LO

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: I added a fix for the system-z, however, I believe I still a maintainer to confirm this is not a big-endian related issue. I realize I do not understand the sanitizer failures. I ran the tests with valgrind and it seems happy with it. @vitalybuka what should I do here? https

[clang] 193de1a - [clang-repl] Spell out the enum types to appease some bots.

2025-07-19 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2025-07-19T11:28:26Z New Revision: 193de1a566aa5a10a6f63f6f7c7fca2e52a7d75b URL: https://github.com/llvm/llvm-project/commit/193de1a566aa5a10a6f63f6f7c7fca2e52a7d75b DIFF: https://github.com/llvm/llvm-project/commit/193de1a566aa5a10a6f63f6f7c7fca2e52a7d75b.diff LO

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Working on understanding the issues... https://github.com/llvm/llvm-project/pull/148701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/148701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 01/10] [clang-repl] Lay the basic infrastructure for pretty

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \ +// RUN:'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s +// UNSUPPORTED: system-aix +// CHECK-DRIVER: i = 10 +// RUN: cat %s | clang-repl -Xcc

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
@@ -3,9 +3,80 @@ // RUN: cat %s | clang-repl -Xcc -xc | FileCheck %s // RUN: cat %s | clang-repl -Xcc -std=c++11 | FileCheck %s -// Fails with `Symbols not found: [ __clang_Interpreter_SetValueNoAlloc ]`. // UNSUPPORTED: hwasan + +char c = 'a'; c +// CHECK: (char) 'a' + c

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 01/10] [clang-repl] Lay the basic infrastructure for pretty

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
@@ -300,16 +640,17 @@ llvm::Expected Interpreter::ExtractValueFromExpr(Expr *E) { using namespace clang; // Temporary rvalue struct that need special care. -REPL_EXTERNAL_VISIBILITY void * +REPL_EXTERNAL_VISIBILITY extern "C" void * vgvassilev wrote: I resol

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
@@ -3,9 +3,80 @@ // RUN: cat %s | clang-repl -Xcc -xc | FileCheck %s // RUN: cat %s | clang-repl -Xcc -std=c++11 | FileCheck %s -// Fails with `Symbols not found: [ __clang_Interpreter_SetValueNoAlloc ]`. // UNSUPPORTED: hwasan + +char c = 'a'; c +// CHECK: (char) 'a' + c

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \ +// RUN:'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s +// UNSUPPORTED: system-aix +// CHECK-DRIVER: i = 10 +// RUN: cat %s | clang-repl -Xcc

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/9] [clang-repl] Lay the basic infrastructure for pretty p

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-18 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/8] [clang-repl] Lay the basic infrastructure for pretty p

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-17 Thread Vassil Vassilev via cfe-commits
@@ -300,16 +640,17 @@ llvm::Expected Interpreter::ExtractValueFromExpr(Expr *E) { using namespace clang; // Temporary rvalue struct that need special care. -REPL_EXTERNAL_VISIBILITY void * +REPL_EXTERNAL_VISIBILITY extern "C" void * vgvassilev wrote: Exactly

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-16 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/7] [clang-repl] Lay the basic infrastructure for pretty p

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-16 Thread Vassil Vassilev via cfe-commits
@@ -300,16 +640,17 @@ llvm::Expected Interpreter::ExtractValueFromExpr(Expr *E) { using namespace clang; // Temporary rvalue struct that need special care. -REPL_EXTERNAL_VISIBILITY void * +REPL_EXTERNAL_VISIBILITY extern "C" void * vgvassilev wrote: @AaronB

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-16 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \ +// RUN:'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s +// UNSUPPORTED: system-aix +// CHECK-DRIVER: i = 10 +// RUN: cat %s | clang-repl -Xcc

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-16 Thread Vassil Vassilev via cfe-commits
@@ -3,9 +3,80 @@ // RUN: cat %s | clang-repl -Xcc -xc | FileCheck %s // RUN: cat %s | clang-repl -Xcc -std=c++11 | FileCheck %s -// Fails with `Symbols not found: [ __clang_Interpreter_SetValueNoAlloc ]`. // UNSUPPORTED: hwasan + +char c = 'a'; c +// CHECK: (char) 'a' + c

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
@@ -250,17 +254,35 @@ const ASTContext &Value::getASTContext() const { return getInterpreter().getASTContext(); } -void Value::dump() const { print(llvm::outs()); } +void Value::dump() { print(llvm::outs()); } void Value::printType(llvm::raw_ostream &Out) const { - Out <

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
@@ -416,6 +416,8 @@ Interpreter::Interpreter(std::unique_ptr Instance, return; } } + + ValuePrintingInfo.resize(4); vgvassilev wrote: It was a `std::vector` of a predefined elements. I removed this by switching to a `std::array`. Good catch!

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
@@ -18,18 +18,341 @@ #include "clang/Frontend/CompilerInstance.h" #include "clang/Interpreter/Interpreter.h" #include "clang/Interpreter/Value.h" +#include "clang/Lex/Preprocessor.h" #include "clang/Sema/Lookup.h" #include "clang/Sema/Sema.h" #include "llvm/Support/Error.h

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
@@ -119,9 +119,9 @@ class REPL_EXTERNAL_VISIBILITY Value { ~Value(); void printType(llvm::raw_ostream &Out) const; - void printData(llvm::raw_ostream &Out) const; - void print(llvm::raw_ostream &Out) const; - void dump() const; + void printData(llvm::raw_ostream &Out);

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/3] [clang-repl] Lay the basic infrastructure for pretty p

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/148701 >From 114e4ec4194afa865bd22f6d76b29200d231bef9 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/2] [clang-repl] Lay the basic infrastructure for pretty p

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-14 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/148701 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 ena

[clang] [llvm] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-07-11 Thread Vassil Vassilev via cfe-commits
@@ -91,7 +95,8 @@ createSharedMemoryManager(SimpleRemoteEPC &SREPC, Expected> launchExecutor(StringRef ExecutablePath, bool UseSharedMemory, - llvm::StringRef SlabAllocateSizeString) { + llvm::StringRef SlabAllocateSizeString, + std::f

[clang] [llvm] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-07-09 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: We will probably need a test in clang/unittest/Interpreter https://github.com/llvm/llvm-project/pull/147478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang-Repl] Add custom function as lambda in launchExecutor and fetch PID of launched executor (PR #147478)

2025-07-09 Thread Vassil Vassilev via cfe-commits
@@ -23,10 +23,19 @@ #include #include #include +#ifdef LLVM_ON_UNIX +#include +#else +// Windows/MSVC fallback +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 +#endif vgvassilev wrote: Do we need all of these now? https://github.

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-07-04 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > I don't think we should merge a partial state of this PR for two reasons: 1. > The three patches alone don't actually bring much benefit. When I measured in > ROOT, we definitely needed the (currently) problematic one for lazy template > loading to become really effective.

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-07-03 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > I'm not so sure it's about conversion function templates in particular: if > > it's really commit > > [658d55b](https://github.com/llvm/llvm-project/commit/658d55ba1117a029f37f51a3072585a1fd9fc59f) > > causing the problem (@emaxx-google if you happen to have some time, it

[clang] [llvm] Add __attribute__((visibility("default"))) attribute to certain symbols to stop them being hidden when linking clangInterpreter library to other libraries during Emscripten build (PR #1

2025-07-03 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Can’t we solve this with a linker script provided externally when building llvm? https://github.com/llvm/llvm-project/pull/146786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang] Handle consteval constructors with default initialization. (PR #144970)

2025-06-29 Thread Vassil Vassilev via cfe-commits
@@ -14458,6 +14461,9 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) { } CheckCompleteVariableDeclaration(Var); + +if (getLangOpts().CPlusPlus) + ActOnCXXExitDeclInitializer(nullptr, Var); vgvassilev wrote: ```suggestion ActOnCXXEx

[clang] [clang] Handle consteval constructors with default initialization. (PR #144970)

2025-06-29 Thread Vassil Vassilev via cfe-commits
@@ -14423,6 +14423,9 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) { Var->getType().getAddressSpace() == LangAS::hlsl_input) return; +if (getLangOpts().CPlusPlus) + ActOnCXXEnterDeclInitializer(nullptr, Var); vgvassilev wrote: ``

[clang] [clang] Handle consteval constructors with default initialization. (PR #144970)

2025-06-29 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev commented: LGTM! https://github.com/llvm/llvm-project/pull/144970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Handle consteval constructors with default initialization. (PR #144970)

2025-06-29 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev edited https://github.com/llvm/llvm-project/pull/144970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [REAPPLY][Clang-Repl] Add support for out-of-process execution. #110418 (PR #144064)

2025-06-27 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/144064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [REAPPLY][Clang-Repl] Add support for out-of-process execution. #110418 (PR #144064)

2025-06-27 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/144064 >From 05943c9542cd89ae672ddc0f14514e0c7b1e0bd7 Mon Sep 17 00:00:00 2001 From: SahilPatidar Date: Tue, 3 Dec 2024 15:07:56 +0530 Subject: [PATCH 1/6] Re-Land: [Clang-Repl] Add support for out-of-process execu

  1   2   3   4   5   6   7   8   9   10   >