[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-05 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > @AaronBallman, to be fair, clang is testing the wasm features in terms of > > output. So this is wiring up a bunch of tested features that will allow > > execution. Clang generally does not test execution but output, so we are > > not creating a precedent here since that

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-05 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @AaronBallman, to be fair, clang is testing the wasm features in terms of output. So this is wiring up a bunch of tested features that will allow execution. Clang generally does not test execution but output, so we are not creating a precedent here since that PR can be consid

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-05 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: That would make sense. I am not sure if we can set a post commit bot though. @argentite what do you think? https://github.com/llvm/llvm-project/pull/86402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-05 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Hi @AaronBallman, we need some leadership here. This pull request teaches clang-repl to work inside a browser. It enables webassembly [xeus-cpp](https://github.com/compiler-research/xeus-cpp) (through clang-repl) which connects to the JupyterLite infrastructure. This change

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-05 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/86402 >From e1e3b1ec07133fb67b4f98c6696e330fdedf2460 Mon Sep 17 00:00:00 2001 From: Anubhab Ghosh Date: Sat, 23 Mar 2024 15:13:57 + Subject: [PATCH] [clang-repl] Support wasm execution. This commit introduces s

[clang] [clang-tools-extra] [libcxx] Reland "[clang] Enable sized deallocation by default in C++14 onwards" (PR #90373)

2024-06-05 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: It seems we have troubles with exporting the right symbols on windows. I am cc-ing @compnerd and @fsfod for more expertise. https://github.com/llvm/llvm-project/pull/90373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-06-04 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89811 >From 3094e6026925ebcba6da86dd16111f4f70f9a700 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 19:33:00 + Subject: [PATCH] [clang-repl] Lay the foundation of pretty printing for C. -

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-06-04 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @jasonmolenda, I struggled quite a bit in reproducing the test failures and everything but I have a fix. Thanks a lot for your time and I hope the fix works! https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing li

[clang] d999ce0 - Reland "[clang-repl] Extend the C support. (#89804)"

2024-06-04 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2024-06-04T13:55:03Z New Revision: d999ce0302f06d250f6d496b56a5a5f2dc331e61 URL: https://github.com/llvm/llvm-project/commit/d999ce0302f06d250f6d496b56a5a5f2dc331e61 DIFF: https://github.com/llvm/llvm-project/commit/d999ce0302f06d250f6d496b56a5a5f2dc331e61.diff LO

[clang] [clang-repl] Teach clang-repl how to load PCHs. (PR #94166)

2024-06-03 Thread Vassil Vassilev via cfe-commits
@@ -138,6 +138,8 @@ namespace { assert(!M && "Replacing existing Module?"); M.reset(new llvm::Module(ExpandModuleName(ModuleName, CodeGenOpts), C)); + IRGenFinished = false; vgvassilev wrote: It's a double negation: it is /not/ finished when

[clang] [clang-repl] Teach clang-repl how to load PCHs. (PR #94166)

2024-06-03 Thread Vassil Vassilev via cfe-commits
@@ -282,6 +288,8 @@ namespace { } void HandleTranslationUnit(ASTContext &Ctx) override { + IRGenFinished = true; vgvassilev wrote: Good point. I guess I was avoiding this early return which I have now removed. In fact this change fixed some of t

[clang] [clang-repl] Teach clang-repl how to load PCHs. (PR #94166)

2024-06-03 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/94166 >From 896f3090ca2eadf650459caee9a4106fc7dd381d Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Thu, 30 May 2024 05:05:41 + Subject: [PATCH 1/2] [clang-repl] Teach clang-repl how to load PCHs. --- cl

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-02 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/86402 >From 6b94e0cd67e59a7fcde2a327d6565a3850dc5f50 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Thu, 30 May 2024 05:08:17 + Subject: [PATCH 1/2] Revert "Revert "[clang-repl] Extend the C support. (#89

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-02 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/86402 >From 4434ceeef152b95998ebd0a3b09a56d105490c4d Mon Sep 17 00:00:00 2001 From: Anubhab Ghosh Date: Sat, 23 Mar 2024 15:13:57 + Subject: [PATCH 1/3] [clang-repl] Support wasm execution. This commit introduc

[clang] [clang-repl] Teach clang-repl how to load PCHs. (PR #94166)

2024-06-02 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,14 @@ +// REQUIRES: host-supports-jit +// UNSUPPORTED: system-aix + +// RUN: rm -f %t.pch +// RUN: %clang_cc1 -fmax-type-align=16 -pic-level 2 -fdeprecated-macro -stack-protector 1 -fblocks -fskip-odr-check-in-gmf -fexceptions -fcxx-exceptions -fgnuc-version=0 -triple

[clang] [clang-repl] Teach clang-repl how to load PCHs. (PR #94166)

2024-06-02 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/94166 None >From 896f3090ca2eadf650459caee9a4106fc7dd381d Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Thu, 30 May 2024 05:05:41 + Subject: [PATCH] [clang-repl] Teach clang-repl how to load PCHs. ---

[clang] [clang-repl] Test explicit emission of dtors in runtime interface builder (NFC) (PR #89734)

2024-05-30 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: We generally have to put a switch for the late parsed templates. We have it in some other tests. https://github.com/llvm/llvm-project/pull/89734 ___

[clang] [clang-repl] Introduce common fixture class in unittests (NFC) (PR #93816)

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

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-30 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: > > Looks like you already implemented it. Nice. > > Well, it's gonna be a bit more churn. Eventually, it will reduce coverage for > the incremental features in the

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-29 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: vgvassilev wrote: Looks like you already implemented it. Nice. https://github.com/llvm/llvm-project/pull/84758 ___ cfe-commi

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-29 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @mysterymath, @jasonmolenda, ping -- I am still stuck in reproducing this issue. https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-29 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: Can we create some text fixture that will do that automatically for us and reduce this copy-paste? https://github.com/llvm/llvm-project/pull/84758 _

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-28 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: I am not sure how this patch changed these tests to start failing on Windows. Do you have any clue? https://github.com/llvm/llvm-project/pull/84758

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-28 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: vgvassilev wrote: What do you mean? https://github.com/llvm/llvm-project/pull/84758 ___ cfe-commits mailing list cfe-commits

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-25 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84758 >From 917e4e0e07c5a312543732d6101742e709a6b429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-25 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: vgvassilev wrote: @weliveindetail, I was wondering what's the fate of this patch? https://github.com/llvm/llvm-project/pull/84758 __

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Just found out this keeps popping up from my notification, and I would like > give my 2 cents, maybe can provide some insights: > > Looking at the backtrace of the failing tests, I noticed we ran into > `clang::Parser::ParseTopLevelStmtDecl()` which makes me very confused.

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > fwiw if you have access to a mac, I don't think it's hard to build > lldb+clang? I have swig, cmake, and ninja installed on my mac via homebrew. > > ``` > lldb/scripts/macos-setup-codesign.sh > > mkdir build > cd build > cmake ../llvm -G Ninja -DLLDB_ENABLE_SWIFT_SUPPORT=0

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Ok, maybe I can you test this patch for a temporary fix until we figure out what's going wrong. ```diff diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 7f6921ea22be..d771a060f305 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > I was able to verify that the revert fixed the tests at least. I am pretty sure that the failure ha to do with the incremental processing if-stmt in SemaDecl. I can provide a fix that does not trigger this for lldb but that would be a workaround. I suspect that change uncov

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > @jasonmolenda, I am stuck. I could not find how the bot configures llvm and > > lldb. I built lldb and ran `make check-lldb` but did not fail in the same > > way. Can you provide a recipe to reproduce the failure? > > For some reason it only fails on our Mac LLDB builders

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @jasonmolenda, I am stuck. I could not find how the bot configures llvm and lldb. I built lldb and ran `make check-lldb` but did not fail in the same way. Can you provide a recipe to reproduce the failure? https://github.com/llvm/llvm-project/pull/89804 _

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > I reverted in > > ``` > commit dfdf1c5fe45a82b9c578306f3d7627fd251d63f8 > Author: Jason Molenda > Date: Tue May 21 18:00:11 2024 -0700 > > Revert "[clang-repl] Extend the C support. (#89804)" > > This reverts commit 253c28fa829cee0104c2fc59ed1a958980b5138c. >

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > LGTM, feel free to apply my suggestion if you like it. Applied it. Thanks for the review this unblock whole bunch of work for us.. https://github.com/llvm/llvm-project/pull/89811 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
@@ -269,7 +267,10 @@ const char *const Runtimes = R"( void __clang_Interpreter_SetValueCopyArr(const T (*Src)[N], void* Placement, unsigned long Size) { __clang_Interpreter_SetValueCopyArr(Src[0], Placement, Size); } +extern "C" vgvassilev wr

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89811 >From 0ff8aca868bfd78d4bcfd31f299e253e83c150a2 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 19:33:00 + Subject: [PATCH] [clang-repl] Lay the foundation of pretty printing for C. -

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Generally looks good, but it seems that some parts of this PR are also > incorporated into another PR, so it's a bit hard to review. Rebased, should be only the commit in question now, as the other one landed. https://github.com/llvm/llvm-project/pull/89811

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
@@ -42,6 +42,9 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include "llvm/TargetParser/Host.h" + +#include vgvassilev wrote: Fixed. https://github.com/llvm/llvm-project/pull/89811 _

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89811 >From 3e922935bc551dd5c3f76dae22a94318d0abd210 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 19:33:00 + Subject: [PATCH] [clang-repl] Lay the foundation of pretty printing for C. -

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-05-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89811 >From 4a73cd3c3daca1cb1856a8e175dc9cb531ca Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 19:33:00 + Subject: [PATCH] [clang-repl] Lay the foundation of pretty printing for C. -

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: The failures on windows are due to "out of heap" error. Let's land this to test on the "real" bots. https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-21 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +auto *ND = dyn_cast(D); +if (!ND) + continue; +// Check if we

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89804 >From 0621608c575d9e4f7da5b08db143dbe88a45745a Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 18:07:06 + Subject: [PATCH] [clang-repl] Extend the C support. The IdResolver chain is

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: The bots fail on windows due to `TEST 'Clang :: CoverageMapping/mcdc-system-headers.cpp' FAILED` which does not seem related to this PR. https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89804 >From 7acf367f2bd36409bcbb7443451ec83188ab589d Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 18:07:06 + Subject: [PATCH] [clang-repl] Extend the C support. The IdResolver chain is

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
@@ -2282,7 +2282,8 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { // Remove this name from our lexical scope, and warn on it if we haven't // already. -IdResolver.RemoveDecl(D); +if (!PP.isIncrementalProcessingEnabled()) + IdResolver.RemoveDec

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89804 >From 72d655c919ae29f83f1a39db2a63aa5468fb52cc Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 18:07:06 + Subject: [PATCH] [clang-repl] Extend the C support. The IdResolver chain is

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the IdR

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the IdR

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-20 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the IdR

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-19 Thread Vassil Vassilev via cfe-commits
@@ -2282,7 +2282,8 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { // Remove this name from our lexical scope, and warn on it if we haven't // already. -IdResolver.RemoveDecl(D); +if (!PP.isIncrementalProcessingEnabled()) + IdResolver.RemoveDec

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-19 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the IdR

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-19 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the IdR

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-05-10 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @AaronBallman, can you take a look at that patch, hopefully to move forward as seems the other reviewers are busy. https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-04-25 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: The pre-merge windows test failure in `Clang :: Driver/amdgpu-toolchain.c` seems unrelated to this PR. https://github.com/llvm/llvm-project/pull/89804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-04-24 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89804 >From 50fa9c91bee980a114ebab2b3301a1e378dd2b81 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 18:07:06 + Subject: [PATCH] [clang-repl] Extend the C support. The IdResolver chain is

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-04-24 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89804 >From 8317ce33d07d0986e314de0b39aa977f784e0619 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 18:07:06 + Subject: [PATCH] [clang-repl] Extend the C support. The IdResolver chain is

[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

2024-04-24 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/89879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

2024-04-24 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: The Unix pre-merge seems okay, however the windows pre-merge check is doing nothing for more than 12h. I will move forward. https://github.com/llvm/llvm-project/pull/89879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

2024-04-24 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89879 >From 49b47988e852003e2257b9f537c6c9738033fe9e Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Wed, 24 Apr 2024 06:30:55 + Subject: [PATCH] [clang-repl] Fix the process return code if diagnostics occ

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-04-24 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,21 @@ +// REQUIRES: host-supports-jit +// UNSUPPORTED: system-aix + +// RUN: cat %s | clang-repl -Xcc -xc -Xcc -Xclang -Xcc -verify | FileCheck %s +// RUN: cat %s | clang-repl -Xcc -xc -Xcc -O2 -Xcc -Xclang -Xcc -verify| FileCheck %s +int printf(const char *, ...); +in

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-04-24 Thread Vassil Vassilev via cfe-commits
@@ -407,6 +406,16 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } + + // FIXME: We should de-allocate MostRecentTU + for (Decl *D : MostRecentTU->decls()) { +if (!isa(D)) + continue; +// Check if we need to clean up the IdR

[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

2024-04-24 Thread Vassil Vassilev via cfe-commits
@@ -241,18 +243,13 @@ int main(int argc, const char **argv) { break; } if (Input == R"(%undo)") { -if (auto Err = Interp->Undo()) { +if (auto Err = Interp->Undo()) llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: "

[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

2024-04-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89879 >From d6b3d2a7b93399f8e895118e9f43378a2efa21f1 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Wed, 24 Apr 2024 06:30:55 + Subject: [PATCH] [clang-repl] Fix the process return code if diagnostics occ

[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

2024-04-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/89879 Should fix the failure seen in the pre-merge infrastructure of #89804. >From 066029973ac937f3a810bd4aefaed8c8f6e0af51 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Wed, 24 Apr 2024 06:30:55 + Subje

[clang] [clang-repl] Lay the foundation of pretty printing for C. (PR #89811)

2024-04-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/89811 Depends on #89804. >From 8317ce33d07d0986e314de0b39aa977f784e0619 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 23 Apr 2024 18:07:06 + Subject: [PATCH 1/2] [clang-repl] Extend the C support.

[clang] [clang-repl] Extend the C support. (PR #89804)

2024-04-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/89804 The IdResolver chain is the main way for C to implement lookup rules. Every new partial translation unit caused clang to exit the top-most scope which in turn cleaned up the IdResolver chain. That was not an

[clang] [clang-repl] Test explicit emission of dtors in runtime interface builder (NFC) (PR #89734)

2024-04-23 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/89734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang-repl] Test explicit emission of dtors in runtime interface builder (NFC) (PR #89734)

2024-04-23 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,13 @@ +// UNSUPPORTED: system-aix + +// RUN: cat %s | clang-repl | FileCheck %s +int *x = new int(); +template struct GuardX { T *&x; GuardX(T *&x) : x(x) {}; ~GuardX(); }; +template GuardX::~GuardX() { delete x; x = nullptr; } + +// clang would normally defer codege

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-22 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: I am fine changing it in any way that creates an executor as part of the initialization phase when we have codegen. Maybe we can do it in the builder class and then pass it to the interpreter?

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-22 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: For me it is high priority because without it I cannot land the pch support in clang repl. I believe that’s also somewhat important for your use case? https://github.com/llvm/llvm-project/pull/84758 ___

[clang] [clang-repl] Implement value printing of custom types (PR #84769)

2024-04-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84769 >From a1639ef21a6085f12383e815ce2ed31976f78cfa Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/2] [clang-repl] Implement value printing of custom types.

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-20 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84758 >From 2fc401486c4c637829dceb534e2d2ec205448ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Sun, 10 Mar 2024 18:17:48 +0100 Subj

[clang] a3f07d3 - Reland "[clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (#89031)"

2024-04-20 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2024-04-20T18:55:56Z New Revision: a3f07d36cbc9e3a0d004609d140474c1d8a25bb6 URL: https://github.com/llvm/llvm-project/commit/a3f07d36cbc9e3a0d004609d140474c1d8a25bb6 DIFF: https://github.com/llvm/llvm-project/commit/a3f07d36cbc9e3a0d004609d140474c1d8a25bb6.diff LO

[clang] adc4f62 - Revert "[clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (#89031)"

2024-04-20 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2024-04-20T18:26:59Z New Revision: adc4f6233df734fbe3793118ecc89d3584e0c90f URL: https://github.com/llvm/llvm-project/commit/adc4f6233df734fbe3793118ecc89d3584e0c90f DIFF: https://github.com/llvm/llvm-project/commit/adc4f6233df734fbe3793118ecc89d3584e0c90f.diff LO

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-20 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84758 >From 969ff9856fd5e039afd6d1987a1bf44a9d6900ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Sun, 10 Mar 2024 18:17:48 +0100 Subj

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

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

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-20 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Looks like the windows builders have been dead since a day or two... https://github.com/llvm/llvm-project/pull/89031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-20 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89031 >From 751a3da878733ed4731d6d73c8c7de88033da92a Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 19 Apr 2024 07:51:17 + Subject: [PATCH] [clang-repl] Keep the first llvm::Module empty to avoid inv

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > If there's a trivial reproducer for the original issue it may be worth adding > it as a regression test. It is manifested in https://github.com/llvm/llvm-project/pull/84758 which has a test. That PR will unblock the other one which will make the test more explicit by chang

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
@@ -364,6 +365,19 @@ IncrementalParser::Parse(llvm::StringRef input) { std::unique_ptr IncrementalParser::GenModule() { static unsigned ID = 0; if (CodeGenerator *CG = getCodeGen()) { +// Clang's CodeGen is designed to work with a single llvm::Module. In many +// ca

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89031 >From 3c9698f033c2349e698a5c98f227bfee8499e5b4 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 19 Apr 2024 07:51:17 + Subject: [PATCH] [clang-repl] Keep the first llvm::Module empty to avoid inv

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
@@ -224,11 +228,8 @@ IncrementalParser::IncrementalParser(Interpreter &Interp, return; // PTU.takeError(); } - if (CodeGenerator *CG = getCodeGen()) { -std::unique_ptr M(CG->ReleaseModule()); -CG->StartModule("incr_module_" + std::to_string(P

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: After an offline discussion with @lhames, we have a more simplified approach which should consume less memory. Now we just keep the first llvm::Module empty and make sure it's used only for read-only purposes such as computing the llvm::DataLayout out of it in CodeGen. https

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev edited https://github.com/llvm/llvm-project/pull/89031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev edited https://github.com/llvm/llvm-project/pull/89031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-19 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89031 >From e5aae5f7b945f1f6da58453f03dafdb86c90 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 19 Apr 2024 07:51:17 + Subject: [PATCH] [clang-repl] Keep the first llvm::Module empty to avoid inv

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/88600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/88600 >From 9b2bb9068cbefcfffd0931fbbee46b1a0f536a4f Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sat, 13 Apr 2024 06:39:34 + Subject: [PATCH 1/2] Fix the double space and double attribute printing of th

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-17 Thread Vassil Vassilev via cfe-commits
@@ -275,13 +278,15 @@ void DeclPrinter::prettyPrintAttributes(const Decl *D, if (Pos != AttrPosAsWritten::Left) Out << ' '; A->printPretty(Out, Policy); + hasPrinted = true; if (Pos == AttrPosAsWritten::Left) Out

[clang] [clang-repl] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev edited https://github.com/llvm/llvm-project/pull/89031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/89031 >From d396330fd004db50b3808e491cb45847888bb651 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Wed, 17 Apr 2024 07:12:40 + Subject: [PATCH] [clang-repl] Clone the llvm::Modules to avoid invalid memory

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-17 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: @@ -14,7 +14,7 @@ struct A { int a; A(int a) : a(a) {} virtual ~A(); }; // PartialTranslationUnit. inline A::~A() { printf("~A(%d)\n", a); } -// Create one instance with new and delete it. +// Create one instance with

[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
@@ -73,7 +74,15 @@ llvm::Error IncrementalExecutor::addModule(PartialTranslationUnit &PTU) { Jit->getMainJITDylib().createResourceTracker(); ResourceTrackers[&PTU] = RT; - return Jit->addIRModule(RT, {std::move(PTU.TheModule), TSCtx}); vgvassilev wro

[clang] [clang-rel] Clone the llvm::Modules to avoid invalid memory access. (PR #89031)

2024-04-17 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/89031 Clang's CodeGen is designed to work with a single llvm::Module. In many cases for convenience various CodeGen parts have a reference to the llvm::Module (TheModule or Module) which does not change when a new

[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

2024-04-15 Thread Vassil Vassilev via cfe-commits
@@ -252,16 +252,19 @@ static DeclPrinter::AttrPosAsWritten getPosAsWritten(const Attr *A, return DeclPrinter::AttrPosAsWritten::Right; } -void DeclPrinter::prettyPrintAttributes(const Decl *D, +// returns true if an attribute was printed. +bool DeclPrinter::prettyPrintAttri

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-15 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: @@ -14,7 +14,7 @@ struct A { int a; A(int a) : a(a) {} virtual ~A(); }; // PartialTranslationUnit. inline A::~A() { printf("~A(%d)\n", a); } -// Create one instance with new and delete it. +// Create one instance with

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-13 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -14,7 +14,7 @@ struct A { int a; A(int a) : a(a) {} virtual ~A(); }; // PartialTranslationUnit. inline A::~A() { printf("~A(%d)\n", a); } -// Create one instance with new and delete it. +// Create one instance with new

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-04-13 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/84758 >From f28fc3aa917b24063707f99dd6545512630f48e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Sun, 10 Mar 2024 18:17:48 +0100 Subj

<    1   2   3   4   5   6   7   8   9   >