public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, committed] libgccjit.h: Fix description of struct gcc_jit_context
@ 2015-01-01  0:00 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2015-01-01  0:00 UTC (permalink / raw)
  To: jit, gcc-patches; +Cc: David Malcolm

libgccjit.h's description of gcc_jit_context talks about contexts
having two states: before vs after compilation.  This hasn't been the
case for a long time, and it's long been possible to compile a context
more than once, getting a different gcc_jit_result each time (assuming
no errors happen).

Fix the comment.

Committed to trunk as r219366.

gcc/jit/ChangeLog:
	* libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
	comment.
---
 gcc/jit/libgccjit.h | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/gcc/jit/libgccjit.h b/gcc/jit/libgccjit.h
index 91ca409..7603033 100644
--- a/gcc/jit/libgccjit.h
+++ b/gcc/jit/libgccjit.h
@@ -31,16 +31,19 @@ extern "C" {
  **********************************************************************/
 /* All structs within the API are opaque. */
 
-/* A gcc_jit_context encapsulates the state of a compilation.  It goes
-   through two states:
+/* A gcc_jit_context encapsulates the state of a compilation.
+   You can set up options on it, and add types, functions and code, using
+   the API below.
 
-   (1) "initial", during which you can set up options on it, and add
-       types, functions and code, using the API below.
-       Invoking gcc_jit_context_compile on it transitions it to the
-       "after compilation" state.
+   Invoking gcc_jit_context_compile on it gives you a gcc_jit_result *
+   (or NULL).
 
-   (2) "after compilation", when you can call gcc_jit_context_release to
-       clean up.  */
+   You can call gcc_jit_context_compile repeatedly on one context, giving
+   multiple independent results.
+
+   Eventually you can call gcc_jit_context_release to clean up the
+   context; any results created from it are still usable, and should be
+   cleaned up via gcc_jit_result_release.  */
 typedef struct gcc_jit_context gcc_jit_context;
 
 /* A gcc_jit_result encapsulates the result of a compilation.  */
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-08 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01  0:00 [PATCH, committed] libgccjit.h: Fix description of struct gcc_jit_context David Malcolm

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).