commit 24310b8f25de335e89cdbe74362550aefb60a7ca
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon May 7 16:49:35 2012 -0400
add gcc_gimple_get_location
generate-gimple-c.py | 3 ++-
proposed-plugin-api/gcc-gimple.c | 6 ++++++
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/generate-gimple-c.py b/generate-gimple-c.py
index 6b99112..f34136c 100644
--- a/generate-gimple-c.py
+++ b/generate-gimple-c.py
@@ -25,6 +25,7 @@ cu.add_include('gcc-python.h')
cu.add_include('gcc-python-wrappers.h')
cu.add_include('gcc-plugin.h')
cu.add_include("gimple.h")
+cu.add_include("proposed-plugin-api/gcc-gimple.h")
modinit_preinit = ''
modinit_postinit = ''
@@ -192,7 +193,7 @@ def generate_gimple():
static PyObject *
gcc_Gimple_get_location(struct PyGccGimple *self, void *closure)
{
- return
gcc_python_make_wrapper_location(gcc_private_make_location(gimple_location(self->stmt.inner)));
+ return gcc_python_make_wrapper_location(gcc_gimple_get_location(self->stmt));
}
static PyObject *
diff --git a/proposed-plugin-api/gcc-gimple.c b/proposed-plugin-api/gcc-gimple.c
index bd980b2..40e2af3 100644
--- a/proposed-plugin-api/gcc-gimple.c
+++ b/proposed-plugin-api/gcc-gimple.c
@@ -70,6 +70,12 @@ gcc_private_make_gimple(gimple inner)
return result;
}
+GCC_IMPLEMENT_PUBLIC_API(gcc_location)
+gcc_gimple_get_location(gcc_gimple stmt)
+{
+ return gcc_private_make_location(gimple_location(stmt.inner));
+}
+
GCC_IMPLEMENT_PUBLIC_API(gcc_gimple)
gcc_gimple_phi_upcast(gcc_gimple_phi phi)
{
Show replies by date