Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

wsopt.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void ws_asm_optimize (WsCompilerPtr compiler)


Function Documentation

void ws_asm_optimize WsCompilerPtr  compiler  ) 
 

Definition at line 362 of file wsopt.c.

References WsCompilerParamsRec::no_opt_conv, WsCompilerParamsRec::no_opt_dead_code, WsCompilerParamsRec::no_opt_jumps_to_jumps, WsCompilerParamsRec::no_opt_jumps_to_next_instruction, WsCompilerParamsRec::no_opt_peephole, opt_conv(), opt_dead_code(), opt_jumps_to_jumps(), opt_jumps_to_next_instruction(), opt_peephole(), WsCompilerRec::params, WsBool, and WsCompilerPtr.

Referenced by compile_stream().

00363 {
00364     WsBool change = WS_TRUE;
00365 
00366     /* While we manage to change the assembler, perform the requested
00367        optimizations. */
00368     while (change) {
00369         change = WS_FALSE;
00370 
00371     /* Useless conversions */
00372     if (!compiler->params.no_opt_conv && opt_conv(compiler))
00373         change = WS_TRUE;
00374 
00375         /* Peephole. */
00376         if (!compiler->params.no_opt_peephole && opt_peephole(compiler))
00377             change = WS_TRUE;
00378 
00379         /* Jumps to jump instructions. */
00380         if (!compiler->params.no_opt_jumps_to_jumps
00381             && opt_jumps_to_jumps(compiler))
00382             change = WS_TRUE;
00383 
00384         /* Jumps to the next instruction. */
00385         if (!compiler->params.no_opt_jumps_to_next_instruction
00386             && opt_jumps_to_next_instruction(compiler))
00387             change = WS_TRUE;
00388 
00389         /* Unreachable code. */
00390         if (!compiler->params.no_opt_dead_code && opt_dead_code(compiler))
00391             change = WS_TRUE;
00392     }
00393 }

Here is the call graph for this function:

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.