@@ -1,3 +1,14 @@
+2014-02-06 David Malcolm <dmalcolm@redhat.com>
+
+ * libgccjit++.h: Include <ostream> rather than <iostream>, since
+ the former gets us std::ostream, and the latter may introduce
+ startup-time overhead for constructing std::cout et al.
+ (gccjit::context::new_child_context): New.
+ (gccjit::context::release): New.
+ (gccjit::context::compile): New.
+ (gccjit::context::set_int_option): New.
+ (gccjit::context::set_bool_option): New.
+
2014-02-03 David Malcolm <dmalcolm@redhat.com>
* libgccjit.h (struct gcc_jit_object): New.
@@ -5,7 +5,7 @@
#include "libgccjit.h"
-#include <iostream>
+#include <ostream>
#include <vector>
/****************************************************************************
@@ -31,6 +31,18 @@ namespace gccjit
context ();
context (gcc_jit_context *ctxt);
+ gccjit::context new_child_context ();
+
+ void release ();
+
+ gcc_jit_result *compile ();
+
+ void set_int_option (enum gcc_jit_int_option opt,
+ int value);
+
+ void set_bool_option (enum gcc_jit_bool_option opt,
+ int value);
+
location
new_location (const char *filename,
int line,
@@ -295,6 +307,41 @@ inline context context::acquire ()
inline context::context () : m_inner_ctxt (NULL) {}
inline context::context (gcc_jit_context *inner) : m_inner_ctxt (inner) {}
+inline gccjit::context
+context::new_child_context ()
+{
+ return context (gcc_jit_context_new_child_context (m_inner_ctxt));
+}
+
+inline void
+context::release ()
+{
+ gcc_jit_context_release (m_inner_ctxt);
+ m_inner_ctxt = NULL;
+}
+
+inline gcc_jit_result *
+context::compile ()
+{
+ return gcc_jit_context_compile (m_inner_ctxt);
+}
+
+inline void
+context::set_int_option (enum gcc_jit_int_option opt,
+ int value)
+{
+ gcc_jit_context_set_int_option (m_inner_ctxt, opt, value);
+
+}
+
+inline void
+context::set_bool_option (enum gcc_jit_bool_option opt,
+ int value)
+{
+ gcc_jit_context_set_bool_option (m_inner_ctxt, opt, value);
+
+}
+
inline location
context::new_location (const char *filename,
int line,