@@ -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
@@ -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"
@@ -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
@@ -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
@@ -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
__
@@ -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
@@ -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
@@ -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
@@ -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::
@@ -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
@@ -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
__
@@ -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()
@@ -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
@@ -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
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
@@ -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
@@ -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
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
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
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
@@ -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
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S,
SourceLocation Loc,
Result = CompareStandardConversionSequences(S, Loc,
ICS1.Standard, ICS2.Standard);
else if (ICS1.isUserDefined()) {
+auto ConvFunc1
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S,
SourceLocation Loc,
Result = CompareStandardConversionSequences(S, Loc,
ICS1.Standard, ICS2.Standard);
else if (ICS1.isUserDefined()) {
+auto ConvFunc1
@@ -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
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S,
SourceLocation Loc,
Result = CompareStandardConversionSequences(S, Loc,
ICS1.Standard, ICS2.Standard);
else if (ICS1.isUserDefined()) {
+auto ConvFunc1
@@ -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
@@ -5696,8 +5696,11 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() {
TopLevelStmtDecl *TLSD = Actions.ActOnStartTopLevelStmtDecl(getCurScope());
StmtResult R = ParseStatementOrDeclaration(Stmts, SubStmtCtx);
Actions.ActOnFinishTopLevelStmtDecl(TLSD, R.get());
-
@@ -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
@@ -5696,8 +5696,11 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() {
TopLevelStmtDecl *TLSD = Actions.ActOnStartTopLevelStmtDecl(getCurScope());
StmtResult R = ParseStatementOrDeclaration(Stmts, SubStmtCtx);
Actions.ActOnFinishTopLevelStmtDecl(TLSD, R.get());
-
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://
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
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
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
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
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
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
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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
+
@@ -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
@@ -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
+
@@ -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
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
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
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
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
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
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
@@ -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
@@ -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
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/
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
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
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
@@ -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
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
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
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
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
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
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
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
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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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 <
@@ -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!
@@ -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
@@ -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);
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
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
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
@@ -91,7 +95,8 @@ createSharedMemoryManager(SimpleRemoteEPC &SREPC,
Expected>
launchExecutor(StringRef ExecutablePath, bool UseSharedMemory,
- llvm::StringRef SlabAllocateSizeString) {
+ llvm::StringRef SlabAllocateSizeString,
+ std::f
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
@@ -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.
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.
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
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/
@@ -14458,6 +14461,9 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) {
}
CheckCompleteVariableDeclaration(Var);
+
+if (getLangOpts().CPlusPlus)
+ ActOnCXXExitDeclInitializer(nullptr, Var);
vgvassilev wrote:
```suggestion
ActOnCXXEx
@@ -14423,6 +14423,9 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) {
Var->getType().getAddressSpace() == LangAS::hlsl_input)
return;
+if (getLangOpts().CPlusPlus)
+ ActOnCXXEnterDeclInitializer(nullptr, Var);
vgvassilev wrote:
``
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
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
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
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 - 100 of 1062 matches
Mail list logo