[clang] [clang] Remove unused local variables (NFC) (PR #249464)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 09:50:37 PST 2026


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/249464

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


>From 855396e5d825233ced0e65c2838fe6a149987f9b Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 5 Dec 2026 17:27:17 -0800
Subject: [PATCH] [clang] Remove unused local variables (NFC)

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
---
 clang/lib/CodeGen/CGException.cpp | 1 -
 clang/lib/Driver/Driver.cpp       | 2 --
 clang/lib/Format/Format.cpp       | 1 -
 3 files changed, 4 deletions(-)

diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 75d8a91e034360..84e0827eecb942 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 8ef3f4ac88f928..b383a72b1b725f 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 986994c358dc97..390f03be4bc8a4 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();



More information about the cfe-commits mailing list