@@ -50,9 +50,9 @@ class Block final {
5050
5151public:
5252 // / Creates a new block.
53- Block (unsigned EvalID, const std::optional< unsigned > &DeclID ,
54- const Descriptor *Desc , bool IsStatic = false , bool IsExtern = false ,
55- bool IsWeak = false , bool IsDummy = false )
53+ Block (unsigned EvalID, UnsignedOrNone DeclID, const Descriptor *Desc ,
54+ bool IsStatic = false , bool IsExtern = false , bool IsWeak = false ,
55+ bool IsDummy = false )
5656 : Desc(Desc), DeclID(DeclID), EvalID(EvalID), IsStatic(IsStatic) {
5757 assert (Desc);
5858 AccessFlags |= (ExternFlag * IsExtern);
@@ -62,8 +62,7 @@ class Block final {
6262
6363 Block (unsigned EvalID, const Descriptor *Desc, bool IsStatic = false ,
6464 bool IsExtern = false , bool IsWeak = false , bool IsDummy = false )
65- : Desc(Desc), DeclID((unsigned )-1 ), EvalID(EvalID), IsStatic(IsStatic),
66- IsDynamic (false ) {
65+ : Desc(Desc), EvalID(EvalID), IsStatic(IsStatic), IsDynamic(false ) {
6766 assert (Desc);
6867 AccessFlags |= (ExternFlag * IsExtern);
6968 AccessFlags |= (WeakFlag * IsWeak);
@@ -87,7 +86,7 @@ class Block final {
8786 // / Returns the size of the block.
8887 unsigned getSize () const { return Desc->getAllocSize (); }
8988 // / Returns the declaration ID.
90- std::optional< unsigned > getDeclID () const { return DeclID; }
89+ UnsignedOrNone getDeclID () const { return DeclID; }
9190 // / Returns whether the data of this block has been initialized via
9291 // / invoking the Ctor func.
9392 bool isInitialized () const { return IsInitialized; }
@@ -177,7 +176,7 @@ class Block final {
177176 // / Start of the chain of pointers.
178177 Pointer *Pointers = nullptr ;
179178 // / Unique identifier of the declaration.
180- std::optional< unsigned > DeclID ;
179+ UnsignedOrNone DeclID = std::nullopt ;
181180 const unsigned EvalID = ~0u ;
182181 // / Flag indicating if the block has static storage duration.
183182 bool IsStatic = false ;
0 commit comments