@@ -17,8 +17,8 @@ for CPython, but it could be used e.g. to teach GCC about GTK's
17
17
reference-counting semantics, or about locking in the Linux kernel, or about
18
18
signal-safety in APIs.
19
19
20
- Other ideas include visualizations of code structure. Given a `gcc.CFG `
21
- instance, `gccutils.render_to_dot(cfg) ` and `gccutils.invoke_dot(cfg) ` will
20
+ Other ideas include visualizations of code structure. Given a `` gcc.CFG ` `
21
+ instance, `` gccutils.render_to_dot(cfg) `` and `` gccutils.invoke_dot(cfg) ` ` will
22
22
use graphviz and eog to plot a handy visualization of a control flow graph,
23
23
showing the source code interleaved with GCC's ``GIMPLE `` internal
24
24
representation.
@@ -27,23 +27,29 @@ The documentation can be seen at:
27
27
28
28
http://gcc-python-plugin.readthedocs.io/en/latest/index.html
29
29
30
+
30
31
Requirements
31
32
------------
32
33
33
34
* GCC: 4.6 or later (it uses APIs that weren't exposed to plugins in 4.5)
34
35
35
36
* tested with 4.8, 4.9, 5, 6, 7, and 8.
36
37
38
+ * GCC plugin development package: usually available in distribution packages
39
+ such as ``gcc-N-plugin-dev `` or ``gcc-plugin-devel ``.
40
+
37
41
* Python: requires 2.7 or 3.2 or later
38
42
39
- * "six": The libcpychecker code uses the "six " Python compatibility library to
43
+ * "six": The libcpychecker code uses the "six _ " Python compatibility library to
40
44
smooth over Python 2 vs Python 3 differences, both at build-time and
41
45
run-time:
42
46
43
- http://pypi.python.org/pypi/six/
47
+ .. _six : http://pypi.python.org/pypi/six/
48
+
44
49
45
50
Usage
46
51
-----
52
+
47
53
I use::
48
54
49
55
make
@@ -85,16 +91,17 @@ from within a script.
85
91
86
92
Overview of the code
87
93
--------------------
94
+
88
95
This is currently three projects in one:
89
96
90
- gcc-python-*: the plugin for GCC. The entrypoint (`init_plugin`) is in
91
- gcc-python.c
97
+ `` gcc-python-* `` : the plugin for GCC. The entrypoint (`` init_plugin ` `) is in
98
+ `` gcc-python.c ``.
92
99
93
- libcpychecker and cpychecker.py: a Python library (and a driver script),
100
+ `` libcpychecker `` and `` cpychecker.py `` : a Python library (and a driver script),
94
101
written for the plugin, in which I'm building new compiler warnings to
95
102
help people find bugs in CPython extension code.
96
103
97
- cpybuilder: a handy module for programatically generating C source code for
104
+ `` cpybuilder `` : a handy module for programatically generating C source code for
98
105
CPython extensions. I use this both to generate parts of the GCC plugin, and
99
106
also in the selftests for the cpychecker script. (I initially attempted to use
100
107
Cython for the former, but wrapping the "tree" type hierarchy required more
@@ -105,15 +112,18 @@ I've chosen to follow Python's (PEP-7), as I prefer it (although my code is
105
112
admittedly a mess in places).
106
113
107
114
You'll find API documentation within the "docs" directory, written in the
108
- reStructuredText format (as is this file, in fact). If you have Sphinx
109
- installed (http://sphinx.pocoo.org/) , you can regenerate these docs using::
115
+ reStructuredText format (as is this file, in fact). If you have Sphinx _
116
+ installed, you can regenerate these docs using::
110
117
111
118
make html
112
119
113
- within the `docs ` directory. Sphinx is the `python-sphinx ` package on a
120
+ within the `` docs `` directory. Sphinx is the `` python-sphinx ` ` package on a
114
121
Fedora/RHEL box.
115
122
116
- More detailed documentation can be seen within `docs/getting-involved.rst `
123
+ .. _Sphinx : http://sphinx.pocoo.org/
124
+
125
+
126
+ More detailed documentation can be seen within ``docs/getting-involved.rst ``.
117
127
118
128
Enjoy!
119
129
David Malcolm <dmalcolm@redhat.com>
0 commit comments