[llvm] [CFIFixup] Add a default constructor to BlockFlags (NFC) (PR #125281)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 12:11:22 PST 2025


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

This patch adds a default constructor to BlockFlags to initialize its
members to false.


>From 538ef6a53b284398a0387d00c0ad097ce49e907f Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 31 Jan 2025 11:57:14 -0800
Subject: [PATCH] [CFIFixup] Add a default constructor to BlockFlags (NFC)

This patch adds a default constructor to BlockFlags to initialize its
members to false.
---
 llvm/lib/CodeGen/CFIFixup.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/CFIFixup.cpp b/llvm/lib/CodeGen/CFIFixup.cpp
index 86a52cea320d29..e62308e9f587e0 100644
--- a/llvm/lib/CodeGen/CFIFixup.cpp
+++ b/llvm/lib/CodeGen/CFIFixup.cpp
@@ -131,6 +131,9 @@ struct BlockFlags {
   bool StrongNoFrameOnEntry : 1;
   bool HasFrameOnEntry : 1;
   bool HasFrameOnExit : 1;
+  BlockFlags()
+      : Reachable(false), StrongNoFrameOnEntry(false), HasFrameOnEntry(false),
+        HasFrameOnExit(false) {}
 };
 
 // Computes the frame information for each block in the function. Frame info
@@ -138,8 +141,7 @@ struct BlockFlags {
 static SmallVector<BlockFlags>
 computeBlockInfo(const MachineFunction &MF,
                  const MachineBasicBlock *PrologueBlock) {
-  SmallVector<BlockFlags, 32> BlockInfo(MF.getNumBlockIDs(),
-                                        {false, false, false, false});
+  SmallVector<BlockFlags, 32> BlockInfo(MF.getNumBlockIDs());
   BlockInfo[0].Reachable = true;
   BlockInfo[0].StrongNoFrameOnEntry = true;
 



More information about the llvm-commits mailing list