Skip to content

Commit a8373e2

Browse files
author
Yihao Wu
committed
Add get_location
We have set_location. Why not get_location? This tells us much information on variable and function and more locations. Signed-off-by: Yihao Wu <[email protected]>
1 parent b800b06 commit a8373e2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gcc-python.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ PyGcc_define_macro(PyObject *self,
133133
Py_RETURN_NONE;
134134
}
135135

136+
static PyObject *
137+
PyGcc_get_location(PyObject *self, PyObject *args)
138+
{
139+
return PyGccLocation_New(gcc_private_make_location(input_location));
140+
}
141+
136142
static PyObject *
137143
PyGcc_set_location(PyObject *self, PyObject *args)
138144
{
@@ -438,6 +444,10 @@ static PyMethodDef GccMethods[] = {
438444
(METH_VARARGS | METH_KEYWORDS),
439445
("Report an information message\n"
440446
"FIXME\n")},
447+
{"get_location",
448+
(PyCFunction)PyGcc_get_location,
449+
METH_VARARGS,
450+
("Get the default location for error reports\n")},
441451
{"set_location",
442452
(PyCFunction)PyGcc_set_location,
443453
METH_VARARGS,

0 commit comments

Comments
 (0)