[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] 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
@@ -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
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
@@ -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
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-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-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 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] 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] 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] 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] [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] [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-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] 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] 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] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-07-27 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Hi @AaronBallman, could we move that forward? https://github.com/llvm/llvm-project/pull/98138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-17 Thread Vassil Vassilev via cfe-commits
@@ -905,6 +912,7 @@ void Preprocessor::Lex(Token &Result) { // This token is injected to represent the translation of '#include "a.h"' // into "import a.h;". Mimic the notional ';'. case tok::annot_module_include: +case tok::annot_repl_input_end: ---

[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] 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] 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] 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] 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-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] 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] 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] 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] 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 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] 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] 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-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] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-07-09 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/98138 In incremental compilation clang works with multiple `llvm::Module`s. Our current approach is to create a CodeGenModule entity for every new module request (via StartModule). However, some of the state such a

[clang] [clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-07-09 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/98138 >From a8cdff404d81a677f696280d765b4b1c398b66ce Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 9 Jul 2024 09:30:19 + Subject: [PATCH] [clang-repl] [codegen] Reduce the state in TBAA. NFC for sta

[clang] [clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-07-09 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/98138 >From 734f8d80a92a957efbcbf3755b2dd35383745ddf Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 9 Jul 2024 09:30:19 + Subject: [PATCH] [clang-repl] [codegen] Reduce the state in TBAA. NFC for sta

[clang] [clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-07-09 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Would it be possible to add a test case? Good point. Forgot to `git add` it. > Could you add a bit more detail how different mange contexts cause crashes in > TBAA? On a high level clang's CodeGen is designed to work with a single llvm::Module. However, incremental compi

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

2024-07-12 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/94166 >From d2d533d0962e4260f052179c199a2e5ebe44edb1 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] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-12 Thread Vassil Vassilev via cfe-commits
@@ -905,6 +912,7 @@ void Preprocessor::Lex(Token &Result) { // This token is injected to represent the translation of '#include "a.h"' // into "import a.h;". Mimic the notional ';'. case tok::annot_module_include: +case tok::annot_repl_input_end: ---

[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-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-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-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-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
@@ -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 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
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 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-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-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
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] 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] 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
@@ -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
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
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
@@ -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
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] 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] 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-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-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: 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: > 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: > 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] 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] 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] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

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

[clang] [clang] Remove dead incremental Parser code (PR #102450)

2024-08-08 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Your reasoning sounds right to me. Can we make sure we are not breaking `clang -fincremental-extensions`, too? https://github.com/llvm/llvm-project/pull/102450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [clang] Remove dead incremental Parser code (PR #102450)

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

[clang] 8518742 - Fix type printing of array template args

2021-05-01 Thread Vassil Vassilev via cfe-commits
Author: Pratyush Das Date: 2021-05-01T18:50:09Z New Revision: 8518742104ab075296722ef6151f65aee7a0646d URL: https://github.com/llvm/llvm-project/commit/8518742104ab075296722ef6151f65aee7a0646d DIFF: https://github.com/llvm/llvm-project/commit/8518742104ab075296722ef6151f65aee7a0646d.diff LOG:

[clang] 0cb7e7c - Make iteration over the DeclContext::lookup_result safe.

2021-03-17 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-03-17T08:59:04Z New Revision: 0cb7e7ca0c864e052bf49978f3bcd667c9e16930 URL: https://github.com/llvm/llvm-project/commit/0cb7e7ca0c864e052bf49978f3bcd667c9e16930 DIFF: https://github.com/llvm/llvm-project/commit/0cb7e7ca0c864e052bf49978f3bcd667c9e16930.diff LO

[clang] 02eb8e2 - Inform the consumer on invalid template instantiations.

2021-01-05 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-01-05T09:43:38Z New Revision: 02eb8e20b51b3ea263bbfe696241b8541c72ee7a URL: https://github.com/llvm/llvm-project/commit/02eb8e20b51b3ea263bbfe696241b8541c72ee7a DIFF: https://github.com/llvm/llvm-project/commit/02eb8e20b51b3ea263bbfe696241b8541c72ee7a.diff LO

[clang] 1dba6b3 - Reland "[clang-repl] Re-implement clang-interpreter as a test case."

2021-10-07 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-10-08T06:04:39Z New Revision: 1dba6b37bdc70210f75a480eff3715ebe1f1d8be URL: https://github.com/llvm/llvm-project/commit/1dba6b37bdc70210f75a480eff3715ebe1f1d8be DIFF: https://github.com/llvm/llvm-project/commit/1dba6b37bdc70210f75a480eff3715ebe1f1d8be.diff LO

[clang] c9948e9 - [clang-repl] Install clang-repl

2021-08-31 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-08-31T15:20:15Z New Revision: c9948e9254fbb6ea00f66c7b4542311d21e060be URL: https://github.com/llvm/llvm-project/commit/c9948e9254fbb6ea00f66c7b4542311d21e060be DIFF: https://github.com/llvm/llvm-project/commit/c9948e9254fbb6ea00f66c7b4542311d21e060be.diff LO

[clang] 319ce98 - [clang-repl] Re-implement clang-interpreter as a test case.

2021-08-31 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-09-01T05:23:21Z New Revision: 319ce98011742141dad8dd95a2f9de9c0449be5c URL: https://github.com/llvm/llvm-project/commit/319ce98011742141dad8dd95a2f9de9c0449be5c DIFF: https://github.com/llvm/llvm-project/commit/319ce98011742141dad8dd95a2f9de9c0449be5c.diff LO

[clang] 04bbd18 - Revert "[clang-repl] Re-implement clang-interpreter as a test case."

2021-08-31 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-09-01T06:49:52Z New Revision: 04bbd189a9b964db8713c507d500a87af3f67a79 URL: https://github.com/llvm/llvm-project/commit/04bbd189a9b964db8713c507d500a87af3f67a79 DIFF: https://github.com/llvm/llvm-project/commit/04bbd189a9b964db8713c507d500a87af3f67a79.diff LO

[clang] f0514a4 - Reland "[clang-repl] Re-implement clang-interpreter as a test case."

2021-09-01 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-09-01T10:21:38Z New Revision: f0514a4d26100239088f08d618f2ba100f59958e URL: https://github.com/llvm/llvm-project/commit/f0514a4d26100239088f08d618f2ba100f59958e DIFF: https://github.com/llvm/llvm-project/commit/f0514a4d26100239088f08d618f2ba100f59958e.diff LO

[clang] 6fe2beb - Reland "[clang-repl] Re-implement clang-interpreter as a test case."

2021-09-03 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-09-03T12:02:58Z New Revision: 6fe2beba7d2a41964af658c8c59dd172683ef739 URL: https://github.com/llvm/llvm-project/commit/6fe2beba7d2a41964af658c8c59dd172683ef739 DIFF: https://github.com/llvm/llvm-project/commit/6fe2beba7d2a41964af658c8c59dd172683ef739.diff LO

[clang] 8859640 - Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case.""

2021-09-03 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-09-03T13:18:09Z New Revision: 8859640461149065ece1fbcdfed78f17f04a4926 URL: https://github.com/llvm/llvm-project/commit/8859640461149065ece1fbcdfed78f17f04a4926 DIFF: https://github.com/llvm/llvm-project/commit/8859640461149065ece1fbcdfed78f17f04a4926.diff LO

[clang] [clang-repl] Fix printing preprocessed tokens and macros (PR #104964)

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

[clang] [clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-08-20 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/98138 >From 25387b0129af396c95ec503d29cca78367a7ec19 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 9 Jul 2024 09:30:19 + Subject: [PATCH 1/2] [clang-repl] [codegen] Reduce the state in TBAA. NFC for

[clang] [clang-repl] [codegen] Reduce the state in TBAA. NFC for static compilation. (PR #98138)

2024-08-20 Thread Vassil Vassilev via cfe-commits
@@ -106,9 +101,9 @@ class CodeGenTypes { } CodeGenModule &getCGM() const { return CGM; } ASTContext &getContext() const { return Context; } - const ABIInfo &getABIInfo() const { return TheABIInfo; } + const ABIInfo &getABIInfo() const; vgvassilev wrote:

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

2024-08-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/94166 >From 629683d9236c34b8e5c4bde01dcbe5a2b7c306c0 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] Fix RuntimeInterfaceBuilder for 32-bit systems (PR #97071)

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

[clang] [clang-repl] Fix RuntimeInterfaceBuilder for 32-bit systems (PR #97071)

2024-06-28 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. Oh, that's a good catch. Any chance of adding a test case? Maybe something like: ```enum X : short {...}```? https://github.com/llvm/llvm-project/pull/97071 ___ cfe-commits mailing list cfe-com

[clang] [clang-repl] Fix RuntimeInterfaceBuilder for 32-bit systems (PR #97071)

2024-06-28 Thread Vassil Vassilev via cfe-commits
@@ -673,10 +673,12 @@ class InterfaceKindVisitor } private: - // Force cast these types to uint64 to reduce the number of overloads of - // `__clang_Interpreter_SetValueNoAlloc`. + // Force cast these types to the uint that fits the register size. That way we + // reduc

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

2024-06-28 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Thank you for letting this move forward! https://github.com/llvm/llvm-project/pull/86402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix RuntimeInterfaceBuilder for 32-bit systems (PR #97071)

2024-06-29 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/97071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)

2024-09-13 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/108529 Posix call to ::getenv is not guarenteed to be thread safe while C++11 made std::getenv thread safe. This resolves bugs when using llvm in multithreaded environment similar to cms-sw/cmssw#44659 >From 4ae2

[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)

2024-09-13 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Are we sure this is going to do what we think? > > https://github.com/llvm/llvm-project/blob/a41bb71f2216cef08ab04f1d730ae1701c145f3c/libcxx/include/cstdlib#L127 > > https://github.com/gcc-mirror/gcc/blob/494d3c3faaee0dbde696ea334f8e242ae85ae2b5/libstdc%2B%2B-v3/include/c_co

[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)

2024-09-13 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > > Are we sure this is going to do what we think? > > > https://github.com/llvm/llvm-project/blob/a41bb71f2216cef08ab04f1d730ae1701c145f3c/libcxx/include/cstdlib#L127 > > > > > > https://github.com/gcc-mirror/gcc/blob/494d3c3faaee0dbde696ea334f8e242ae85ae2b5/libstdc%2B%2B-v3

[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)

2024-09-13 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Okay, thanks for clarifying. Shall I close this one? https://github.com/llvm/llvm-project/pull/108529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra] Fix add_clang_library usage (PR #109321)

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

[clang-tools-extra] [clang-tools-extra] Fix add_clang_library usage (PR #109321)

2024-10-07 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/109321 >From 6dd09dc7c40780615ce662676188a1005d4d72cc Mon Sep 17 00:00:00 2001 From: Thomas Fransham Date: Thu, 19 Sep 2024 16:53:20 +0100 Subject: [PATCH] [clang-tools-extra] Fix add_clang_library usage If a add_c

[clang] Clang tooling generated visibility macros for Clang (PR #109702)

2024-10-14 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Processing just header is also much faster than a full build and I think it > would only have to run on changed headers and source files for a PR. Any ideas how to implement that check? If we have a draft implementation we can check with the the ci folks how to deploy it...

<    3   4   5   6   7   8   9   10   >