public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [jit] Improvements to documentation.
Date: Tue, 01 Jan 2013 00:00:00 -0000	[thread overview]
Message-ID: <1381883811-29959-1-git-send-email-dmalcolm@redhat.com> (raw)

Committed to dmalcolm/jit branch.

gcc/jit/
	* libgccjit.h (gcc_jit_location): Rewrite comment to reflect
	that this part of the API is now implemented.
	("Functions for use within the code factory."): Add notes on
	memory-management and lifetimes.
	* notes.txt: Update diagram to show handle_locations.
---
 gcc/jit/ChangeLog.jit |  8 ++++++++
 gcc/jit/libgccjit.h   | 26 +++++++++++++++++---------
 gcc/jit/notes.txt     |  5 +++++
 3 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index 18101f1..da3e75a 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,5 +1,13 @@
 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
 
+	* libgccjit.h (gcc_jit_location): Rewrite comment to reflect
+	that this part of the API is now implemented.
+	("Functions for use within the code factory."): Add notes on
+	memory-management and lifetimes.
+	* notes.txt: Update diagram to show handle_locations.
+
+2013-10-15  David Malcolm  <dmalcolm@redhat.com>
+
 	* TODO.rst: Update.
 
 2013-10-14  David Malcolm  <dmalcolm@redhat.com>
diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
index a17ab09..8985b8f 100644
--- a/gcc/jit/libgccjit.h
+++ b/gcc/jit/libgccjit.h
@@ -30,17 +30,17 @@ typedef struct gcc_jit_context gcc_jit_context;
 /* A gcc_jit_result encapsulates the result of a compilation.  */
 typedef struct gcc_jit_result gcc_jit_result;
 
-/* A gcc_jit_location will encapsulate a source code location, so that
-   you can associated locations in your language with statements in the
-   JIT-compiled code, allowing the debugger to single-step through
-   your language.
+/* A gcc_jit_location encapsulates a source code location, so that
+   you can (optionally) associate locations in your language with
+   statements in the JIT-compiled code, allowing the debugger to
+   single-step through your language.
 
-   This part of the API is a placeholder to allow future expansion
-   without breaking ABI: there currently is no way of creating a
-   gcc_jit_location.
+   Note that to do so, you also need to enable
+     GCC_JIT_BOOL_OPTION_DEBUGINFO
+   on the gcc_jit_context.
 
-   For now you must pass NULL into parameters expecting a
-   (gcc_jit_location *).  */
+   gcc_jit_location instances are optional; you can always pass
+   NULL.  */
 typedef struct gcc_jit_location gcc_jit_location;
 
 /* A gcc_jit_type encapsulates a type e.g. "int" or a "struct foo*".  */
@@ -235,6 +235,14 @@ gcc_jit_result_release (gcc_jit_result *result);
 
 /**********************************************************************
  Functions for use within the code factory.
+
+ All objects created by these functions are cleaned up for you, after
+ your code-creation hook returns.  Note that this means you can't hold
+ references to them for use after you return from your callback.
+
+ All (const char *) string arguments passed to these functions are
+ copied, so you don't need to keep them around.  Note that this *isn't*
+ the case for other parts of the API.
  **********************************************************************/
 /* Creating source code locations for use by the debugger.
    Line and column numbers are 1-based.  */
diff --git a/gcc/jit/notes.txt b/gcc/jit/notes.txt
index 6d1288f..2c225ce 100644
--- a/gcc/jit/notes.txt
+++ b/gcc/jit/notes.txt
@@ -38,6 +38,11 @@ Client Code   . Generated .            libgccjit.so
        │etc   .           .          .               .
        │      .           .          .               .
        ──────────────────────────────────>           .
+Return from client callback          .    │          .
+              .           .          .    │          .
+              .           .          .    │(handle_locations: add locations to
+              .           .          .    │ linemap and associate them with trees)
+              .           .          .    │          .
               .           .          .    │          .       No GC in here
 ..........................................│..................AAAAAAAAAAAAA...
               .           .          .    │ for each function
-- 
1.7.11.7

             reply	other threads:[~2013-10-16  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-01  0:00 David Malcolm [this message]
2014-01-01  0:00 David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381883811-29959-1-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).