[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu closed https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Qiongsi Wu via cfe-commits
@@ -397,9 +397,91 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) { } } +static bool isSafeToIgnoreCWD(const CowCompilerInvocation &CI) { + // Check if the command line input uses relative paths. + // It is not safe to ignore the current wo

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Qiongsi Wu via cfe-commits
@@ -63,7 +63,10 @@ enum class ScanningOptimizations { /// Canonicalize -D and -U options. Macros = 8, - DSS_LAST_BITMASK_ENUM(Macros), + /// Ignore the compiler's working directory if it is safe. + IgnoreCWD = 0x10, qiongsiwu wrote: Fixed! Thanks! ht

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/124786 >From 7060564de1bb6062639f4b4839fa17958f212755 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Mon, 27 Jan 2025 16:44:30 -0800 Subject: [PATCH 1/5] Initial implementation of clang modules current working dire

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan edited https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Steven Wu via cfe-commits
@@ -63,7 +63,10 @@ enum class ScanningOptimizations { /// Canonicalize -D and -U options. Macros = 8, - DSS_LAST_BITMASK_ENUM(Macros), + /// Ignore the compiler's working directory if it is safe. + IgnoreCWD = 0x10, cachemeifyoucan wrote: Nit: maybe up

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan approved this pull request. LGTM with some small style comments. https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Steven Wu via cfe-commits
@@ -397,9 +397,91 @@ void ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) { } } +static bool isSafeToIgnoreCWD(const CowCompilerInvocation &CI) { + // Check if the command line input uses relative paths. + // It is not safe to ignore the current wo

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. Looks good, thanks! https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-03 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: Gentle ping for review. Thanks! https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-01 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/124786 >From 7060564de1bb6062639f4b4839fa17958f212755 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Mon, 27 Jan 2025 16:44:30 -0800 Subject: [PATCH 1/4] Initial implementation of clang modules current working dire

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-30 Thread Michael Spencer via cfe-commits
Bigcheese wrote: It has to happen after the header search optimization in case that removes relative header search paths. https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-30 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan commented: Is it better if this optimization happens really early in the process since you only visit all the options in CI? In that case, you can just reset the `CurrentWorkingDirectory` in the VFS so all the searching is done without CWD. This avoids any ha

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-30 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu ready_for_review https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-30 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/124786 >From 7060564de1bb6062639f4b4839fa17958f212755 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Mon, 27 Jan 2025 16:44:30 -0800 Subject: [PATCH 1/3] Initial implementation of clang modules current working dire

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-29 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese requested changes to this pull request. This looks like the right approach, but I think it would be good to have a test for the relative path checking. Not every option needs a test, just one should be fine. https://github.com/llvm/llvm-project/pull/124786

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-28 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/124786 >From 7060564de1bb6062639f4b4839fa17958f212755 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Mon, 27 Jan 2025 16:44:30 -0800 Subject: [PATCH 1/2] Initial implementation of clang modules current working dire

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-28 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu converted_to_draft https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-28 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu created https://github.com/llvm/llvm-project/pull/124786 When computing the context hash, `clang` always includes the compiler's working directory. This can lead to situations when the only difference between two compilations is the working directory, different mod

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-28 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff ba6774f997ee28157b0a3b8816cc76b94ed1da17 7060564de1bb6062639f4b4839fa17958f212755 --e

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qiongsi Wu (qiongsiwu) Changes When computing the context hash, `clang` always includes the compiler's working directory. This can lead to situations when the only difference between two compilations is the working directory, different mo