Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Optimization info   [Contents][Index]


8.7.5 Dump types

dump_printf

This is a generic method for doing formatted output. It takes anadditional argumentdump_kind which signifies the type ofdump. This method outputs information only when the dumps are enabledfor this particulardump_kind. Note that the caller doesn’tneed to know if the particular dump is enabled or not, or even thefile name. The caller only needs to decide which dump outputinformation is relevant, and under what conditions. This determinesthe associated flags.

Consider the following example fromloop-unroll.cc where aninformative message about a loop (along with its location) is printedwhen any of the following flags is enabled

  • optimization messages
  • RTL dumps
  • detailed dumps
int report_flags = MSG_OPTIMIZED_LOCATIONS | TDF_RTL | TDF_DETAILS;dump_printf_loc (report_flags, insn,                 "loop turned into non-loop; it never loops.\n");
dump_basic_block

Output basic block.

dump_generic_expr

Output generic expression.

dump_gimple_stmt

Output gimple statement.

Note that the above methods also have variants prefixed with_loc, such asdump_printf_loc, which are similar exceptthey also output the source location information. The_loc variantstake aconst dump_location_t &. This class can be constructed fromagimple * or from artx_insn *, and so callers can passagimple * or artx_insn * as the_loc argument.Thedump_location_t constructor will extract the source locationfrom the statement or instruction, along with the profile count, andthe location in GCC’s own source code (or the plugin) from which the dumpcall was emitted. Only the source location is currently used.There is also adump_user_location_t class, capturing thesource location and profile count, but not the dump emission location,so that locations in the user’s code can be passed around. Thiscan also be constructed from agimple * and from artx_insn *,and it too can be passed as the_loc argument.


Next:Dump examples, Previous:Dump output verbosity, Up:Optimization info   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp