File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class TrapArena {
16
16
public:
17
17
template <typename Tag>
18
18
TrapLabel<Tag> allocateLabel () {
19
- return { id_++} ;
19
+ return TrapLabel<Tag>:: unsafeCreateFromExplicitId ( id_++) ;
20
20
}
21
21
};
22
22
Original file line number Diff line number Diff line change @@ -34,16 +34,14 @@ class TrapLabel : public UntypedTrapLabel {
34
34
35
35
using UntypedTrapLabel::UntypedTrapLabel;
36
36
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
-
42
37
public:
43
38
using Tag = TagParam;
44
39
45
40
TrapLabel () = default ;
46
41
42
+ // The caller is responsible for ensuring ID uniqueness.
43
+ static TrapLabel unsafeCreateFromExplicitId (uint64_t id) { return {id}; }
44
+
47
45
template <typename OtherTag>
48
46
TrapLabel (const TrapLabel<OtherTag>& other) : UntypedTrapLabel(other) {
49
47
// 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