[clang] [ClangRepl] Reland Semanic Code Completion (PR #75556)

2023-12-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @vvereschaka, would reverting this PR fix the problem? The error seems unrelated to the code changes. IIUC it says that we fail to pass the correct target triple to be able to execute code... https://github.com/llvm/llvm-project/pull/75556

[clang] [ClangRepl] Reland Semanic Code Completion (PR #75556)

2023-12-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: I am testing a fix/workaround. Will send a diff shortly... https://github.com/llvm/llvm-project/pull/75556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ClangRepl] Reland Semanic Code Completion (PR #75556)

2023-12-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Can you try this one: ```diff diff --git a/clang/unittests/Interpreter/CodeCompletionTest.cpp b/clang/unittests/Interpreter/CodeCompletionTest.cpp index cd7fdfa588a5..873fbda32f05 100644 --- a/clang/unittests/Interpreter/CodeCompletionTest.cpp +++ b/clang/unittests/Interpreter

[clang] [ClangRepl] Reland Semanic Code Completion (PR #75556)

2023-12-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: If all good, would you mind landing it? I need to disappear for couple of hours. https://github.com/llvm/llvm-project/pull/75556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [ClangRepl] Type Directed Code Completion (PR #67349)

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

[clang] Revert "[ClangRepl] Type Directed Code Completion" (PR #73259)

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

[clang] [clang][Sema] Always clear UndefinedButUsed (PR #73955)

2023-11-30 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Can you add a test? https://github.com/llvm/llvm-project/pull/73955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Always clear UndefinedButUsed (PR #73955)

2023-11-30 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: I think I understand. @AaronBallman from what concerns me that change seems fine it'd be hard to add a test for it right now. Do you have any concerns? https://github.com/llvm/llvm-project/pull/73955 ___ cfe-commits mailing list cfe-

[clang] [llvm] Avoid need for SLocEntryLoaded BitVector (PR #67960)

2023-12-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @ktf what is the fate of this PR? https://github.com/llvm/llvm-project/pull/67960 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2023-12-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/76218 This patch brings back the basic support for C by inserting the required for value printing runtime only when we are in C++ mode. Additionally, it defines a new overload of operator placement new because we c

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2023-12-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/76218 >From 0578f4c1582abdc6d4695d5c3c460213d1f02f00 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 22 Dec 2023 08:38:23 + Subject: [PATCH] [clang-repl] Add a interpreter-specific overload of operator

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2023-12-22 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: This PR should help compiler-research/CppInterOp#173 move forward. cc: @makslevental, @alexander-penev, @mcbarton https://github.com/llvm/llvm-project/pull/76218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2023-12-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/76218 >From c5f5ea4b38e7248a404c0e591d16145faeac388f Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 22 Dec 2023 08:38:23 + Subject: [PATCH] [clang-repl] Add a interpreter-specific overload of operator

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2023-12-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/76218 >From 50a08a2a04c97b0ed5630c53f549a1331e18aee7 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 22 Dec 2023 08:38:23 + Subject: [PATCH] [clang-repl] Add a interpreter-specific overload of operator

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2023-12-22 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/76218 >From a3f213ef4a7e293152c272cce78ad5d10a3ede52 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 22 Dec 2023 08:38:23 + Subject: [PATCH] [clang-repl] Add a interpreter-specific overload of operator

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

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

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-03 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev commented: This is a great way to start a new year ;) The phab link is https://reviews.llvm.org/D41416. In general I was wondering could we simplify the implementation by loading the specialization hash table upon module load. That should be relatively cheap as w

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-03 Thread Vassil Vassilev via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } vgvassilev wrote: I remember @hahnjo and @zygoloid discussing

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-03 Thread Vassil Vassilev via cfe-commits
@@ -2431,10 +2434,14 @@ void ASTDeclReader::VisitClassTemplateDecl(ClassTemplateDecl *D) { mergeRedeclarableTemplate(D, Redecl); if (ThisDeclID == Redecl.getFirstID()) { -// This ClassTemplateDecl owns a CommonPtr; read it to keep track of all of -// the specializ

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-03 Thread Vassil Vassilev via cfe-commits
@@ -150,6 +150,11 @@ class ExternalASTSource : public RefCountedBase { virtual bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name); + /// Load all the external specialzations for the Decl and the corresponding + /// template arguments. + vi

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-03 Thread Vassil Vassilev via cfe-commits
@@ -527,6 +527,10 @@ class ASTWriter : public ASTDeserializationListener, bool isLookupResultExternal(StoredDeclsList &Result, DeclContext *DC); bool isLookupResultEntirelyExternal(StoredDeclsList &Result, DeclContext *DC); + uint64_t + WriteSpecsLookupTable(NamedDecl *

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-08 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > This is a great way to start a new year ;) > > The phab link is https://reviews.llvm.org/D41416. > > In general I was wondering could we simplify the implementation by loading > > the specialization hash table upon module load. That should be relatively > > cheap as we wil

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-08 Thread Vassil Vassilev via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } vgvassilev wrote: I guess the comment we are discussing is he

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

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

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

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

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-08 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > > > This is a great way to start a new year ;) > > > > The phab link is https://reviews.llvm.org/D41416. > > > > In general I was wondering could we simplify the implementation by > > > > loading the specialization hash table upon module load. That should be > > > > relati

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-08 Thread Vassil Vassilev via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } vgvassilev wrote: If the example of @hahnjo works, perhaps a

[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

2024-01-08 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/76774 >From 50fd47f2bfda527807f8cc5e46425050246868aa Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH 1/2] Load Specializations Lazily --- clang/include/clang/AST/Decl

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-01-09 Thread Vassil Vassilev via cfe-commits
@@ -100,6 +100,11 @@ ExternalASTSource::FindExternalVisibleDeclsByName(const DeclContext *DC, return false; } +void ExternalASTSource::LoadExternalSpecializations( +const Decl *D, ArrayRef TemplateArgs) { + return; vgvassilev wrote: ```suggestion ```

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-01-09 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev commented: Overall this looks quite promising to me. Have you run that patch on bigger workflows? Do we have some performance numbers to compare? I will run some tests on our infrastructure and report back. https://github.com/llvm/llvm-project/pull/76774 _

[clang] [Serialization] Load Specializations Lazily (PR #76774)

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

[clang] [clang-repl] Enable native CPU detection by default (PR #77491)

2024-01-09 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. Thank you for the patch, Stefan! Some of our downstream consumers use that flag for exactly these reasons. LGTM! https://github.com/llvm/llvm-project/pull/77491 ___ cfe-commits mailing list

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-01-10 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @ChuanqiXu9, this PR does not seem to compile. Can you make the second commit work before I start testing? https://github.com/llvm/llvm-project/pull/76774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] da58ca5 - [clang-repl] Build and install clang-repl by default.

2021-07-27 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2021-07-27T14:09:44Z New Revision: da58ca51f0cf4b415bbfc299ac7cef0666243c6c URL: https://github.com/llvm/llvm-project/commit/da58ca51f0cf4b415bbfc299ac7cef0666243c6c DIFF: https://github.com/llvm/llvm-project/commit/da58ca51f0cf4b415bbfc299ac7cef0666243c6c.diff LO

[clang] 788e0f7 - [clang-repl] Add an accessor to our underlying execution engine

2022-03-11 Thread Vassil Vassilev via cfe-commits
Author: Vassil Vassilev Date: 2022-03-11T09:24:47Z New Revision: 788e0f7f3e96a9d61c2412e452c4589e2693b79a URL: https://github.com/llvm/llvm-project/commit/788e0f7f3e96a9d61c2412e452c4589e2693b79a DIFF: https://github.com/llvm/llvm-project/commit/788e0f7f3e96a9d61c2412e452c4589e2693b79a.diff LO

[clang] [clang-repl] Fix assertion failure in CleanUpPTU() (PR #85378)

2024-03-15 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Nice catch! Any chance for having a test? https://github.com/llvm/llvm-project/pull/85378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix assertion failure in CleanUpPTU() (PR #85378)

2024-03-15 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Okay, sounds fair. https://github.com/llvm/llvm-project/pull/85378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix assertion failure in CleanUpPTU() (PR #85378)

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

[clang] [clang-repl] Fix assertion failure in CleanUpPTU() (PR #85378)

2024-03-15 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -375,16 +375,22 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { TranslationUnitDecl *MostRecentTU = PTU.TUPart; TranslationUnitDecl *FirstTU = MostRecentTU->getFirstDecl(); if (StoredDeclsMap

[clang] [clang-repl] Fix assertion failure in CleanUpPTU() (PR #85378)

2024-03-15 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -375,16 +375,22 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { TranslationUnitDecl *MostRecentTU = PTU.TUPart; TranslationUnitDecl *FirstTU = MostRecentTU->getFirstDecl(); if (StoredDeclsMap

[clang] [clang-repl] Fix assertion failure in CleanUpPTU() (PR #85378)

2024-03-15 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -375,16 +375,22 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { TranslationUnitDecl *MostRecentTU = PTU.TUPart; TranslationUnitDecl *FirstTU = MostRecentTU->getFirstDecl(); if (StoredDeclsMap

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

2024-03-18 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > There is a Windows failure that I can't reproduce: > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 Can > > someone help me to figure out what is wrong? > > I'm not certain what's going on yet, but it smells a bit like the interpreter > needs to k

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

2024-03-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > > > There is a Windows failure that I can't reproduce: > > > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 > > > > Can someone help me to figure out what is wrong? > > > > > > > > > I'm not certain what's going on yet, but it smells a bit like th

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

2024-03-19 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-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > > > > > > There is a Windows failure that I can't reproduce: > > > > > > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 > > > > > > > Can someone help me to figure out what is wrong? > > > > > > > > > > > > > > > > > > I'm not certain what's going

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

2024-03-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > ; Function Attrs: nobuiltin allocsize(0) > declare dso_local noundef nonnull ptr @"??2@YAPEAX_K@Z"(i64 noundef %0) #6 That's probably the problem. We do not "see" the definition of the operator delete. Is that "exported" on msvc? https://github.com/llvm/llvm-project/pull/83

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

2024-03-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Not entirely certain what you're asking, but MSVC CRT does have a definition > for sized delete: > > ``` > _CRT_SECURITYCRITICAL_ATTRIBUTE > void __CRTDECL operator delete(void* const block, size_t const) noexcept > { > operator delete(block); > } > ``` > > in `crt\src\

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

2024-03-19 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > > > Not entirely certain what you're asking, but MSVC CRT does have a > > > definition for sized delete: > > > ``` > > > _CRT_SECURITYCRITICAL_ATTRIBUTE > > > void __CRTDECL operator delete(void* const block, size_t const) noexcept > > > { > > > operator delete(block); >

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

2024-03-20 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Did you explicitly list ??3@YAXPEAX_K@Z as it was not part of that code? https://github.com/llvm/llvm-project/pull/83774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang-repl] Fix Value for platforms where unqualified char is unsigned (PR #86118)

2024-03-21 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev approved this pull request. Good catch! Thank you, @weliveindetail! https://github.com/llvm/llvm-project/pull/86118 ___ cfe-comm

[clang] [clang-repl] Factor out CreateJITBuilder() and allow specialization in derived classes (PR #84461)

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

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

2024-03-22 Thread Vassil Vassilev via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

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

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

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

2024-03-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/86402 This commit introduces support for running clang-repl and executing C++ code interactively inside a Javascript engine using WebAssembly when built with Emscripten. This is achieved by producing WASM "shared l

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

2024-03-23 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: cc: @sylvaincorlay, @JohanMabille, @anutosh491 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-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-25 Thread Vassil Vassilev via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

[clang] [clang-repl] Expose markUserCodeStart() in extended Interpreter interface (PR #87064)

2024-03-29 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Would it make sense to pass the eventual builtin includes (as string or similar) to the interpreter constructor? https://github.com/llvm/llvm-project/pull/87064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang-repl] Minor cleanups in Value.cpp (NFC) (PR #87066)

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

[clang] [clang-repl] Expose markUserCodeStart() in extended Interpreter interface (PR #87064)

2024-03-30 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: You are right. I guess I was a little worried that we are leaking "severe" implementation details to the interface. https://github.com/llvm/llvm-project/pull/87064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] Rework the printing of attributes (PR #87281)

2024-04-01 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/87281 Commit https://github.com/llvm/llvm-project/commit/46f3ade introduced a notion of printing the attributes on the left to improve the printing of attributes attached to variable declarations. The intent was to

[clang] Rework the printing of attributes (PR #87281)

2024-04-01 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: @giulianobelinassi, I could not select you for a reviewer but please take a look at the pull request. https://github.com/llvm/llvm-project/pull/87281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] Rework the printing of attributes (PR #87281)

2024-04-01 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev updated https://github.com/llvm/llvm-project/pull/87281 >From 94f1c8653903cc3db55abd641c68a9dd11f05df3 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Mon, 1 Apr 2024 15:01:33 + Subject: [PATCH 1/5] Revert "Remove extra switch from 0323938d" This reverts

[clang] Rework the printing of attributes (PR #87281)

2024-04-02 Thread Vassil Vassilev via cfe-commits
@@ -129,11 +118,13 @@ namespace { const TemplateParameterList *Params); void printTemplateArguments(llvm::ArrayRef Args, const TemplateParameterList *Params); - -inline void prettyPrintAttributes(Decl *D) {

[clang] Rework the printing of attributes (PR #87281)

2024-04-02 Thread Vassil Vassilev via cfe-commits
@@ -250,87 +241,43 @@ raw_ostream& DeclPrinter::Indent(unsigned Indentation) { return Out; } -// For CLANG_ATTR_LIST_CanPrintOnLeft macro. -#include "clang/Basic/AttrLeftSideCanPrintList.inc" - -// For CLANG_ATTR_LIST_PrintOnLeft macro. -#include "clang/Basic/AttrLeftSideMus

[clang] [clang-repl] Add call to 'InitializeAllAsmParsers' (PR #86727)

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

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , 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 commented: Thanks for this PR! I think it is a good idea to make the `TopLevelStmtDecl` a `Decl

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -5676,24 +5676,32 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() { // Parse a top-level-stmt.

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -20446,12 +20446,22 @@ Decl *Sema::ActOnFileScopeAsmDecl(Expr *expr, return New; } -Decl *Sema::ActOn

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , 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 edited https://github.com/llvm/llvm-project/pull/84150 _

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 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?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: @@ -20446,12 +20446,22 @@ Decl *Sema::ActOnFileScopeAsmDecl(Expr *expr, return New

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -5676,24 +5676,32 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() {

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 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?= , 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: @@ -41,3 +40,23 @@ for (; i > 4; --i) { printf("i =

[clang] [clang-repl] Expose RuntimeInterfaceBuilder to allow customization (PR #83126)

2024-03-06 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?= , 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/83126 __

[clang] [clang-repl] Refactor locking of runtime PTU stack (NFC) (PR #84176)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -137,9 +136,10 @@ class Interpreter { Expr *SynthesizeExpr(Expr *E); -private: vgvassilev wrote: We can befriend the test to the interpreter. Alternatively, we probably have a second option to make

[clang] [clang-repl] Refactor locking of runtime PTU stack (NFC) (PR #84176)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: @@ -137,9 +136,10 @@ class Interpreter { Expr *SynthesizeExpr(Expr *E); -private: size_t getEffectivePTUSize() const; + void finalizeInitPTUStack(); vgvassilev wrote: Maybe something like `mar

[clang] [clang-repl] Refactor locking of runtime PTU stack (NFC) (PR #84176)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -137,9 +136,10 @@ class Interpreter { Expr *SynthesizeExpr(Expr *E); -private: size_t getEffectivePTUSize() const; + void finalizeInitPTUStack(); vgvassilev wrote: > Do you mean sth like markMax

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-06 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?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= , 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: https://github.com/vgvassilev appr

[clang] [clang-repl] Refactor locking of runtime PTU stack (NFC) (PR #84176)

2024-03-06 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: @@ -136,6 +136,24 @@ TEST(InterpreterTest, DeclsAndStatements) { EXPECT_TRUE(!!R2); } +TEST(InterpreterTest, PTUStack) { + clang::IncrementalCompilerBuilder CB; + auto CI = cantFail(CB.CreateCpp()); + + llvm::Error Er

[clang] [clang-repl] Expose CreateExecutor() and ResetExecutor() in extended Interpreter interface (PR #84460)

2024-03-08 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: I was currently touching this area to fix a problem of @jeaye reported on irc. Do you mind incorporating this patch so that we avoid churn? ```diff diff --git a/clang/include/clang/Interpreter/Interpreter.h b/clang/includ

[clang] [clang-repl] Expose CreateExecutor() and ResetExecutor() in extended Interpreter interface (PR #84460)

2024-03-11 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev edited https://github.com/llvm/llvm-project/pull/84460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang-repl] Expose CreateExecutor() and ResetExecutor() in extended Interpreter interface (PR #84460)

2024-03-11 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: @@ -7,6 +7,8 @@ // RUN: cat %s | clang-repl | FileCheck %s // RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s +// RUN: clang-repl -Xcc -include -Xcc %s | FileCheck %s +// RUN: clang-

[clang] [clang-repl] Expose CreateExecutor() and ResetExecutor() in extended Interpreter interface (PR #84460)

2024-03-11 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , 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/84460 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang-repl] Expose CreateExecutor() and ResetExecutor() in extended Interpreter interface (PR #84460)

2024-03-11 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: > > > Do you mind incorporating this patch so that we avoid churn? > > > > > > Sure. Essentially, this drops lazy creation of the executor and makes it > > dependent on the frontend action exp

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

2024-03-11 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev created https://github.com/llvm/llvm-project/pull/84769 Differential revision: https://reviews.llvm.org/D146809 >From 05c3bb8b193552b4ed7dc2e22848623e07cc2715 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 16 Jul 2023 21:18:26 + Subject: [PATCH 1/2]

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

2024-03-11 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: Hi @weliveindetail, I wanted to put in this PR which I am working from time to time on and will likely be very relevant for out-of-process execution. I still need to rebase it properly to the new "stuff" that landed recently. If you know how to rebase it faster, I would not m

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

2024-03-11 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: cc: @hahnjo, @devajithvs https://github.com/llvm/llvm-project/pull/84769 ___ 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-03-11 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-03-12 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-03-12 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] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-02-26 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Personally I feel this patch is good and the testing result from our workload > shows it is good too. But it looks like the performance testing results from > google @zygoloid @ilya-biryukov is not good. So maybe we need to wait for > landing this. (It will be great if @ily

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-02-26 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Weird. I only see two failures in my local environment: > > ``` > Failed Tests (2): > Clang :: Modules/cxx-templates.cpp > Clang :: Modules/odr_hash.cpp > ``` > > And I saw both of them in my patch. It is simply order mismatches. Ha, ok. I know that my system constantly

[clang] [clang-repl] Expose RuntimeInterfaceBuilder to allow customization (PR #83126)

2024-02-27 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 was wondering if we can extend that functionality via a callback mechanism which should be cheaper. We also have some pending work (which I was planning on working when time permits) in that

[clang] [compiler-rt] [llvm] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

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

[llvm] [compiler-rt] [clang] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-01-31 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev commented: Thank you for working on this. This looks very good. I have left comments from my first review pass. We probably want to wait for @lhames and @weliveindetail to take a look. https://github.com/llvm/llvm-project/pull/79936 ___

[llvm] [compiler-rt] [clang] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-01-31 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,61 @@ +// REQUIRES: host-supports-jit, x86_64-linux vgvassilev wrote: I believe this test copies some content from other tests. Would it make sense to add an extra `RUN` line to the tests themselves? https://github.com/llvm/llvm-project/pull/79936 __

[llvm] [compiler-rt] [clang] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-01-31 Thread Vassil Vassilev via cfe-commits
@@ -143,6 +169,201 @@ ReplListCompleter::operator()(llvm::StringRef Buffer, size_t Pos, return Comps; } +static llvm::Error sanitizeOopArguments(const char *ArgV0) { + llvm::Triple SystemTriple(llvm::sys::getProcessTriple()); + if ((OutOfProcessExecutor.getNumOccurrences(

[llvm] [clang] [compiler-rt] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-01-31 Thread Vassil Vassilev via cfe-commits
@@ -16,13 +16,24 @@ #include "clang/Interpreter/CodeCompletion.h" #include "clang/Interpreter/Interpreter.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h" #include "llvm/ExecutionEngine/Orc/LLJIT.h" +#include "llvm/Execution

[clang] [Serialization] Load Specializations Lazily (PR #76774)

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

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-03 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev commented: This patch does too many things for me to be able to review it. This patch fails on our infrastructure. I'd propose to simplify it to basically D41416 + the on-disk hash table. We should read all of the entries upon module loading to simplify the logic

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-03 Thread Vassil Vassilev via cfe-commits
@@ -603,21 +606,30 @@ class ASTReader llvm::DenseMap Lookups; + /// Map from decls to specialized decls. + llvm::DenseMap + SpecializationsLookups; vgvassilev wrote: We should probably have a mapping between a template argument hash -> vector of Decl

<    1   2   3   4   5   6   7   8   9   10   >