[clang] [clang] Remove unused local variables (NFC) (PR #249464)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 6 09:51:12 PST 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-format
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
This patch removes unused local variables across clang/.
Note that these variables do not trigger -Wunused-variable because
their types have non-trivial constructors or destructors. Their
initializers have no side effects on surrounding state.
Assisted-by: Antigravity
---
Full diff: https://github.com/llvm/llvm-project/pull/249464.diff
3 Files Affected:
- (modified) clang/lib/CodeGen/CGException.cpp (-1)
- (modified) clang/lib/Driver/Driver.cpp (-2)
- (modified) clang/lib/Format/Format.cpp (-1)
``````````diff
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 75d8a91e03436..84e0827eecb94 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -599,7 +599,6 @@ CodeGenFunction::getFuncletEHDispatchBlock(EHScopeStack::stable_iterator SI) {
DispatchBlock = getTerminateFunclet();
else
DispatchBlock = createBasicBlock();
- CGBuilderTy Builder(CGM, DispatchBlock);
switch (EHS.getKind()) {
case EHScope::Catch:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 8ef3f4ac88f92..b383a72b1b725 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3684,8 +3684,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
if (PL.empty())
continue;
- auto FullPL = types::getCompilationPhases(InputType);
-
// Build the pipeline for this file.
Action *Current = C.MakeAction<InputAction>(*InputArg, InputType);
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 986994c358dc9..390f03be4bc8a 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -3688,7 +3688,6 @@ static void sortCppIncludes(const FormatStyle &Style,
ArrayRef<tooling::Range> Ranges, StringRef FileName,
StringRef Code, tooling::Replacements &Replaces,
unsigned *Cursor) {
- tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName);
const unsigned IncludesBeginOffset = Includes.front().Offset;
const unsigned IncludesEndOffset =
Includes.back().Offset + Includes.back().Text.size();
``````````
</details>
https://github.com/llvm/llvm-project/pull/249464
More information about the cfe-commits
mailing list