[clang] 8d6841f - [Clang][NFC][ByteCode] Initialize Function HasBody in constructor (#143443)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 08:32:57 PDT 2025
Author: Shafik Yaghmour
Date: 2025-06-10T08:32:54-07:00
New Revision: 8d6841f280abc55d4a4fdcfd5eb4a69edb544c03
URL: https://github.com/llvm/llvm-project/commit/8d6841f280abc55d4a4fdcfd5eb4a69edb544c03
DIFF: https://github.com/llvm/llvm-project/commit/8d6841f280abc55d4a4fdcfd5eb4a69edb544c03.diff
LOG: [Clang][NFC][ByteCode] Initialize Function HasBody in constructor (#143443)
Static analysis flagged HasBody as not being initialized during
construction. It looks like an oversight in:
https://github.com/llvm/llvm-project/pull/139671
This would be a lot simpler with C++20 which allows in class
initialization of bit-fields.
Added:
Modified:
clang/lib/AST/ByteCode/Function.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/Function.cpp b/clang/lib/AST/ByteCode/Function.cpp
index 9eb6744ea47ad..0e639df3cafba 100644
--- a/clang/lib/AST/ByteCode/Function.cpp
+++ b/clang/lib/AST/ByteCode/Function.cpp
@@ -23,7 +23,7 @@ Function::Function(Program &P, FunctionDeclTy Source, unsigned ArgSize,
ParamTypes(std::move(ParamTypes)), Params(std::move(Params)),
ParamOffsets(std::move(ParamOffsets)), IsValid(false),
IsFullyCompiled(false), HasThisPointer(HasThisPointer), HasRVO(HasRVO),
- Defined(false) {
+ HasBody(false), Defined(false) {
if (const auto *F = dyn_cast<const FunctionDecl *>(Source)) {
Variadic = F->isVariadic();
Immediate = F->isImmediateFunction();
More information about the cfe-commits
mailing list