@@ -2,7 +2,7 @@ mod context;
2
2
3
3
use context:: Ctx ;
4
4
pub use context:: { CtxCursor , CtxFlags } ;
5
- use oxc_syntax:: node:: AstNodeId ;
5
+ use oxc_syntax:: node:: NodeId ;
6
6
use petgraph:: Direction ;
7
7
8
8
use super :: {
@@ -107,11 +107,11 @@ impl<'a> ControlFlowGraphBuilder<'a> {
107
107
self . graph . add_edge ( a, b, weight) ;
108
108
}
109
109
110
- pub fn push_statement ( & mut self , stmt : AstNodeId ) {
110
+ pub fn push_statement ( & mut self , stmt : NodeId ) {
111
111
self . push_instruction ( InstructionKind :: Statement , Some ( stmt) ) ;
112
112
}
113
113
114
- pub fn push_return ( & mut self , kind : ReturnInstructionKind , node : AstNodeId ) {
114
+ pub fn push_return ( & mut self , kind : ReturnInstructionKind , node : NodeId ) {
115
115
self . push_instruction ( InstructionKind :: Return ( kind) , Some ( node) ) ;
116
116
}
117
117
@@ -166,20 +166,20 @@ impl<'a> ControlFlowGraphBuilder<'a> {
166
166
) ;
167
167
}
168
168
169
- pub fn append_condition_to ( & mut self , block : BasicBlockId , node : Option < AstNodeId > ) {
169
+ pub fn append_condition_to ( & mut self , block : BasicBlockId , node : Option < NodeId > ) {
170
170
self . push_instruction_to ( block, InstructionKind :: Condition , node) ;
171
171
}
172
172
173
- pub fn append_iteration ( & mut self , node : Option < AstNodeId > , kind : IterationInstructionKind ) {
173
+ pub fn append_iteration ( & mut self , node : Option < NodeId > , kind : IterationInstructionKind ) {
174
174
self . push_instruction ( InstructionKind :: Iteration ( kind) , node) ;
175
175
}
176
176
177
- pub fn append_throw ( & mut self , node : AstNodeId ) {
177
+ pub fn append_throw ( & mut self , node : NodeId ) {
178
178
self . push_instruction ( InstructionKind :: Throw , Some ( node) ) ;
179
179
self . append_unreachable ( ) ;
180
180
}
181
181
182
- pub fn append_break ( & mut self , node : AstNodeId , label : Option < & ' a str > ) {
182
+ pub fn append_break ( & mut self , node : NodeId , label : Option < & ' a str > ) {
183
183
let kind = match label {
184
184
Some ( _) => LabeledInstruction :: Labeled ,
185
185
None => LabeledInstruction :: Unlabeled ,
@@ -193,7 +193,7 @@ impl<'a> ControlFlowGraphBuilder<'a> {
193
193
self . ctx ( label) . r#break ( bb) ;
194
194
}
195
195
196
- pub fn append_continue ( & mut self , node : AstNodeId , label : Option < & ' a str > ) {
196
+ pub fn append_continue ( & mut self , node : NodeId , label : Option < & ' a str > ) {
197
197
let kind = match label {
198
198
Some ( _) => LabeledInstruction :: Labeled ,
199
199
None => LabeledInstruction :: Unlabeled ,
@@ -221,7 +221,7 @@ impl<'a> ControlFlowGraphBuilder<'a> {
221
221
222
222
/// # Panics
223
223
#[ inline]
224
- pub ( self ) fn push_instruction ( & mut self , kind : InstructionKind , node_id : Option < AstNodeId > ) {
224
+ pub ( self ) fn push_instruction ( & mut self , kind : InstructionKind , node_id : Option < NodeId > ) {
225
225
self . push_instruction_to ( self . current_node_ix , kind, node_id) ;
226
226
}
227
227
@@ -230,12 +230,12 @@ impl<'a> ControlFlowGraphBuilder<'a> {
230
230
& mut self ,
231
231
block : BasicBlockId ,
232
232
kind : InstructionKind ,
233
- node_id : Option < AstNodeId > ,
233
+ node_id : Option < NodeId > ,
234
234
) {
235
235
self . basic_block_mut ( block) . instructions . push ( Instruction { kind, node_id } ) ;
236
236
}
237
237
238
- pub fn enter_statement ( & mut self , stmt : AstNodeId ) {
238
+ pub fn enter_statement ( & mut self , stmt : NodeId ) {
239
239
self . push_statement ( stmt) ;
240
240
}
241
241
}
0 commit comments