|
1 | | -# Copyright 2011, 2012, 2013, 2014 David Malcolm <dmalcolm@redhat.com> |
2 | | -# Copyright 2011, 2012, 2013, 2014 Red Hat, Inc. |
| 1 | +# Copyright 2011-2014, 2017 David Malcolm <dmalcolm@redhat.com> |
| 2 | +# Copyright 2011-2014, 2017 Red Hat, Inc. |
3 | 3 | # |
4 | 4 | # This is free software: you can redistribute it and/or modify it |
5 | 5 | # under the terms of the GNU General Public License as published by |
@@ -90,7 +90,39 @@ def generate_location(): |
90 | 90 | modinit_preinit += pytype.c_invoke_type_ready() |
91 | 91 | modinit_postinit += pytype.c_invoke_add_to_module() |
92 | 92 |
|
| 93 | +def generate_rich_location(): |
| 94 | + # |
| 95 | + # Generate the gcc.RichLocation class: |
| 96 | + # |
| 97 | + global modinit_preinit |
| 98 | + global modinit_postinit |
| 99 | + |
| 100 | + methods = PyMethodTable('PyGccRichLocation_methods', []) |
| 101 | + methods.add_method('add_fixit_replace', |
| 102 | + '(PyCFunction)PyGccRichLocation_add_fixit_replace', |
| 103 | + 'METH_VARARGS | METH_KEYWORDS', |
| 104 | + "FIXME") |
| 105 | + cu.add_defn(methods.c_defn()) |
| 106 | + |
| 107 | + pytype = PyGccWrapperTypeObject(identifier = 'PyGccRichLocation_TypeObj', |
| 108 | + localname = 'RichLocation', |
| 109 | + tp_name = 'gcc.RichLocation', |
| 110 | + struct_name = 'PyGccRichLocation', |
| 111 | + tp_new = 'PyType_GenericNew', |
| 112 | + tp_init = '(initproc)PyGccRichLocation_init', |
| 113 | + #tp_getset = getsettable.identifier, |
| 114 | + #tp_hash = '(hashfunc)PyGccRichLocation_hash', |
| 115 | + #tp_repr = '(reprfunc)PyGccRichLocation_repr', |
| 116 | + #tp_str = '(reprfunc)PyGccRichLocation_str', |
| 117 | + tp_methods = methods.identifier, |
| 118 | + #tp_richcompare = 'PyGccRichLocation_richcompare', |
| 119 | + tp_dealloc = 'PyGccWrapper_Dealloc') |
| 120 | + cu.add_defn(pytype.c_defn()) |
| 121 | + modinit_preinit += pytype.c_invoke_type_ready() |
| 122 | + modinit_postinit += pytype.c_invoke_add_to_module() |
| 123 | + |
93 | 124 | generate_location() |
| 125 | +generate_rich_location() |
94 | 126 |
|
95 | 127 | cu.add_defn(""" |
96 | 128 | int autogenerated_location_init_types(void) |
|
0 commit comments