commit 85af0127fa778e0b536e0740bb39d05341fe9492
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Jul 27 14:52:49 2011 -0400
Split up examples within the docs
docs/examples.rst | 32 -------------------------------
docs/index.rst | 1 +
docs/working-with-c.rst | 48 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 32 deletions(-)
---
diff --git a/docs/examples.rst b/docs/examples.rst
index c31fea5..cb448cd 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -15,38 +15,6 @@
along with this program. If not, see
<
http://www.gnu.org/licenses/>.
-Working with C code
-===================
-
-"Hello world"
--------------
-
-Here's a simple "hello world" C program:
-
- .. literalinclude:: ../tests/examples/hello-world/input.c
- :lines: 19-26
- :language: c
-
-Here's a Python script that locates the function at one pass within the
-compile and prints various interesting things about it:
-
- .. literalinclude:: ../tests/examples/hello-world/script.py
- :lines: 19-
- :language: python
-
-We can run the script during the compile like this:
-
- .. code-block:: bash
-
- ./gcc-with-python script.py test.c
-
-Here's the expected output:
-
- .. literalinclude:: ../tests/examples/hello-world/stdout.txt
-
-Notice how the call to `printf` has already been optimized into a call
-to `__builtin_puts`.
-
Example scripts
===============
diff --git a/docs/index.rst b/docs/index.rst
index cd4c4be..06c3636 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -31,6 +31,7 @@ Contents:
basics.rst
gcc-overview.rst
examples.rst
+ working-with-c.rst
cfg.rst
tree.rst
gimple.rst
diff --git a/docs/working-with-c.rst b/docs/working-with-c.rst
new file mode 100644
index 0000000..eb8251e
--- /dev/null
+++ b/docs/working-with-c.rst
@@ -0,0 +1,48 @@
+.. Copyright 2011 David Malcolm <dmalcolm(a)redhat.com>
+ Copyright 2011 Red Hat, Inc.
+
+ This is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (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/>.
+
+Working with C code
+===================
+
+"Hello world"
+-------------
+
+Here's a simple "hello world" C program:
+
+ .. literalinclude:: ../tests/examples/hello-world/input.c
+ :lines: 19-26
+ :language: c
+
+Here's a Python script that locates the function at one pass within the
+compile and prints various interesting things about it:
+
+ .. literalinclude:: ../tests/examples/hello-world/script.py
+ :lines: 19-
+ :language: python
+
+We can run the script during the compile like this:
+
+ .. code-block:: bash
+
+ ./gcc-with-python script.py test.c
+
+Here's the expected output:
+
+ .. literalinclude:: ../tests/examples/hello-world/stdout.txt
+
+Notice how the call to `printf` has already been optimized into a call
+to `__builtin_puts`.