[clang] [clang-repl] Disable out of process JIT tests on non-unix platforms (PR #159404)

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

[clang] [clang-repl] Teach clang-repl how to load PCHs (reprise) (PR #157359)

2025-09-19 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! @AaronBallman, I'd appreciate if you take a look before we land this. https://github.com/llvm/llvm-project/pull/157359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang-repl] Teach clang-repl how to load PCHs (reprise) (PR #157359)

2025-09-16 Thread Vassil Vassilev via cfe-commits
@@ -240,10 +238,11 @@ void BackendConsumer::HandleTranslationUnit(ASTContext &C) { Gen->HandleTranslationUnit(C); -if (TimerIsEnabled && !--LLVMIRGenerationRefCount) - LLVMIRGeneration.yieldTo(CI.getFrontendTimer()); - -IRGenFinished = true;

[clang] [compiler-rt] [clang-repl] Reimplement value printing using MemoryAccess to support in-process and out-of-process (PR #156649)

2025-09-14 Thread Vassil Vassilev via cfe-commits
@@ -32,8 +32,11 @@ #ifndef LLVM_CLANG_INTERPRETER_VALUE_H #define LLVM_CLANG_INTERPRETER_VALUE_H - +#include "llvm/ADT/FunctionExtras.h" #include "llvm/Config/llvm-config.h" // for LLVM_BUILD_LLVM_DYLIB, LLVM_BUILD_SHARED_LIBS +#include "llvm/ExecutionEngine/Orc/LLJIT.h" +#i

[clang] [clang-repl] Add support for running custom code in Remote JIT executor (PR #157358)

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

[clang] [clang-repl] Add support for running custom code in Remote JIT executor (PR #157358)

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

[clang] Allow for custom code model in clang::Interpreter (PR #156977)

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

[clang] Allow for custom code model in clang::Interpreter (PR #156977)

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

[clang] Allow for custom code model in clang::Interpreter (PR #156977)

2025-09-12 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > Is there any reasonable way to test this? > > Nothing great came to mind, for testing this in isolation. > > One effect it could have is to solve issues like #102858, but that requires > exposing this through a `clang-repl` flag and then tackling any other > ASan-related

[clang] [clang-repl] Teach clang-repl how to load PCHs (reprise) (PR #157359)

2025-09-09 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > I've scoured the latest Linux/Windows build+test logs and the failures in > there have seemingly nothing to do with this PR. Based on comparing these > results with other recently opened PRs, it's unclear to me if these are > consistent. @vgvassilev do you know? Probably s

[clang] [clang-repl] Add support for running custom code in Remote JIT executor (PR #157358)

2025-09-08 Thread Vassil Vassilev via cfe-commits
@@ -135,11 +135,13 @@ class Interpreter { std::string OrcRuntimePath = ""; /// PID of the out-of-process JIT executor. uint32_t ExecutorPID = 0; +/// Custom lambda to be executed inside child process/executor +std::function CustomizeFork = nullptr; -

[clang] [clang-repl] Add support for running custom code in Remote JIT executor (PR #157358)

2025-09-08 Thread Vassil Vassilev via cfe-commits
@@ -135,11 +135,13 @@ class Interpreter { std::string OrcRuntimePath = ""; /// PID of the out-of-process JIT executor. uint32_t ExecutorPID = 0; +/// Custom lambda to be executed inside child process/executor +std::function CustomizeFork = nullptr; -

[clang] [clang-repl] Sink RemoteJITUtils into Interpreter class (NFC) (PR #155140)

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

[clang] [clang-repl] Sink RemoteJITUtils into Interpreter class (NFC) (PR #155140)

2025-09-07 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! Thank you for the patience. https://github.com/llvm/llvm-project/pull/155140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-06 Thread Vassil Vassilev via cfe-commits
@@ -533,11 +655,19 @@ llvm::Error Interpreter::CreateExecutor() { } llvm::Error Err = llvm::Error::success(); + + // Fix: Declare Executor as the appropriate unique_ptr type + std::unique_ptr Executor; + #ifdef __EMSCRIPTEN__ - auto Executor = std::make_unique(*TSCtx);

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-06 Thread Vassil Vassilev via cfe-commits
@@ -29,13 +29,18 @@ set(CLANG_LIBS_TO_LINK ) endif() -add_distinct_clang_unittest(ClangReplInterpreterTests +set(CLANG_REPL_TEST_SOURCES IncrementalCompilerBuilderTest.cpp IncrementalProcessingTest.cpp InterpreterTest.cpp InterpreterExtensionsTest.cpp CodeComp

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-06 Thread Vassil Vassilev via cfe-commits
@@ -347,20 +348,116 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +llvm::Expected, uint32_t>> +Interpreter::outOfProcessJITBuilder(JITConfig Config) { + std::unique_ptr EPC; + ui

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-06 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] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-06 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; +/// Path

[clang] [compiler-rt] [clang-repl] Reimplement value printing using MemoryAccess to support in-process and out-of-process (PR #156649)

2025-09-06 Thread Vassil Vassilev via cfe-commits
@@ -267,92 +267,156 @@ std::string Interpreter::ValueDataToString(const Value &V) const { return "{ error: unknown builtin type '" + std::to_string(BT->getKind()) + " '}"; case clang::BuiltinType::Bool: - SS << ((V.getBool()) ? "true" : "false"); -

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-05 Thread Vassil Vassilev via cfe-commits
@@ -347,20 +348,110 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +llvm::Expected, uint32_t>> +Interpreter::outOfProcessJITBuilder(JITConfig Config) { + std::unique_ptr EPC; + ui

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-04 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; +/// Path

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-04 Thread Vassil Vassilev via cfe-commits
@@ -521,6 +618,23 @@ llvm::Error Interpreter::CreateExecutor() { return llvm::make_error("Operation failed. " "No code generator available", std::error_code()); +#ifndef _WIN32 ---

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-03 Thread Vassil Vassilev via cfe-commits
@@ -62,8 +76,23 @@ class IncrementalExecutor { llvm::orc::LLJIT &GetExecutionEngine() { return *Jit; } +#ifndef _WIN32 + pid_t getOutOfProcessChildPid() const { return OutOfProcessChildPid; } +#endif vgvassilev wrote: ```suggestion pid_t getOutOfProcess

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-03 Thread Vassil Vassilev via cfe-commits
@@ -535,9 +659,14 @@ llvm::Error Interpreter::CreateExecutor() { llvm::Error Err = llvm::Error::success(); #ifdef __EMSCRIPTEN__ auto Executor = std::make_unique(*TSCtx); +#else +#ifndef _WIN32 vgvassilev wrote: We don't need a special branch -- we just ne

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-03 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; +/// Path

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-03 Thread Vassil Vassilev via cfe-commits
@@ -15,20 +15,39 @@ #include "clang/Basic/TargetInfo.h" #include "clang/Basic/TargetOptions.h" #include "clang/Interpreter/PartialTranslationUnit.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/Orc/Compil

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -51,6 +60,11 @@ class IncrementalExecutor { IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, llvm::orc::LLJITBuilder &JITBuilder, llvm::Error &Err); +#ifndef _WIN32 + IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, +

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -444,6 +543,14 @@ size_t Interpreter::getEffectivePTUSize() const { return PTUs.size() - InitPTUSize; } +#ifndef _WIN32 +pid_t Interpreter::getOutOfProcessExecutorPID() const { + if (IncrExecutor) +return IncrExecutor->getOutOfProcessChildPid(); + return -1; +} +#en

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -15,6 +15,7 @@ #define LLVM_CLANG_INTERPRETER_INTERPRETER_H #include "clang/AST/GlobalDecl.h" +#include "clang/Driver/ToolChain.h" vgvassilev wrote: We can forward declare the `driver::Toolchain` and remove this include. https://github.com/llvm/llvm-proje

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -68,6 +87,23 @@ IncrementalExecutor::IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, } } +#ifndef _WIN32 +IncrementalExecutor::IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, + llvm::orc::LLJITBuilder &JITBuilder, +

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { vgvassilev wrote: ```suggestion struct JITConfig { ``` https://github.com/llvm/llvm-pro

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -170,6 +200,10 @@ class Interpreter { llvm::Expected getSymbolAddressFromLinkerName(llvm::StringRef LinkerName) const; +#ifndef _WIN32 + pid_t getOutOfProcessExecutorPID() const; +#endif vgvassilev wrote: ```suggestion pid_t getOutOfProcessExecutorP

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; --

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -39,6 +45,9 @@ class IncrementalExecutor { using CtorDtorIterator = llvm::orc::CtorDtorIterator; std::unique_ptr Jit; llvm::orc::ThreadSafeContext &TSCtx; +#ifndef _WIN32 + pid_t OutOfProcessChildPid = -1; +#endif vgvassilev wrote: ```suggestion pi

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; +/// Path

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -512,7 +619,7 @@ Interpreter::createLLJITBuilder( return std::move(*JB); } -llvm::Error Interpreter::CreateExecutor() { +llvm::Error Interpreter::CreateExecutor(OutOfProcessJITConfig OOPConfig) { vgvassilev wrote: ```suggestion llvm::Error Interpreter::C

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; +/// Path

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -347,20 +348,118 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +#ifndef _WIN32 vgvassilev wrote: Likewise. https://github.com/llvm/llvm-project/pull/155140 __

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -115,31 +116,60 @@ class Interpreter { /// An optional compiler instance for CUDA offloading std::unique_ptr DeviceCI; +public: + struct OutOfProcessJITConfig { +/// Indicates whether out-of-process JIT execution is enabled. +bool IsOutOfProcess; +/// Path

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -118,4 +154,244 @@ IncrementalExecutor::getSymbolAddress(llvm::StringRef Name, return SymOrErr->getAddress(); } +Expected getSlabAllocSize(StringRef SizeString) { + SizeString = SizeString.trim(); + + uint64_t Units = 1024; + + if (SizeString.ends_with_insensitive("kb

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -62,8 +76,23 @@ class IncrementalExecutor { llvm::orc::LLJIT &GetExecutionEngine() { return *Jit; } +#ifndef _WIN32 + pid_t getOutOfProcessChildPid() const { return OutOfProcessChildPid; } +#endif + static llvm::Expected> createDefaultJITBuilder(llvm::orc::JITTarg

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -347,20 +348,118 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +#ifndef _WIN32 +llvm::Expected, pid_t>> +Interpreter::outOfProcessJITBuilder(OutOfProcessJITConfig OutOfProcessCo

[clang] [Clang-Repl] Sinking RemoteJITUtils into Interpreter class(Refactoring) (PR #155140)

2025-09-02 Thread Vassil Vassilev via cfe-commits
@@ -347,20 +348,118 @@ const char *const Runtimes = R"( EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...); )"; +#ifndef _WIN32 +llvm::Expected, pid_t>> +Interpreter::outOfProcessJITBuilder(OutOfProcessJITConfig OutOfProcessCo

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

2025-08-31 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
@@ -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/

  1   2   3   4   5   6   7   8   9   10   >