[clang] fedbd3b - [CIR][NFC] Fix compilation error CIRGenModule (#224694)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 11:52:44 PDT 2026
Author: Amr Hesham
Date: 2026-09-18T18:52:38Z
New Revision: fedbd3bdbe650fce8fe92a020698cc2db55a4ed7
URL: https://github.com/llvm/llvm-project/commit/fedbd3bdbe650fce8fe92a020698cc2db55a4ed7
DIFF: https://github.com/llvm/llvm-project/commit/fedbd3bdbe650fce8fe92a020698cc2db55a4ed7.diff
LOG: [CIR][NFC] Fix compilation error CIRGenModule (#224694)
Fix deduced conflicting types for parameter when calling std::max with
unsigned long and unsigned long long, can be fixed by
`std::max(f.getAlignment().value_or(1), 2ull)` but in this line, the
alignment is always less than 2 because of the parent if condition, so
max is always 2
Added:
Modified:
clang/lib/CIR/CodeGen/CIRGenModule.cpp
Removed:
################################################################################
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index ccb4525e2632c..0ec24e963e5ab 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -3401,7 +3401,7 @@ void CIRGenModule::setCIRFunctionAttributesForDefinition(
// member function, set its alignment accordingly.
if (getTarget().getCXXABI().areMemberFunctionsAligned()) {
if (isa<CXXMethodDecl>(decl) && f.getAlignment().value_or(1) < 2)
- f.setAlignment(std::max(2ul, f.getAlignment().value_or(1)));
+ f.setAlignment(2);
}
}
More information about the cfe-commits
mailing list