Committed to branch dmalcolm/jit:

gcc/jit/ChangeLog.jit:
        * docs/index.rst: Add internals/index.rst.
        * docs/internals/index.rst: New.
        * notes.txt: Update to reflect renaming of toplev_main to
        toplev::main.
---
 gcc/jit/ChangeLog.jit            |  7 ++++
 gcc/jit/docs/index.rst           |  1 +
 gcc/jit/docs/internals/index.rst | 78 ++++++++++++++++++++++++++++++++++++++++
 gcc/jit/notes.txt                |  4 +--
 4 files changed, 88 insertions(+), 2 deletions(-)
 create mode 100644 gcc/jit/docs/internals/index.rst

diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index 14576f2..7bc0d20 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,5 +1,12 @@
 2014-09-22  David Malcolm  <dmalc...@redhat.com>
 
+       * docs/index.rst: Add internals/index.rst.
+       * docs/internals/index.rst: New.
+       * notes.txt: Update to reflect renaming of toplev_main to
+       toplev::main.
+
+2014-09-22  David Malcolm  <dmalc...@redhat.com>
+
        * docs/_build/texinfo/libgccjit.texi: Regenerate.
        * docs/intro/install.rst: Reduce width of listing.
        * docs/intro/tutorial01.rst: Use <libgccjit.h> rather than
diff --git a/gcc/jit/docs/index.rst b/gcc/jit/docs/index.rst
index 52993a1..ed75e36 100644
--- a/gcc/jit/docs/index.rst
+++ b/gcc/jit/docs/index.rst
@@ -25,6 +25,7 @@ Contents:
 
    intro/index.rst
    topics/index.rst
+   internals/index.rst
 
 This document describes `libgccjit <http://gcc.gnu.org/wiki/JIT>`_, an API
 for embedding GCC inside programs and libraries.
diff --git a/gcc/jit/docs/internals/index.rst b/gcc/jit/docs/internals/index.rst
new file mode 100644
index 0000000..3702cad
--- /dev/null
+++ b/gcc/jit/docs/internals/index.rst
@@ -0,0 +1,78 @@
+.. Copyright (C) 2014 Free Software Foundation, Inc.
+   Originally contributed by David Malcolm <dmalc...@redhat.com>
+
+   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/>.
+
+Internals
+=========
+
+Using a working copy without installing
+---------------------------------------
+When directly working on the library you can avoid needing to install to
+test changes.
+
+When building code using the API you need to ensure that ``-I`` points to
+the directory containing ``libgccjit.h`` and ``-L`` points to the
+directory containing the built library.
+
+You'll need to manually set ``LD_LIBRARY_PATH`` to the directory containing
+``libgccjit.so`` when running binaries (or debugging them).
+
+Running the test suite
+----------------------
+
+.. code-block:: console
+
+  [build] $ cd gcc
+  [gcc] $ make check-parallel-jit RUNTESTFLAGS="-v -v -v"
+
+A summary of the tests can then be seen in:
+
+.. code-block:: console
+
+  jit/build/gcc/testsuite/jit/jit.sum
+
+and detailed logs in:
+
+.. code-block:: console
+
+  jit/build/gcc/testsuite/jit/jit.log
+
+The test executables can be seen as:
+
+.. code-block:: console
+
+  jit/build/gcc/testsuite/jit/*.exe
+
+which can be run independently.
+
+You can compile and run individual tests by passing "jit.exp=TESTNAME" to 
RUNTESTFLAGS e.g.:
+
+.. code-block:: console
+
+   [gcc] $ make check-parallel-jit RUNTESTFLAGS="-v -v -v 
jit.exp=test-factorial.c"
+
+and once a test has been compiled, you can debug it directly:
+
+.. code-block:: console
+
+   [gcc] $ LD_LIBRARY_PATH=. gdb testsuite/jit/test-factorial.exe
+
+
+Overview of code structure
+--------------------------
+
+   .. literalinclude:: ../../notes.txt
+    :lines: 1-
diff --git a/gcc/jit/notes.txt b/gcc/jit/notes.txt
index 5f8a21e..54dca8f 100644
--- a/gcc/jit/notes.txt
+++ b/gcc/jit/notes.txt
@@ -16,7 +16,7 @@ Client Code   . Generated .            libgccjit.so
               .           .    │     .               .
               .           .    │ ACQUIRE MUTEX       .
               .           .    │     .               .
-              .           .    V───────────────────────> toplev_main (for now)
+              .           .    V───────────────────────> toplev::main (for now)
               .           .          .               .       │
               .           .          .               .   (various code)
               .           .          .               .       │
@@ -59,7 +59,7 @@ Client Code   . Generated .            libgccjit.so
               .           .          .               .       │
               .           .          .               .   (the middle─end and 
backend)
               .           .          .               .       ↓
-              .           .    <───────────────────────────── end of 
toplev_main
+              .           .    <───────────────────────────── end of 
toplev::main
               .           .    │ RELEASE MUTEX       .
               .           .    │     .               .
               .           .    │ Convert assembler to DSO
-- 
1.7.11.7

Reply via email to