[clang] [Sema] Remove an unnecessary cast (NFC) (PR #146622)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 1 20:17:03 PDT 2025


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

Since both alignment and Alignment are of the same type, this patch
renames alignment to Alignment while removing the cast statement.


>From 451762e9cc09176fecbcb68ab5d62be53d3807c7 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 1 Jul 2025 19:42:10 -0700
Subject: [PATCH] [Sema] Remove an unnecessary cast (NFC)

Since both alignment and Alignment are of the same type, this patch
renames alignment to Alignment while removing the cast statement.
---
 clang/lib/Sema/SemaAttr.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index c1675a6c67f14..3eed6ad7fe6b3 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -436,7 +436,7 @@ void Sema::ActOnPragmaClangSection(SourceLocation PragmaLoc,
 }
 
 void Sema::ActOnPragmaPack(SourceLocation PragmaLoc, PragmaMsStackAction Action,
-                           StringRef SlotLabel, Expr *alignment) {
+                           StringRef SlotLabel, Expr *Alignment) {
   bool IsXLPragma = getLangOpts().XLPragmaPack;
   // XL pragma pack does not support identifier syntax.
   if (IsXLPragma && !SlotLabel.empty()) {
@@ -445,7 +445,6 @@ void Sema::ActOnPragmaPack(SourceLocation PragmaLoc, PragmaMsStackAction Action,
   }
 
   const AlignPackInfo CurVal = AlignPackStack.CurrentValue;
-  Expr *Alignment = static_cast<Expr *>(alignment);
 
   // If specified then alignment must be a "small" power of two.
   unsigned AlignmentVal = 0;



More information about the cfe-commits mailing list