# This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. from maketreetypes import iter_tree_types from cpybuilder import * from wrapperbuilder import PyGccWrapperTypeObject from testcpychecker import get_gcc_version tree_types = list(iter_tree_types()) # FIXME: truncate the list, for ease of development: # tree_types = list(iter_tree_types())[:3] cu = CompilationUnit() cu.add_include("gcc-python.h") cu.add_include("gcc-python-wrappers.h") cu.add_include("gcc-plugin.h") cu.add_include("tree.h") cu.add_include("function.h") cu.add_include("basic-block.h") cu.add_include("cp/cp-tree.h") cu.add_include("c-family/c-common.h") cu.add_include("gcc-c-api/gcc-tree.h") cu.add_include("gcc-c-api/gcc-constant.h") cu.add_include("gcc-c-api/gcc-declaration.h")
from cpybuilder import CompilationUnit, SimpleModule sm = SimpleModule() sm.cu.add_include('config.h') sm.cu.add_include('system.h') sm.cu.add_include('coretypes.h') sm.cu.add_include('tree.h') sm.cu.add_decl(""" struct PyGccTree { PyObject_HEAD tree t; }; """) # FIXME: truncating the list for now, for sanity's sake: for t in list(iter_tree_types())[:5]: #tp = PyTypeObject(name = 'PyType%s' % t.camel_cased_string(), # tp_name = 'tree.%s' % t.camel_cased_string(), # struct_name = 'struct PyGccTree') sm.add_type_object(name = 'tree_%sType' % t.camel_cased_string(), localname = t.camel_cased_string(), tp_name = 'tree.%s' % t.camel_cased_string(), struct_name = 'struct PyGccTree') sm.add_module_init('tree', modmethods=None, moddoc='This is a doc string') print sm.cu.as_str() from subprocess import Popen, PIPE, check_call GCCPLUGINS_DIR = Popen([os.environ.get('GCC', 'gcc'),
# # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see # <http://www.gnu.org/licenses/>. from maketreetypes import iter_tree_types from cpybuilder import * from wrapperbuilder import PyGccWrapperTypeObject tree_types = list(iter_tree_types()) # FIXME: truncate the list, for ease of development: #tree_types = list(iter_tree_types())[:3] cu = CompilationUnit() cu.add_include('gcc-python.h') cu.add_include('gcc-python-wrappers.h') cu.add_include('gcc-plugin.h') cu.add_include("tree.h") cu.add_include("function.h") cu.add_include("basic-block.h") cu.add_include("cp/cp-tree.h") cu.add_include("c-family/c-common.h") cu.add_include("cp/name-lookup.h") modinit_preinit = ''
from cpybuilder import CompilationUnit, SimpleModule sm = SimpleModule() sm.cu.add_include('config.h') sm.cu.add_include('system.h') sm.cu.add_include('coretypes.h') sm.cu.add_include('tree.h') sm.cu.add_decl(""" struct PyGccTree { PyObject_HEAD tree t; }; """) # FIXME: truncating the list for now, for sanity's sake: for t in list(iter_tree_types())[:5]: #tp = PyTypeObject(name = 'PyType%s' % t.camel_cased_string(), # tp_name = 'tree.%s' % t.camel_cased_string(), # struct_name = 'struct PyGccTree') sm.add_type_object(name='tree_%sType' % t.camel_cased_string(), localname=t.camel_cased_string(), tp_name='tree.%s' % t.camel_cased_string(), struct_name='struct PyGccTree') sm.add_module_init('tree', modmethods=None, moddoc='This is a doc string') print sm.cu.as_str() from subprocess import Popen, PIPE, check_call GCCPLUGINS_DIR = Popen( [os.environ.get('CC', 'gcc'), '--print-file-name=plugin'],