Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Passes and Files of the Compiler   [Contents][Index]


8.2 Gimplification pass

Gimplification is a whimsical term for the process of convertingthe intermediate representation of a function into the GIMPLE language(seeGIMPLE). The term stuck, and so words like “gimplification”,“gimplify”, “gimplifier” and the like are sprinkled throughout thissection of code.

While a front end may certainly choose to generate GIMPLE directly ifit chooses, this can be a moderately complex process unless theintermediate language used by the front end is already fairly simple.Usually it is easier to generate GENERIC trees plus extensionsand let the language-independent gimplifier do most of the work.

The main entry point to this pass isgimplify_function_treelocated ingimplify.cc. From here we process the entirefunction gimplifying each statement in turn. The main workhorsefor this pass isgimplify_expr. Approximately everythingpasses through here at least once, and it is from here that weinvoke thelang_hooks.gimplify_expr callback.

The callback should examine the expression in question and returnGS_UNHANDLED if the expression is not a language specificconstruct that requires attention. Otherwise it should alter theexpression in some way to such that forward progress is made towardproducing valid GIMPLE. If the callback is certain that thetransformation is complete and the expression is valid GIMPLE, itshould returnGS_ALL_DONE. Otherwise it should returnGS_OK, which will cause the expression to be processed again.If the callback encounters an error during the transformation (becausethe front end is relying on the gimplification process to finishsemantic checks), it should returnGS_ERROR.


Next:Pass manager, Previous:Parsing pass, Up:Passes and Files of the Compiler   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp