* [jit] Add creating globals to C++ wrapper API
@ 2014-01-01 0:00 David Malcolm
0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2014-01-01 0:00 UTC (permalink / raw)
To: jit, gcc-patches; +Cc: David Malcolm
Committed to branch dmalcolm/jit:
gcc/jit/
* libgccjit++.h (gccjit::context::new_global): New.
---
gcc/jit/ChangeLog.jit | 4 ++++
gcc/jit/libgccjit++.h | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index 2298e49..ef820ea 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,5 +1,9 @@
2014-03-07 David Malcolm <dmalcolm@redhat.com>
+ * libgccjit++.h (gccjit::context::new_global): New.
+
+2014-03-07 David Malcolm <dmalcolm@redhat.com>
+
* internal-api.c (gcc::jit::playback::context::handle_locations):
Add a disabled call to line_table_dump, in case it's handy for
debugging in the future.
diff --git a/gcc/jit/libgccjit++.h b/gcc/jit/libgccjit++.h
index da7471b..71bb855 100644
--- a/gcc/jit/libgccjit++.h
+++ b/gcc/jit/libgccjit++.h
@@ -121,6 +121,10 @@ namespace gccjit
function get_builtin_function (const std::string &name);
+ lvalue new_global (type type_,
+ const std::string &name,
+ location loc = location ());
+
rvalue new_rvalue (type numeric_type,
int value);
rvalue zero (type numeric_type);
@@ -640,6 +644,17 @@ context::get_builtin_function (const std::string &name)
name.c_str ()));
}
+inline lvalue
+context::new_global (type type_,
+ const std::string &name,
+ location loc)
+{
+ return lvalue (gcc_jit_context_new_global (m_inner_ctxt,
+ loc.get_inner_location (),
+ type_.get_inner_type (),
+ name.c_str ()));
+}
+
inline rvalue
context::new_rvalue (type numeric_type,
int value)
--
1.7.11.7
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-03-07 13:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-01 0:00 [jit] Add creating globals to C++ wrapper API 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).