:scale: 50%
''')
print("""
These tables contain the same information.  The diagram and tables were
autogenerated, using GCC %s""" % gcc.get_gcc_version().basever)
print
for rootname, reflabel, ps in zip(
    ('The lowering passes', 'The "small IPA" passes',
     'The "regular IPA" passes',
     'Passes generating Link-Time Optimization data',
     'The "all other passes" catch-all'),
    ('all_lowering_passes', 'all_small_ipa_passes', 'all_regular_ipa_passes',
     'all_lto_gen_passes', 'all_passes'), gcc.Pass.get_roots()):
    print('.. _%s:' % reflabel)
    print
    print(rootname)
    print('-' * len(rootname))
    print

    t = Table([
        'Pass Name', 'Required properties', 'Provided properties',
        'Destroyed properties'
    ],
              sepchar='=')
    foo(t, ps, 0)
    s = six.StringIO()
    t.write(s)
    for line in s.getvalue().splitlines():
        print('   ' + line.rstrip())
    print('\n')
''')
print("""
These tables contain the same information.  The diagram and tables were
autogenerated, using GCC %s""" % gcc.get_gcc_version().basever)
print
for rootname, reflabel, ps in zip(('The lowering passes',
                                   'The "small IPA" passes',
                                   'The "regular IPA" passes',
                                   'Passes generating Link-Time Optimization data',
                                   'The "all other passes" catch-all'),
                                  ('all_lowering_passes',
                                   'all_small_ipa_passes',
                                   'all_regular_ipa_passes',
                                   'all_lto_gen_passes',
                                   'all_passes'),
                                  gcc.Pass.get_roots()):
    print('.. _%s:' % reflabel)
    print
    print(rootname)
    print('-' * len(rootname))
    print

    t = Table(['Pass Name', 'Required properties', 'Provided properties', 'Destroyed properties'],
              sepchar='=')
    foo(t, ps, 0)
    s = six.StringIO()
    t.write(s)
    for line in s.getvalue().splitlines():
        print('   ' + line.rstrip())
    print('\n')
Esempio n. 3
0
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful, but
#   WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see
#   <http://www.gnu.org/licenses/>.

import gcc

from gccutils import Table

t = Table(['Class', 'get_symbol()'],
          sepchar='=')

for name in sorted(dir(gcc)):
    obj = getattr(gcc, name)
    if hasattr(obj, 'get_symbol'):
        try:
            sym = obj.get_symbol()
        except TypeError:
            continue
        if sym != '<<< ??? >>>':
            t.add_row((':py:class:`gcc.%s`' % name,
                       '`%s`' % sym.strip()))

from six import StringIO
s = StringIO()
t.write(s)