mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:02:46 +00:00 
			
		
		
		
	JSSpecCompiler: Add control flow graph simplification pass
It removes empty `BasicBlock`s with an unconditional jump continuation and then removes unreferenced blocks from the graph.
This commit is contained in:
		
							parent
							
								
									475ef6965a
								
							
						
					
					
						commit
						12072dbac5
					
				
					 7 changed files with 215 additions and 1 deletions
				
			
		|  | @ -31,6 +31,16 @@ void NodeSubtreePointer::replace_subtree(Badge<RecursiveASTVisitor>, NullableTre | |||
|         }); | ||||
| } | ||||
| 
 | ||||
| Vector<BasicBlockRef*> ControlFlowJump::references() | ||||
| { | ||||
|     return { &m_block }; | ||||
| } | ||||
| 
 | ||||
| Vector<BasicBlockRef*> ControlFlowBranch::references() | ||||
| { | ||||
|     return { &m_then, &m_else }; | ||||
| } | ||||
| 
 | ||||
| Vector<NodeSubtreePointer> BinaryOperation::subtrees() | ||||
| { | ||||
|     return { { &m_left }, { &m_right } }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Klishch
						Dan Klishch