[libcxx] r322326 - [libcxx] Make std::basic_istream::get 0-terminate input array in case of error.

2018-01-11 Thread Volodymyr Sapsai via cfe-commits
Author: vsapsai Date: Thu Jan 11 15:23:49 2018 New Revision: 322326 URL: http://llvm.org/viewvc/llvm-project?rev=322326&view=rev Log: [libcxx] Make std::basic_istream::get 0-terminate input array in case of error. It covers the cases when the sentry object returns false and when an exception was

r322390 - [Lex] Avoid out-of-bounds dereference in LexAngledStringLiteral.

2018-01-12 Thread Volodymyr Sapsai via cfe-commits
Author: vsapsai Date: Fri Jan 12 10:54:35 2018 New Revision: 322390 URL: http://llvm.org/viewvc/llvm-project?rev=322390&view=rev Log: [Lex] Avoid out-of-bounds dereference in LexAngledStringLiteral. Fix makes the loop in LexAngledStringLiteral more like the loops in LexStringLiteral, LexCharConst

Re: r322390 - [Lex] Avoid out-of-bounds dereference in LexAngledStringLiteral.

2018-01-12 Thread Volodymyr Sapsai via cfe-commits
Hans, I am nominating this change to be merged into 6.0.0 release branch. Thanks, Volodymyr > On Jan 12, 2018, at 10:54, Volodymyr Sapsai via cfe-commits > wrote: > > Author: vsapsai > Date: Fri Jan 12 10:54:35 2018 > New Revision: 322390 > > URL: http://llvm.org

r323008 - [Lex] Fix crash on code completion in comment in included file.

2018-01-19 Thread Volodymyr Sapsai via cfe-commits
Author: vsapsai Date: Fri Jan 19 15:41:47 2018 New Revision: 323008 URL: http://llvm.org/viewvc/llvm-project?rev=323008&view=rev Log: [Lex] Fix crash on code completion in comment in included file. This fixes PR32732 by updating CurLexerKind to reflect available lexers. We were hitting null point

r323156 - Reland "[CodeGen] Fix crash when a function taking transparent union is redeclared."

2018-01-22 Thread Volodymyr Sapsai via cfe-commits
Author: vsapsai Date: Mon Jan 22 14:29:24 2018 New Revision: 323156 URL: http://llvm.org/viewvc/llvm-project?rev=323156&view=rev Log: Reland "[CodeGen] Fix crash when a function taking transparent union is redeclared." When a function taking transparent union is declared as taking one of union m

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-07-03 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Looked at this more and haven't found anything sketchy. `ASTWriter::WriteHeaderSearch` writes the same content both with and without `-fno-modules-prune-non-affecting-module-map-files`. `Preprocessor::alreadyIncluded` is called in reasonable places (as for me, ASTWriter is the

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-07-03 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. https://github.com/llvm/llvm-project/pull/96356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fix build errors with a `LLVM_ENABLE_MODULES=ON` build (PR #107654)

2024-09-06 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. Thanks for fixing these! https://github.com/llvm/llvm-project/pull/107654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-12 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: The bigger idea is that not enabled stats should be negligibly cheap. As for me, the problem is in that not being true. Let me check how we have expensive stats all the time. Extra fixes are good but I'm concerned they help only with these specific stats while others might stil

[clang] [unused-includes][Serialization] Remove unused includes. NFC. (PR #88790)

2024-04-15 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/88790 None >From 72f8208752d188aa32e9989faecd7c4b11779eb9 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Mon, 15 Apr 2024 13:22:48 -0700 Subject: [PATCH] [unused-includes][Serialization] Remove unused includes.

[clang] [unused-includes] PCHContainerOperations uses MemoryBufferRef, not MemoryBuffer. NFC. (PR #88794)

2024-04-15 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/88794 None >From b95289569d0441ff799282e125e4f9ad16969f12 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Mon, 15 Apr 2024 13:44:54 -0700 Subject: [PATCH] [unused-includes] PCHContainerOperations uses MemoryBuf

[clang] [unused-includes][Serialization] Remove unused includes. NFC. (PR #88790)

2024-04-16 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/88790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [unused-includes] PCHContainerOperations uses MemoryBufferRef, not MemoryBuffer. NFC. (PR #88794)

2024-04-16 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/88794 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HeaderSearch] Make a test independent of the local environment. (PR #100011)

2024-07-23 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Failed test is unrelated "Profile-x86_64 :: check-same-common-code.test". https://github.com/llvm/llvm-project/pull/100011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [HeaderSearch] Make a test independent of the local environment. (PR #100011)

2024-07-23 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/100011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (PR #100005)

2024-07-23 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai updated https://github.com/llvm/llvm-project/pull/15 >From 8566865fd55a4634414f339a39c045aac637f374 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Mon, 22 Jul 2024 15:40:15 -0700 Subject: [PATCH 1/2] [Modules] Don't search for modulemaps in the immediate s

[clang] [Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (PR #100005)

2024-07-23 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Failed test is "Profile-x86_64 :: check-same-common-code.test", the same as failed in #100011 for unrelated reasons. https://github.com/llvm/llvm-project/pull/15 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (PR #100005)

2024-07-23 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/15 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix using `va_list` with modules and a precompiled header. (PR #100837)

2024-07-26 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/100837 Fix the false warning > incompatible pointer types passing 'va_list' (aka '__builtin_va_list') to > parameter of type 'struct __va_list_tag *' [-Wincompatible-pointer-types] The warning is wrong because both in

[clang] [Modules][Diagnostic] Don't claim a METADATA mismatch is always in PCH file. (PR #101280)

2024-07-30 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/101280 You can provide more than one AST file as an input. Emit a path for a file with a problem, so you can disambiguate between multiple files. rdar://65005546 >From c115a7f6b3e36682bfdd9768ab7969e0f11489bb Mon Sep

[clang] [Modules][Diagnostic] Don't claim a METADATA mismatch is always in PCH file. (PR #101280)

2024-07-30 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: I have more similar improvements when a diagnostic claims a mismatch is in PCH file while it is in a module file. Those would be separate PR(s) as the code change is quite different. https://github.com/llvm/llvm-project/pull/101280 ___

[clang] [Modules][Diagnostic] Don't claim a METADATA mismatch is always in PCH file. (PR #101280)

2024-07-31 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/101280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Don't search for modulemaps in the immediate sub-directories of search paths for recent Apple SDKs. (PR #100005)

2024-07-22 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/15 Such searches can be costly and non-intuitive. We've seen complaints from developers that they don't expect clang to find modules on their own and not in search paths that developers provide. Keeping the search

[clang] [HeaderSearch] Make a test independent of the local environment. (PR #100011)

2024-07-22 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/100011 Don't ask the driver to inspect the local environment but use `cc1` directly. >From 190e0a04afb71873c5d398ff08057684ca553d67 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Mon, 22 Jul 2024 16:46:27 -0700

[clang] [HeaderSearch] Make a test independent of the local environment. (PR #100011)

2024-07-22 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Noticed inconsistencies after #15 as I have pre-release Xcode locally. https://github.com/llvm/llvm-project/pull/100011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-04-26 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/90298 There is no reason for C and Objective-C to differ from C++ in this matter. rdar://85531830 >From 8dafc9af06eef1a4b3fba8b5cffeece62967a6fd Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Fri, 26 Apr 2024

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-04-29 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > C doesn't have an odr, does it? For non-C++ "ODR" has a meaning more like "ODR-inspired checks". But there is no language rule that would require enforcement and there is no impact on linkage (at least during deserialization). https://github.com/llvm/llvm-project/pull/90298 _

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-04-29 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > Not sure I'm following the response here - but I guess what I'm trying to > say, with more words, is that my understanding was that C doesn't have an > ODR, and you can have different definitions of a type, with the same name, in > C and that's OK. In different translation un

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-05-01 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: @dwblaikie if you have no further comments, I'll merge this approved change some time soon (in a day or two). https://github.com/llvm/llvm-project/pull/90298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-05-02 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/90298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-05-07 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: In C++ we reject mismatched types coming from different Clang modules. Haven't checked the behavior for C++20 modules as I'm not changing it. In C modules aren't a part of any standard as far as I know. But for Clang modules we reject most of the mismatched types coming from dif

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > I'd suggest keeping this PR and the resulting commit free of any formatting > changes and then commit the results from `clang-format` as a separate commit. Will do that. > After #101280 I had the impression that we're trying to be very precise about > reporting whether an AST

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
@@ -130,7 +130,7 @@ class ASTReaderListener { /// /// \returns true to indicate the options are invalid or false otherwise. virtual bool ReadLanguageOptions(const LangOptions &LangOpts, - bool Complain, +

[clang] [Modules] Fix using `va_list` with modules and a precompiled header. (PR #100837)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > LGTM. Thanks for the review! https://github.com/llvm/llvm-project/pull/100837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix using `va_list` with modules and a precompiled header. (PR #100837)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/100837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai updated https://github.com/llvm/llvm-project/pull/101413 >From c474bcdc5155d3ca9f9d219444b70e6c0ba43a28 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Wed, 31 Jul 2024 14:13:47 -0700 Subject: [PATCH 1/2] [Modules][Diagnostic] Mention which AST file's options d

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai updated https://github.com/llvm/llvm-project/pull/101413 >From c474bcdc5155d3ca9f9d219444b70e6c0ba43a28 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Wed, 31 Jul 2024 14:13:47 -0700 Subject: [PATCH 1/3] [Modules][Diagnostic] Mention which AST file's options d

[clang] [Modules] Fix using `va_list` with modules and a precompiled header. (PR #100837)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Looks like need something like `// REQUIRES: x86-registered-target` in the test. But still need to check the correct approach in other tests. https://github.com/llvm/llvm-project/pull/100837 ___ cfe-commits mailing list cfe-commits@list

[clang] Reland "[Modules] Fix using `va_list` with modules and a precompiled header. (#101752)" (PR #101762)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/101762 Fix the false warning > incompatible pointer types passing 'va_list' (aka '__builtin_va_list') to > parameter of type 'struct __va_list_tag *' [-Wincompatible-pointer-types] The warning is wrong because both in

[clang] Reland "[Modules] Fix using `va_list` with modules and a precompiled header. (#101752)" (PR #101762)

2024-08-02 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/101762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[Modules] Fix using `va_list` with modules and a precompiled header. (#101752)" (PR #101762)

2024-08-06 Thread Volodymyr Sapsai via cfe-commits
@@ -0,0 +1,84 @@ +// Check how builtins using varargs behave with the modules. + +// REQUIRES: x86-registered-target +// RUN: rm -rf %t +// RUN: split-file %s %t + +// RUN: %clang_cc1 -triple x86_64-apple-darwin \ vsapsai wrote: The issue is reproducible on x86_6

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-06 Thread Volodymyr Sapsai via cfe-commits
@@ -130,7 +130,7 @@ class ASTReaderListener { /// /// \returns true to indicate the options are invalid or false otherwise. virtual bool ReadLanguageOptions(const LangOptions &LangOpts, - bool Complain, +

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-08 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/101413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [re-format][Modules] Follow-up formatting to "Mention which AST file's options differ from the current TU options." (PR #102484)

2024-08-08 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/102484 Fix formatting for fdf8e3e31103bc81917cdb27150877f524bb2669. >From 4083dcf794e2a3d27966090e955433361b733ff8 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Thu, 8 Aug 2024 11:51:53 -0300 Subject: [PATCH]

[clang] [re-format][Modules] Follow-up formatting to "Mention which AST file's options differ from the current TU options." (PR #102484)

2024-08-08 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/102484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-08 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Formatting change was #102484. https://github.com/llvm/llvm-project/pull/101413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9fad9de - [modules] Fix IRGen assertion on accessing ObjC ivar inside a method.

2021-10-07 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-10-07T17:09:31-07:00 New Revision: 9fad9de5c0032898a481e06bf5f696ca50c804c1 URL: https://github.com/llvm/llvm-project/commit/9fad9de5c0032898a481e06bf5f696ca50c804c1 DIFF: https://github.com/llvm/llvm-project/commit/9fad9de5c0032898a481e06bf5f696ca50c804c1.di

[clang] d0e7bdc - [modules] Make a module map referenced by a system map a system one too.

2021-10-15 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-10-15T12:46:51-07:00 New Revision: d0e7bdc208491fd5d4245878c1ec2962694e2baa URL: https://github.com/llvm/llvm-project/commit/d0e7bdc208491fd5d4245878c1ec2962694e2baa DIFF: https://github.com/llvm/llvm-project/commit/d0e7bdc208491fd5d4245878c1ec2962694e2baa.di

[clang] 91e19f6 - [driver] Explicitly specify `-fbuild-session-timestamp` in seconds.

2021-10-19 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-10-19T13:30:26-07:00 New Revision: 91e19f66e51ac3fda2309f5e67b02fcccd4d58a0 URL: https://github.com/llvm/llvm-project/commit/91e19f66e51ac3fda2309f5e67b02fcccd4d58a0 DIFF: https://github.com/llvm/llvm-project/commit/91e19f66e51ac3fda2309f5e67b02fcccd4d58a0.di

[clang] c593126 - [modules] While merging ObjCInterfaceDecl definitions, merge them as decl contexts too.

2021-10-20 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-10-20T18:48:29-07:00 New Revision: c5931267db26d71351c634df06006d9c818ff158 URL: https://github.com/llvm/llvm-project/commit/c5931267db26d71351c634df06006d9c818ff158 DIFF: https://github.com/llvm/llvm-project/commit/c5931267db26d71351c634df06006d9c818ff158.di

[clang] d9eca33 - [modules] Fix tracking ObjCInterfaceType decl when there are multiple definitions.

2021-10-21 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-10-21T12:08:06-07:00 New Revision: d9eca3320a4d8db11ad65229ef6f564d134fc894 URL: https://github.com/llvm/llvm-project/commit/d9eca3320a4d8db11ad65229ef6f564d134fc894 DIFF: https://github.com/llvm/llvm-project/commit/d9eca3320a4d8db11ad65229ef6f564d134fc894.di

[clang] 048d2c7 - [modules] Update visibility for merged ObjCInterfaceDecl definitions.

2021-10-21 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-10-21T15:06:39-07:00 New Revision: 048d2c76efcddf4265987914e30d3d4f49395496 URL: https://github.com/llvm/llvm-project/commit/048d2c76efcddf4265987914e30d3d4f49395496 DIFF: https://github.com/llvm/llvm-project/commit/048d2c76efcddf4265987914e30d3d4f49395496.di

[clang] a4a5c00 - [Modules] Change result of reading AST block to llvm::Error instead

2021-08-27 Thread Volodymyr Sapsai via cfe-commits
Author: Ben Barham Date: 2021-08-27T20:16:20-07:00 New Revision: a4a5c00b53d0638e2bd9011fa5cce7ef9739eea6 URL: https://github.com/llvm/llvm-project/commit/a4a5c00b53d0638e2bd9011fa5cce7ef9739eea6 DIFF: https://github.com/llvm/llvm-project/commit/a4a5c00b53d0638e2bd9011fa5cce7ef9739eea6.diff LO

[clang] 93764ff - [modules] Fix miscompilation when using two RecordDecl definitions with the same name.

2021-08-30 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-08-30T17:51:38-07:00 New Revision: 93764ff6e2005b92057cffa9b3866307e2de260f URL: https://github.com/llvm/llvm-project/commit/93764ff6e2005b92057cffa9b3866307e2de260f DIFF: https://github.com/llvm/llvm-project/commit/93764ff6e2005b92057cffa9b3866307e2de260f.di

[clang] 64ebf31 - [HeaderSearch] Use `isImport` only for imported headers and not for `#pragma once`.

2021-09-01 Thread Volodymyr Sapsai via cfe-commits
Author: Volodymyr Sapsai Date: 2021-09-01T17:07:35-07:00 New Revision: 64ebf313a7e485e1a90da9cd69c412e06615a9bc URL: https://github.com/llvm/llvm-project/commit/64ebf313a7e485e1a90da9cd69c412e06615a9bc DIFF: https://github.com/llvm/llvm-project/commit/64ebf313a7e485e1a90da9cd69c412e06615a9bc.di

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-06-27 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Non-representative check for changes in the memory consumption doesn't show anything interesting for the added test case. Maximum resident set size and peak memory footprint with the change and without it are pretty close to each other, no statistic, just eyeballing. My main co

[clang] [Modules] Mark CFProtectionOptions.def as a textual header because it is used for x-macro purposes. (PR #110780)

2024-10-01 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/110780 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Mark CFProtectionOptions.def as a textual header because it is used for x-macro purposes. (PR #110780)

2024-10-01 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: CI error ``` Traceback (most recent call last): File "/var/lib/buildkite-agent/builds/linux-56-59b8f5d88-r8xzr-1/llvm-project/github-pull-requests/libcxx/utils/generate_iwyu_mapping.py", line 92, in main(sys.argv[1:]) File "/var/lib/buildkite-agent/builds/linux-56-59b8f

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-18 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > > Have you checked the performance for incremental builds? > > I haven't, since I believe this change doesn't affect incremental builds at > all. Fair enough. I was thinking that you can achieve the same improvement by using some contentionless-update-mtime function. But I ha

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-17 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai edited https://github.com/llvm/llvm-project/pull/112452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-17 Thread Volodymyr Sapsai via cfe-commits
@@ -4905,6 +4905,10 @@ ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef, StringRef OutputFile, this->BaseDirectory.clear(); WritingAST = false; + + if (WritingModule) +updateModuleTimestamp(OutputFile); vsapsai wrote: Don't have a strong opinion a

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-17 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai commented: I think the change makes sense. For example, for just-built .o files we assume they are valid and up-to-date, and don't need any extra verification. As far as I understand, your change helps with the clean builds. And I believe incremental builds can still

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-22 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. https://github.com/llvm/llvm-project/pull/112452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove 'PCH' from more diagnostics that were wrong or misleading NFC (PR #110724)

2024-10-01 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. https://github.com/llvm/llvm-project/pull/110724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Mark CFProtectionOptions.def as a textual header because it is used for x-macro purposes. (PR #110780)

2024-10-01 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/110780 None >From 030597a499d59b860cd14a6e5ba69b93a4b30290 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Tue, 1 Oct 2024 18:46:04 -0700 Subject: [PATCH] [Modules] Mark CFProtectionOptions.def as a textual head

[clang] [llvm] [Modules] Fix modular build. (PR #122034)

2025-01-07 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/122034 Add a new file to the module map and remove 2 missing files (migrated from .def to .td). >From cc9d4ebe3880810c8325f1fd6c7b9e2a49f2fe74 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Tue, 7 Jan 2025 17:

[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2024-12-16 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Sorry for the delay. Will need to look at the change in a debugger. https://github.com/llvm/llvm-project/pull/114240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ObjectiveC] Fix Parsing Method Parameter Types with the `::` Prefix (PR #119908)

2024-12-16 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: How does it work in Objective-C++? I don't know even if we have a test but hope we do. https://github.com/llvm/llvm-project/pull/119908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang][ObjectiveC] Fix Parsing Method Parameter Types with the `::` Prefix (PR #119908)

2024-12-17 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: I don't know if we have a test for it but I've realized there are cases where you can have a legitimate double colon in Objective-C. For example, ```objective-c @interface NSObject @end @implementation NSObject - (void)performSelector:(SEL)selector {} - (void)double:(int)firstAr

[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2025-01-20 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: In general, personally I quite like the idea of removing decls from the scope. Though I think when I've tried to do so [in a different context], there were some problems. I'll try to find what I was doing and why it wasn't working. It's not a blocker for your change but it can b

[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2025-01-20 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: That crash looks pretty annoying, thanks for looking into this issue and debugging it. Can you trigger the crash without `-ast-dump-all`? If there is a way to detect a faulty behaviour without verifying the internal compiler state, it is more reliable and less fragile to do it

[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2025-01-21 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai commented: I've realized that the test doesn't have to be Objective-C, the failure is reproducible in C. Curiously, we aren't hitting the assertion in C++/Objective-C++ but I don't know why. I wanted to try defining the enums in different scopes (e.g. in a struct) an

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-10 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai edited https://github.com/llvm/llvm-project/pull/119740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-10 Thread Volodymyr Sapsai via cfe-commits
@@ -0,0 +1,141 @@ +//===- ModuleMapFile.h - Parsing and representation -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-10 Thread Volodymyr Sapsai via cfe-commits
@@ -1575,305 +1494,45 @@ namespace clang { /// 'textual' to match the original intent. llvm::SmallPtrSet UsesRequiresExcludedHack; -/// Consume the current token and return its location. -SourceLocation consumeToken(); - -/// Skip tokens until we reach the

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-10 Thread Volodymyr Sapsai via cfe-commits
@@ -0,0 +1,141 @@ +//===- ModuleMapFile.h - Parsing and representation -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-10 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai commented: Overall the change makes sense and now `ModuleMap` works more like semantic analysis after the module map parsing. Didn't really delve into the parsing code and didn't compare the implementations side-by-side. Relying on the tests and expect most of the co

[clang] [llvm] [Modules] Fix modular build. (PR #122034)

2025-01-07 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Test failure "LLVM.tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml" is unrelated to this change. https://github.com/llvm/llvm-project/pull/122034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] [Modules] Fix modular build. (PR #122034)

2025-01-07 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/122034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-14 Thread Volodymyr Sapsai via cfe-commits
@@ -3871,7 +3874,8 @@ class ASTIdentifierTableTrait { if (isInterestingIdentifier(II, MacroOffset)) { DataLen += 2; // 2 bytes for builtin ID DataLen += 2; // 2 bytes for flags - if (MacroOffset) + if (MacroOffset || (II->hasMacroDefinition() && +

[clang] [Modules] Fix the inconsistency of which `Decl` should be serialized for an identifier. (PR #135887)

2025-04-17 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/135887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > > What would happen if both A-1.pcm and A-2.pcm are built for the same files > > (e.g., from Sysroot) but have different file names? Not saying it is a > > valid use case to support, just curious what would happen. > > I tried this, where basically `A-1.pcm` is built again but

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Does the described test case look like a build system problem? In my understanding at step 4 we should have re-scanned B to know that we need some B'.pcm depending on A-2.pcm. Regardless of the answer I don't want to block the change as it is still an improvement. Just thinking

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-14 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > Thanks! Does the pr fix https://bugs.llvm.org//show_bug.cgi?id=32670 Nope. The test case in #32017 is still failing. I believe it is a different issue as we don't have any identifiers with the same names as macros. And seems like the behavior wasn't affected by d79514e24b4da11

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-16 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/135471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix the inconsistency of which `Decl` should be serialized for an identifier. (PR #135887)

2025-04-16 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai updated https://github.com/llvm/llvm-project/pull/135887 >From d944252ce2f08d1522f7297e4d7f9a7b730db180 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Tue, 15 Apr 2025 16:34:47 -0700 Subject: [PATCH 1/2] [Modules] Fix the inconsistency of which `Decl` should be

[clang] [clang] Provide to `PPCallbacks` full expression range even in single file parse mode. (PR #138358)

2025-05-05 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai closed https://github.com/llvm/llvm-project/pull/138358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Volodymyr Sapsai via cfe-commits
@@ -0,0 +1,62 @@ +/// This tests the expected error case when there is a mismatch between the pcm dependencies passed in +/// the command line with `fmodule-file` and whats encoded in the pcm. + +/// The steps are: +/// 1. Build module (A-1) with no dependencies. +/// 2. Build

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-14 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: By the way, looked at the other tests in Modules directory and think that the test should start with "macro-" for consistency. Probably something like "macro-identifier-hiding.c" as we have "macro-hiding.cpp" already. https://github.com/llvm/ll

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-11 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: cc @bcardosolopes @vgvassilev as participants of the original bug discussion. https://github.com/llvm/llvm-project/pull/135471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-11 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/135471 We emit a macro definition only in a module defining it. But it means that if another module has an identifier with the same name as the macro, the users of such module won't be able to use the macro anymore.

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-15 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai updated https://github.com/llvm/llvm-project/pull/135471 >From cf55ae79e984cd5b046e4d78fd9d75d5f7c2d76e Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Fri, 11 Apr 2025 20:10:46 -0700 Subject: [PATCH 1/2] [Modules] Fix an identifier hiding a function-like macro

[clang] [Modules] Fix an identifier hiding a function-like macro definition. (PR #135471)

2025-04-15 Thread Volodymyr Sapsai via cfe-commits
@@ -2419,6 +2422,9 @@ namespace { // declarations it needs. ++NumIdentifierLookupHits; Found = *Pos; + if (Trait.hasMoreInformationInDependencies()) +// Look for the identifier in extra modules as they contain more info. +return false; ---

[clang] [Modules] Fix the inconsistency of which `Decl` should be serialized for an identifier. (PR #135887)

2025-04-15 Thread Volodymyr Sapsai via cfe-commits
@@ -224,6 +224,7 @@ class ASTWriter : public ASTDeserializationListener, /// discovery) and start at 2. 1 is reserved for the translation /// unit, while 0 is reserved for NULL. llvm::DenseMap DeclIDs; + // TMP: ^ DeclIDs type for reference vsapsai wrote

[clang] [Modules] Fix the inconsistency of which `Decl` should be serialized for an identifier. (PR #135887)

2025-04-15 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: cc @zygoloid as he has touched this code 10 years ago. https://github.com/llvm/llvm-project/pull/135887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix the inconsistency of which `Decl` should be serialized for an identifier. (PR #135887)

2025-04-15 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai created https://github.com/llvm/llvm-project/pull/135887 Fixes the assertion failure > Assertion failed: (DeclIDs.contains(D) && "Declaration not emitted!"), > function getDeclID, file ASTWriter.cpp, line 6873. We prepare to serialize a `Decl` by adding it to `DeclID

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > The `unique_ptr` in `ASTUnit` always stores a **copy** of the `shared_ptr` in > `CompilerInvocation`. And we need `unique_ptr` in `ASTUnit` instead of a direct value so we can change LangOpts in `ASTUnit::Parse`? https://github.com/llvm/llvm-project/pull/137675 __

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai commented: Also looks like [this assert](https://github.com/llvm/llvm-project/blob/14469a8726fc1d038f41c7e3e29a84ec8f52d013/clang/include/clang/Frontend/ASTUnit.h#L472) doesn't serve its value anymore ```c++ const LangOptions &getLangOpts() const { assert(LangOp

[clang] [clang] Enable making the `CompilerInstance` module dependency collector thread-safe (PR #137227)

2025-04-29 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. https://github.com/llvm/llvm-project/pull/137227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: > Not really, using `LangOptions` directly instead of > `std::unique_ptr` allows reassignment too. I chose > `std::unique_ptr` to: > > * prevent increase of `ASTUnit` size, > * avoid unconditional initialization of `ASTUnit::LangOpts` in the > constructor (which would be an unn

<    1   2   3   4   >