@@ -48,10 +48,6 @@ pub trait CtxCursor {
48
48
fn r#break ( self , bb : BasicBlockId ) -> Self ;
49
49
/// Creates a continue entry in the current context.
50
50
fn r#continue ( self , bb : BasicBlockId ) -> Self ;
51
- /// Allow break entries in this context.
52
- fn allow_break ( self ) -> Self ;
53
- /// Allow continue entries in this context.
54
- fn allow_continue ( self ) -> Self ;
55
51
}
56
52
57
53
pub struct QueryCtx < ' a , ' c > ( & ' c mut ControlFlowGraphBuilder < ' a > , /* label */ Option < & ' a str > ) ;
@@ -86,20 +82,6 @@ impl<'a, 'c> CtxCursor for QueryCtx<'a, 'c> {
86
82
} ) ;
87
83
self
88
84
}
89
-
90
- fn allow_break ( self ) -> Self {
91
- self . 0 . in_continue_context ( self . 1 , |ctx| {
92
- ctx. flags . insert ( CtxFlags :: BREAK ) ;
93
- } ) ;
94
- self
95
- }
96
-
97
- fn allow_continue ( self ) -> Self {
98
- self . 0 . in_continue_context ( self . 1 , |ctx| {
99
- ctx. flags . insert ( CtxFlags :: CONTINUE ) ;
100
- } ) ;
101
- self
102
- }
103
85
}
104
86
105
87
impl < ' a , ' c > QueryCtx < ' a , ' c > {
@@ -192,6 +174,19 @@ impl<'a, 'c> QueryCtx<'a, 'c> {
192
174
193
175
pub struct RefCtxCursor < ' a , ' c > ( & ' c mut Ctx < ' a > ) ;
194
176
177
+ impl < ' a , ' c > RefCtxCursor < ' a , ' c > {
178
+ /// Allow break entries in this context.
179
+ pub fn allow_break ( self ) -> Self {
180
+ self . 0 . flags . insert ( CtxFlags :: BREAK ) ;
181
+ self
182
+ }
183
+ /// Allow continue entries in this context.
184
+ pub fn allow_continue ( self ) -> Self {
185
+ self . 0 . flags . insert ( CtxFlags :: CONTINUE ) ;
186
+ self
187
+ }
188
+ }
189
+
195
190
impl < ' a , ' c > CtxCursor for RefCtxCursor < ' a , ' c > {
196
191
fn mark_break ( self , jmp_pos : BasicBlockId ) -> Self {
197
192
debug_assert ! ( self . 0 . break_jmp. is_none( ) ) ;
@@ -214,16 +209,6 @@ impl<'a, 'c> CtxCursor for RefCtxCursor<'a, 'c> {
214
209
self . 0 . r#continue ( bb) ;
215
210
self
216
211
}
217
-
218
- fn allow_break ( self ) -> Self {
219
- self . 0 . flags . insert ( CtxFlags :: BREAK ) ;
220
- self
221
- }
222
-
223
- fn allow_continue ( self ) -> Self {
224
- self . 0 . flags . insert ( CtxFlags :: CONTINUE ) ;
225
- self
226
- }
227
212
}
228
213
229
214
impl < ' a > ControlFlowGraphBuilder < ' a > {
0 commit comments