File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class TrapArena {
1616 public:
1717 template <typename Tag>
1818 TrapLabel<Tag> allocateLabel () {
19- return { id_++} ;
19+ return TrapLabel<Tag>:: unsafeCreateFromExplicitId ( id_++) ;
2020 }
2121};
2222
Original file line number Diff line number Diff line change @@ -34,16 +34,14 @@ class TrapLabel : public UntypedTrapLabel {
3434
3535 using UntypedTrapLabel::UntypedTrapLabel;
3636
37- // we want one authority tasked with creating labels to avoid conflicts, having access to the
38- // private constructor
39- // this is the TrapArena class for the moment
40- friend class TrapArena ;
41-
4237 public:
4338 using Tag = TagParam;
4439
4540 TrapLabel () = default ;
4641
42+ // The caller is responsible for ensuring ID uniqueness.
43+ static TrapLabel unsafeCreateFromExplicitId (uint64_t id) { return {id}; }
44+
4745 template <typename OtherTag>
4846 TrapLabel (const TrapLabel<OtherTag>& other) : UntypedTrapLabel(other) {
4947 // we temporarily need to bypass the label type system for unknown AST nodes and types
You can’t perform that action at this time.
0 commit comments