================
@@ -57,12 +57,15 @@ class CFGElement {
   enum Kind {
     // main kind
     Initializer,
-    ScopeBegin,
-    ScopeEnd,
     NewAllocator,
-    LifetimeEnds,
     LoopExit,
     FullExprCleanup,
+    // scope marker kind
+    ScopeBegin,
+    ScopeEnd,
+    LifetimeEnds,
+    SCOPE_BEGIN = ScopeBegin,
+    SCOPE_END = LifetimeEnds,
----------------
necto wrote:

As far as I can tell, no, these particular `Kind`s (ScopeBegin, ScopeEnd, 
LifetimeEnds, NewAllocator, LoopExit, FullExprCleanup) were order-agnostic.
Before this patch, only elements between `Statement` and `CXXRecordTypedCall`; 
and elements between `AutomaticObjectDtor` and `TemporaryDtor` were dependent 
on being in a contiguous range. After this patch same applies to elements 
between `ScopeBegin` and `LifetimeEnds`.
Otherwise, all uses of this enum values were used for their absolute value and 
compared only for equality.

There is a nontrivial constraint on the number of bits: all kinds must fit into 
4 bits that are broken across Data1 and Data2. Fortunately, I do not need to 
add any new kind, or otherwise change the integer range.

https://github.com/llvm/llvm-project/pull/201123
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to