[clang] [clang][ScanDeps] Canonicalize -D and -U flags (PR #82298)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 19 18:39:03 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 61ae7e498253d72422cef853798fc2bee1c731cf c89bcfd061066433c90b854ebb0bc369268797ee -- clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp clang/tools/clang-scan-deps/ClangScanDeps.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index 2e2ad5c037..80a01cacee 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -231,9 +231,9 @@ static void canonicalizeDefines(PreprocessorOptions &PPOpts) {
return A.first < B.first;
});
// Keep the last instance of each macro name by going in reverse
- auto NewEnd = std::unique(SimpleNames.rbegin(), SimpleNames.rend(), [](const MacroOpt &A, const MacroOpt &B) {
- return A.first == B.first;
- });
+ auto NewEnd = std::unique(
+ SimpleNames.rbegin(), SimpleNames.rend(),
+ [](const MacroOpt &A, const MacroOpt &B) { return A.first == B.first; });
SimpleNames.erase(SimpleNames.begin(), NewEnd.base());
// Apply permutation.
``````````
</details>
https://github.com/llvm/llvm-project/pull/82298
More information about the cfe-commits
mailing list