diff mbox series

[committed] d: Use `int` to store class and struct flags

Message ID 20210829163400.2036601-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] d: Use `int` to store class and struct flags | expand

Commit Message

Iain Buclaw Aug. 29, 2021, 4:34 p.m. UTC
Hi,

This patch replaces ClassFlags and StructFlags with an int.  In the D
implementation of the D front-end, this type has been changed to an
`enum class`.

Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32,
committed to mainline.

Regards,
Iain

---
gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::visit(TypeInfoClassDeclaration *)):
	Use int to store type flags.
	(TypeInfoVisitor::visit(TypeInfoStructDeclaration *)): Likewise.
---
 gcc/d/typeinfo.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index 978c73e65f6..04e228abf7c 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -868,7 +868,7 @@  public:
 	this->layout_field (inv);
 
 	/* ClassFlags m_flags;  */
-	ClassFlags::Type flags = ClassFlags::hasOffTi;
+	int flags = ClassFlags::hasOffTi;
 	if (cd->isCOMclass ())
 	  flags |= ClassFlags::isCOMclass;
 
@@ -962,7 +962,7 @@  public:
 	this->layout_field (null_pointer_node);
 
 	/* ClassFlags m_flags;  */
-	ClassFlags::Type flags = ClassFlags::hasOffTi;
+	int flags = ClassFlags::hasOffTi;
 	flags |= ClassFlags::hasTypeInfo;
 	if (cd->isCOMinterface ())
 	  flags |= ClassFlags::isCOMclass;
@@ -1091,7 +1091,7 @@  public:
       this->layout_field (null_pointer_node);
 
     /* StructFlags m_flags;  */
-    StructFlags::Type m_flags = 0;
+    int m_flags = StructFlags::none;
     if (ti->hasPointers ())
       m_flags |= StructFlags::hasPointers;
     this->layout_field (build_integer_cst (m_flags, d_uint_type));