diff options
Diffstat (limited to 'bindings/python/clang/cindex.py')
-rw-r--r-- | bindings/python/clang/cindex.py | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index 8b23ae90b9..8e5a9fe006 100644 --- a/bindings/python/clang/cindex.py +++ b/bindings/python/clang/cindex.py @@ -1,9 +1,8 @@ #===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===# # -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===------------------------------------------------------------------------===# @@ -1343,6 +1342,10 @@ CursorKind.VISIBILITY_ATTR = CursorKind(417) CursorKind.DLLEXPORT_ATTR = CursorKind(418) CursorKind.DLLIMPORT_ATTR = CursorKind(419) +CursorKind.CONVERGENT_ATTR = CursorKind(438) +CursorKind.WARN_UNUSED_ATTR = CursorKind(439) +CursorKind.WARN_UNUSED_RESULT_ATTR = CursorKind(440) +CursorKind.ALIGNED_ATTR = CursorKind(441) ### # Preprocessing @@ -2118,6 +2121,8 @@ TypeKind.OCLEVENT = TypeKind(158) TypeKind.OCLQUEUE = TypeKind(159) TypeKind.OCLRESERVEID = TypeKind(160) +TypeKind.EXTVECTOR = TypeKind(176) + class RefQualifierKind(BaseEnumeration): """Describes a specific ref-qualifier of a type.""" @@ -2815,9 +2820,9 @@ class TranslationUnit(ClangObject): for i, (name, contents) in enumerate(unsaved_files): if hasattr(contents, "read"): contents = contents.read() - + contents = b(contents) unsaved_array[i].name = b(fspath(name)) - unsaved_array[i].contents = b(contents) + unsaved_array[i].contents = contents unsaved_array[i].length = len(contents) ptr = conf.lib.clang_parseTranslationUnit(index, @@ -2994,17 +2999,13 @@ class TranslationUnit(ClangObject): unsaved_files_array = 0 if len(unsaved_files): unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))() - for i,(name,value) in enumerate(unsaved_files): - if not isinstance(value, str): - # FIXME: It would be great to support an efficient version - # of this, one day. - value = value.read() - print(value) - if not isinstance(value, str): - raise TypeError('Unexpected unsaved file contents.') - unsaved_files_array[i].name = fspath(name) - unsaved_files_array[i].contents = value - unsaved_files_array[i].length = len(value) + for i,(name,contents) in enumerate(unsaved_files): + if hasattr(contents, "read"): + contents = contents.read() + contents = b(contents) + unsaved_files_array[i].name = b(fspath(name)) + unsaved_files_array[i].contents = contents + unsaved_files_array[i].length = len(contents) ptr = conf.lib.clang_reparseTranslationUnit(self, len(unsaved_files), unsaved_files_array, options) @@ -3058,17 +3059,13 @@ class TranslationUnit(ClangObject): unsaved_files_array = 0 if len(unsaved_files): unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))() - for i,(name,value) in enumerate(unsaved_files): - if not isinstance(value, str): - # FIXME: It would be great to support an efficient version - # of this, one day. - value = value.read() - print(value) - if not isinstance(value, str): - raise TypeError('Unexpected unsaved file contents.') + for i,(name,contents) in enumerate(unsaved_files): + if hasattr(contents, "read"): + contents = contents.read() + contents = b(contents) unsaved_files_array[i].name = b(fspath(name)) - unsaved_files_array[i].contents = b(value) - unsaved_files_array[i].length = len(value) + unsaved_files_array[i].contents = contents + unsaved_files_array[i].length = len(contents) ptr = conf.lib.clang_codeCompleteAt(self, fspath(path), line, column, unsaved_files_array, len(unsaved_files), options) if ptr: |