[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-11 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo closed https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-10 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +54,185 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-10 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +54,185 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-10 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/8] This commit implements a CC1 flag `-dump-deserialized-d

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-10 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +54,185 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-10 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 01/11] This commit implements a CC1 flag `-dump-deserialized

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-10 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > > > Another thought that crossed my mind is that we are actually heavily > > > optimizing for minimization, but use a name that creates an impression we > > > might care about something else. I don't have great ideas there, but > > > maybe -dump-minimization-hints would be app

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-09 Thread Viktoriia Bakalova via cfe-commits
@@ -121,6 +305,25 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, if (!Consumer) return nullptr; + std::vector> Consumers; + llvm::StringRef DumpDeserializedDeclarationRangesPath = + CI.getFrontendOpts().DumpMinimizationHintsPath; + if (!DumpDe

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-09 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-09 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +54,185 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-09 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +54,185 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] Implement `-dump-minimization-hints` flag. (PR #133910)

2025-04-09 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 01/10] This commit implements a CC1 flag `-dump-deserialized

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/9] This commit implements a CC1 flag `-dump-deserialized-d

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/7] This commit implements a CC1 flag `-dump-deserialized-d

[clang] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/6] This commit implements a CC1 flag `-dump-deserialized-d

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/5] This commit implements a CC1 flag `-dump-deserialized-d

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-08 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH 1/4] This commit implements a CC1 flag `-dump-deserialized-d

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-05 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -7968,6 +7968,10 @@ def print_dependency_directives_minimized_source : Flag<["-"], "print-dependency-directives-minimized-source">, HelpText<"Print the output of the dependency directives source minimizer">; } +def print_deserialized_declarations : Joined<["-"], + "pri

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -121,6 +267,26 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, if (!Consumer) return nullptr; + std::vector> Consumers; VitaNuo wrote: Done. https://github.com/llvm/llvm-project/pull/133910 ___

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > Thanks, the implementation mostly looks good. I've left a lot of comments, > but they are mostly NITs. One major thing that we need to change is the way > we test this, see the comment about relying on jq. Sure, changed to `FileCheck`. > Another thought that crossed my mind i

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -121,6 +267,26 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, if (!Consumer) return nullptr; + std::vector> Consumers; VitaNuo wrote: The constructor of `MultiplexConsumer` won't take a `SmallVector`. https://github.com/llvm/llv

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,150 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// DeserializedDeclsLineRangePrinter dumps ranges of deserialized declarations +/// to aid debugging and bug minimization. It implements ASTConsumer and +/// ASTDeserializationListener, so tha

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From cfa057b4d43ebe7f94ccd4f387a94359beaa29b2 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 17:45:24 +0200 Subject: [PATCH] This commit implements a CC1 flag `-dump-deserialized-decla

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From 6d61256a73c64ef4351266d6ef76067f5a2568db Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 13:40:55 +0200 Subject: [PATCH 1/2] [WIP] Implement -dump-deserialized-declaration-ranges f

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From 6d61256a73c64ef4351266d6ef76067f5a2568db Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 13:40:55 +0200 Subject: [PATCH 1/3] [WIP] Implement -dump-deserialized-declaration-ranges f

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -139,16 +283,17 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, return nullptr; // If there are no registered plugins we don't need to wrap the consumer - if (FrontendPluginRegistry::begin() == FrontendPluginRegistry::end()) -return Consumer; +

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,135 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// Dumps deserialized declarations. VitaNuo wrote: Yes, sorry, I responded to the comment before pushing the actual change. https://github.com/llvm/llvm-project/pull/133910

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-04 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/133910 >From 6d61256a73c64ef4351266d6ef76067f5a2568db Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Fri, 4 Apr 2025 13:40:55 +0200 Subject: [PATCH] [WIP] Implement -dump-deserialized-declaration-ranges flag t

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,135 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// Dumps deserialized declarations. VitaNuo wrote: > If you want, you might use a comment to explain other non-trivial details, > though, e.g. how the class must be used or

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/133910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
@@ -139,16 +283,17 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, return nullptr; // If there are no registered plugins we don't need to wrap the consumer - if (FrontendPluginRegistry::begin() == FrontendPluginRegistry::end()) -return Consumer; +

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
@@ -121,6 +252,19 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, if (!Consumer) return nullptr; + std::vector> Consumers; + llvm::StringRef PrintDeserializedDeclarationsPath = CI.getFrontendOpts().PrintDeserializedDeclarationsPath; + if (!PrintDes

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
@@ -121,6 +252,19 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, if (!Consumer) return nullptr; + std::vector> Consumers; + llvm::StringRef PrintDeserializedDeclarationsPath = CI.getFrontendOpts().PrintDeserializedDeclarationsPath; + if (!PrintDes

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
@@ -7968,6 +7968,10 @@ def print_dependency_directives_minimized_source : Flag<["-"], "print-dependency-directives-minimized-source">, HelpText<"Print the output of the dependency directives source minimizer">; } +def print_deserialized_declarations : Joined<["-"], + "pri

[clang] [WIP] Implement `print-deserialized-declarations` flag to dump source… (PR #133910)

2025-04-03 Thread Viktoriia Bakalova via cfe-commits
@@ -49,6 +51,135 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry) namespace { +/// Dumps deserialized declarations. +class DeserializedDeclsLineRangePrinter : public DelegatingDeserializationListener, public ASTConsumer { +public: + explicit DeserializedDeclsLineRangePr

[clang] [clang] Fix the crash when dumping deserialized decls (PR #133395)

2025-03-28 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo approved this pull request. Thank you @hokein! https://github.com/llvm/llvm-project/pull/133395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-01-27 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > If anyone wants to take over/help, feel free to do so. SGTM. I could reproduce the issue, but then ran out of capacity. I'm not sure I'll be able to prioritize this soon vs. the module-related work. https://github.com/llvm/llvm-project/pull/118480

[clang] Revert "[Modules] Delay deserialization of preferred_name attribute at r…" (PR #123962)

2025-01-22 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo created https://github.com/llvm/llvm-project/pull/123962 Reverts llvm/llvm-project#122726 We're seeing a 8-10% performance regression due to this patch. >From 1d94f0a4598ec08cd75fb7c1c7353ce318da2472 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova <115406782+vita..

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-17 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo closed https://github.com/llvm/llvm-project/pull/122726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > need to pass -std=c++20. > passing -DLLVM_USE_SANITIZER=Address in your cmake configuration should be > enough for that. Makes sense, I could reproduce the example. https://github.com/llvm/llvm-project/pull/118480 ___ cfe-commits mai

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH 1/7] [WIP][Modules] Delay deserialization of preferred_name

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH 1/6] [WIP][Modules] Delay deserialization of preferred_name

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: Thank you for the review @ChuanqiXu9! > (1) Hardcoding is generally not good. And even if we have to, e.g., (we don't > have an automatic mechanism to check if we need to defer an attribute), let's > avoid hardcoding in both reader side and writer side. We can make this by > ad

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH 1/5] [WIP][Modules] Delay deserialization of preferred_name

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
@@ -10079,6 +10079,11 @@ void ASTReader::finishPendingActions() { } PendingDeducedVarTypes.clear(); +// Load the delayed preferred name attributes. +for (unsigned I = 0; I != PendingDeferredAttributes.size(); ++I) + loadDeferredAttribute(PendingDeferredAtt

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
@@ -3159,13 +3164,36 @@ Attr *ASTRecordReader::readAttr() { return New; } -/// Reads attributes from the current stream position. -void ASTRecordReader::readAttributes(AttrVec &Attrs) { +/// Reads attributes from the current stream position, advancing Idx. +/// For some attr

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
@@ -3159,13 +3164,36 @@ Attr *ASTRecordReader::readAttr() { return New; } -/// Reads attributes from the current stream position. -void ASTRecordReader::readAttributes(AttrVec &Attrs) { +/// Reads attributes from the current stream position, advancing Idx. +/// For some attr

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH 1/4] [WIP][Modules] Delay deserialization of preferred_name

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-16 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH 1/3] [WIP][Modules] Delay deserialization of preferred_name

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > Here's a small reprocase (thanks to cvise for getting it) The repro doesn't compile in this shape, I've changed it to ``` template constexpr InputIterator find_if(InputIterator first, Predicate pred) { if (pred(*first)) ; return first; } template struct basic_string_

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > The code in https://github.com/llvm/llvm-project/pull/122726 looks better. I > didn't do detailed review since it is marked WIP. It's not WIP anymore. Feel free to review, thanks a lot in advance! https://github.com/llvm/llvm-project/pull/122250 ___

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/122726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo closed https://github.com/llvm/llvm-project/pull/122250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/122250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -3129,42 +3129,86 @@ class AttrReader { OMPTraitInfo *readOMPTraitInfo() { return Reader.readOMPTraitInfo(); } template T *readDeclAs() { return Reader.readDeclAs(); } + + AttributeCommonInfo readAttributeCommonInfo() { +IdentifierInfo *AttrName = readIdentifier()

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/122250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -9860,6 +9860,33 @@ void ASTReader::finishPendingActions() { } PendingDeducedVarTypes.clear(); +ASTContext &Context = getContext(); +for (unsigned I = 0; I != PendingPreferredNameAttributes.size(); ++I) { + auto *D = PendingPreferredNameAttributes[I].D;

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -337,6 +337,14 @@ class ASTRecordReader /// Reads attributes from the current stream position, advancing Idx. void readAttributes(AttrVec &Attrs); + /// Reads one attribute from the current stream position, advancing Idx. + /// Parent Decl is provided to delay attribu

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -1156,6 +1158,19 @@ class ASTReader SmallVector, 16> PendingDeducedVarTypes; + struct PendingPreferredNameAttribute { +Decl *D; +AttributeCommonInfo Info; +serialization::TypeID TypeID; +bool isInherited; +bool isImplicit; +bool isPackExpans

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -3129,42 +3129,86 @@ class AttrReader { OMPTraitInfo *readOMPTraitInfo() { return Reader.readOMPTraitInfo(); } template T *readDeclAs() { return Reader.readDeclAs(); } + + AttributeCommonInfo readAttributeCommonInfo() { +IdentifierInfo *AttrName = readIdentifier()

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > BTW, it is better to have better explanation in the summary. I know you > explained it in the issue. But it will be better for other readers after you > land the PR. Thanks @ChuanqiXu9, I have added a detailed summary https://github.com/llvm/llvm-project/pull/122726. After s

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > Can you add more details to the patch summary explaining why the changes are > needed? That makes it easier for folks to review the patch but also helps us > in the future when digging through historical changes. Thanks! Sure, thank you for the comment. https://github.com/llv

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/122726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH 1/2] [WIP][Modules] Delay deserialization of preferred_name

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From b61110999596363bafdc94904356840febfcfaa5 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Tue, 14 Jan 2025 14:00:48 +0100 Subject: [PATCH] [WIP][Modules] Delay deserialization of preferred_name att

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo edited https://github.com/llvm/llvm-project/pull/122726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -3134,6 +3139,17 @@ Attr *ASTRecordReader::readAttr() { // Kind is stored as a 1-based integer because 0 is used to indicate a null // Attr pointer. auto Kind = static_cast(V - 1); + if (Kind == attr::PreferredName && D != nullptr) { +if (D != nullptr) { -

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -4424,6 +4454,51 @@ void ASTReader::loadPendingDeclChain(Decl *FirstLocal, uint64_t LocalOffset) { ASTDeclReader::attachLatestDecl(CanonDecl, MostRecent); } +void ASTReader::loadPreferredNameAttribute( +const PendingPreferredNameAttribute &PreferredNameAttribute) { +

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
@@ -4925,6 +4930,11 @@ void ASTRecordWriter::AddAttr(const Attr *A) { Record.push_back(A->isRegularKeywordAttribute()); #include "clang/Serialization/AttrPCHWrite.inc" + + if (A->getKind() == attr::PreferredName) +// Record the actual size of preferred_name attribute (-

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-14 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: > The code in https://github.com/llvm/llvm-project/pull/122726 looks better. I > didn't do detailed review since it is marked WIP. Thanks for the feedback. I will then try to generalize https://github.com/llvm/llvm-project/pull/122726 to delay all/multiple attributes. Dependin

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-13 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: I have pushed an alternative approach (reading the attribute at record level) to https://github.com/llvm/llvm-project/pull/122726. If we agree that this approach is the one to go in general, I can try to generalize it to multiple attributes. https://github.com/llvm/llvm-project/

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-13 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122726 >From 4266533a27b7ecafb96df081682ce0ae8fd32584 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Mon, 13 Jan 2025 16:26:32 +0100 Subject: [PATCH 1/2] [WIP][Modules] Delay deserialization of preferred_name

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-13 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo created https://github.com/llvm/llvm-project/pull/122726 …ecord level. >From 4266533a27b7ecafb96df081682ce0ae8fd32584 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Mon, 13 Jan 2025 16:26:32 +0100 Subject: [PATCH] [WIP][Modules] Delay deserialization of pref

[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-13 Thread Viktoriia Bakalova via cfe-commits
VitaNuo wrote: Alternative approach to https://github.com/llvm/llvm-project/pull/122250. https://github.com/llvm/llvm-project/pull/122726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-10 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122250 >From 0a615576181a538bc0d8eff6499ad87cbdeb89c3 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Thu, 9 Jan 2025 09:36:35 +0100 Subject: [PATCH 1/8] [WIP] Delay reading type source info of the preferred_n

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-10 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122250 >From 0a615576181a538bc0d8eff6499ad87cbdeb89c3 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Thu, 9 Jan 2025 09:36:35 +0100 Subject: [PATCH 1/7] [WIP] Delay reading type source info of the preferred_n

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-10 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122250 >From 0a615576181a538bc0d8eff6499ad87cbdeb89c3 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Thu, 9 Jan 2025 09:36:35 +0100 Subject: [PATCH 1/6] [WIP] Delay reading type source info of the preferred_n

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-09 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122250 >From 0a615576181a538bc0d8eff6499ad87cbdeb89c3 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Thu, 9 Jan 2025 09:36:35 +0100 Subject: [PATCH 1/5] [WIP] Delay reading type source info of the preferred_n

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-09 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122250 >From 0a615576181a538bc0d8eff6499ad87cbdeb89c3 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Thu, 9 Jan 2025 09:36:35 +0100 Subject: [PATCH 1/4] [WIP] Delay reading type source info of the preferred_n

[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)

2025-01-09 Thread Viktoriia Bakalova via cfe-commits
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/122250 >From 0a615576181a538bc0d8eff6499ad87cbdeb89c3 Mon Sep 17 00:00:00 2001 From: Viktoriia Bakalova Date: Thu, 9 Jan 2025 09:36:35 +0100 Subject: [PATCH 1/2] [WIP] Delay reading type source info of the preferred_n

  1   2   3   >