4. Syntax of the files generated by GCC-SLO

4.1. Syntax of the BRD file

TODO

4.2. Syntax of the .bb_info files

TODO

4.3. Syntax of the .function_info files

The .function_info file represent the control flow graphs of all functions encountered by gcc-slo while compiling a single source file. An example .function_info file is shown in Example 4.1, “.function_info file contents example”. The formal syntax is described as follows, with the meaning in comments:

function-info-file

function-info* // a function-info file contains a list of function-info's, which each contains info about a single function

function-info

( string basic-block-info* ) // function-info describes a single function. The string contains the function name. Then a list of basic-block-info's follows describing the different basic blocks and how they are linked in the control flow graph.

string

" [^"]* " // A string is any sequence of characters between double quotes

basic-block-info

( natural = hexnumber hexnumber* ) // basic-block info encodes a single basic block in the function, and shows which basic blocks are successors in the control flow graph. The encoding is a little bit special: The natural represents the basic block number. In each function, the basic block are typically numbered from 0. This number corresponds with the basic block numbers found in .bb_info and BRD files. In the .function_info file, each basic block is also identified by a hexadecimal number. The first hexadecimal number, i.e., the one after the equals sign, is the hex-number for this basic block. The following hexadecimal numbers are the hexnumbers for the successors in the control flow graph.

natural

[0-9]+

hexnumber

(0x | 0X )? [0-9|a-f|A-F]+

Example 4.1. .function_info file contents example

(1 "gnu_dev_major" (0=0xb7d6c050 0xb7d6c0f0 ) (2=0xb7d6c0f0 ) )
(2 "gnu_dev_minor" (0=0xb7d6c230 0xb7d6c2d0 ) (4=0xb7d6c2d0 ) )
(3 "gnu_dev_makedev" (0=0xb7d6c460 0xb7d6c500 ) (6=0xb7d6c500 ) )
(4 "ex" (0=0xb7d89b90 0xb7d89c30 ) (8=0xb7d89c30 0xb7d89eb0 ) (10=0xb7d89c80 0xb7d89d20 )
  (12=0xb7d89cd0 0xb7d89d20 ) (14=0xb7d89d20 0xb7d89cd0 0xb7d89d70 ) (16=0xb7d89d70 0xb7d89e10 )
  (18=0xb7d89dc0 0xb7d89e10 ) (20=0xb7d89e10 0xb7d89dc0 0xb7d89e60 ) (22=0xb7d89e60 0xb7d89eb0 )
  (24=0xb7d89eb0 0xb7d89c80 0xb7d89f00 ) (26=0xb7d89f00 ) )
(5 "main" (0=0xb7d96410 0xb7d964b0 ) (28=0xb7d964b0 0xb7d96500 0xb7d96550 ) (30=0xb7d96500 0xb7d8ee6c )
  (31=0xb7d8ee6c 0xb7d8eea0 ) (33=0xb7d8eea0 ) (34=0xb7d96550 0xb7d90b40 ) (35=0xb7d90b40 0xb7b595c8 ) 
  (37=0xb7b595c8 0xb7b594b0 ) (38=0xb7b594b0 0xb7b595f0 ) (39=0xb7b595f0 0xb7b594d8 ) (40=0xb7b594d8 0xb7d8efa4 )
  (41=0xb7d8efa4 0xb7d93444 ) (43=0xb7d93444 ) )


4.4. Syntax of the .memaccess_info files

TODO