| /petsc/lib/petsc/bin/maint/petsclinter/petsclinter/util/ |
| H A D | _clang.py | 12 import clang.cindex as clx # type: ignore[import] namespace 55 clx.CursorKind.FUNCTION_DECL, 56 clx.CursorKind.CALL_EXPR 61 clx.CursorKind.INTEGER_LITERAL, 62 clx.CursorKind.UNARY_OPERATOR, 63 clx.CursorKind.BINARY_OPERATOR 68 clx.CursorKind.INTEGER_LITERAL, 69 clx.CursorKind.STRING_LITERAL 74 clx.CursorKind.CSTYLE_CAST_EXPR, 75 clx.CursorKind.CXX_STATIC_CAST_EXPR, [all …]
|
| H A D | _utility.py | 14 import clang.cindex as clx # type: ignore[import] namespace 137 clxconf = clx.conf 384 index = clx.Index.create() 462 …raise clx.LibclangError('\n\nWarnings or errors generated when creating the precompiled header. Th…
|
| /petsc/lib/petsc/bin/maint/petsclinter/petsclinter/classes/ |
| H A D | _src_pos.py | 10 import clang.cindex as clx # type: ignore[import] namespace 18 class ClangFileNameCache(weakref.WeakKeyDictionary[clx.TranslationUnit, clx.File]): 23 def getname(self, tu: clx.TranslationUnit) -> clx.File: 38 source_location: clx.SourceLocation 39 translation_unit: Optional[clx.TranslationUnit] 42 …def __init__(self, source_location: SourceLocationLike, tu: Optional[clx.TranslationUnit] = None) … 91 …def cast(cls, other: SourceLocationLike, tu: Optional[clx.TranslationUnit] = None) -> SourceLocati… 118 if isinstance(other, clx.SourceLocation): 123 def get_filename_from_tu(cls, tu: clx.TranslationUnit) -> clx.File: 144 def from_position(cls, tu: clx.TranslationUnit, line: int, col: int) -> SourceLocation: [all …]
|
| H A D | _cursor.py | 10 import clang.cindex as clx # type: ignore[import] namespace 49 ctypes.c_uint, ctypes.py_object, clx.Cursor, clx.SourceRange 89 …def visitor(ctx: Any, raw_clx_cursor: clx.Cursor, src_range: clx.SourceRange) -> CXChildVisitResul… 94 clx_cursor = clx.Cursor.from_location(ctx.translation_unit, src_range.start) 129 __cursor: clx.Cursor 159 elif isinstance(cursor, clx.Cursor): 299 if cursor.kind == clx.CursorKind.BINARY_OPERATOR: 314 castee = [c for c in cursor.get_children() if c.kind == clx.CursorKind.UNEXPOSED_EXPR] 321 …elif (cursor.type.get_canonical().kind == clx.TypeKind.POINTER) or (cursor.kind == clx.CursorKind.… 322 if clx.CursorKind.ARRAY_SUBSCRIPT_EXPR in {c.kind for c in cursor.get_children()}: [all …]
|
| H A D | _linter.py | 14 import clang.cindex as clx # type: ignore[import] namespace 142 index: clx.Index 171 self.index = clx.Index.create() 228 end = clx.SourceLocation.from_position(tu, tu.get_file(tu.spelling), startline, -1) 240 …able_expressions(tu: clx.TranslationUnit, symbol_names: Container[str]) -> Generator[Union[tuple[c… 260 UNEXPOSED_DECL = clx.CursorKind.UNEXPOSED_DECL 261 SWITCH_STMT = clx.CursorKind.SWITCH_STMT 262 CASE_STMT = clx.CursorKind.CASE_STMT 263 COMPOUND_STMT = clx.CursorKind.COMPOUND_STMT 264 CALL_EXPR = clx.CursorKind.CALL_EXPR [all …]
|
| H A D | _util.py | 51 def check_valid_type(t: clx.Type) -> bool: 52 import clang.cindex as clx # type: ignore[import] namespace 54 return not t.kind == clx.TypeKind.INVALID 56 def fully_qualify(t: clx.Type) -> list[str]: 63 def view_type(t: clx.Type, level: IndentLevel, title: str) -> list[str]:
|
| H A D | _pool.py | 112 import clang.cindex as clx # type: ignore[import] namespace 113 assert clx.conf.loaded, 'Must initialize libClang first' 114 clang_lib = clx.conf.get_filename()
|
| /petsc/lib/petsc/bin/maint/petsclinter/petsclinter/checks/ |
| H A D | _util.py | 9 import clang.cindex as clx # type: ignore[import] namespace 53 c for c in func_cursor.get_children() if c.type.get_pointee().kind == clx.TypeKind.FUNCTIONPROTO 68 def convert_to_correct_PetscValidLogicalCollectiveXXX(linter: Linter, obj: Cursor, obj_type: clx.Ty… 106 …ot_type_y(type_x: str, type_y: str, linter: Linter, obj: Cursor, obj_type: clx.Type, func_cursor: … 256 def check_is_PetscBool(linter: Linter, obj: Cursor, obj_type: clx.Type, func_cursor: Optional[Curso… 313 assert petsc_object_type.kind == clx.TypeKind.RECORD, 'Symbol does not appear to be a struct!' 382 if def_cursor.kind == clx.CursorKind.VAR_DECL: 386 convert_or_dereference_cursors = clx_conversion_cursor_kinds | {clx.CursorKind.UNARY_OPERATOR} 390 … child for child in def_child.walk_preorder() if child.kind == clx.CursorKind.DECL_REF_EXPR 397 elif def_cursor.kind == clx.CursorKind.FIELD_DECL: [all …]
|
| H A D | _register.py | 10 import clang.cindex as clx # type: ignore[import] namespace 17 check_doc_map: dict[clx.CursorKind, DocChecker] = {} 89 def register_doc_check(cursor_kind: clx.CursorKind, function: DocChecker, exist_ok: bool = False) -… 235 clx.CursorKind.FUNCTION_DECL : _docs.check_petsc_function_docstring, 236 clx.CursorKind.ENUM_DECL : _docs.check_petsc_enum_docstring,
|
| H A D | _code.py | 111 …e(linter: Linter, func: Cursor, parent: Cursor, expected_types: Collection[clx.TypeKind], **kwargs…
|
| /petsc/lib/petsc/bin/maint/petsclinter/petsclinter/ |
| H A D | _typing.py | 34 import clang.cindex as clx # type: ignore[import] namespace 68 CursorLike: TypeAlias = Union[clx.Cursor, Cursor] 69 SourceLocationLike: TypeAlias = Union[clx.SourceLocation, SourceLocation] 70 SourceRangeLike: TypeAlias = Union[clx.SourceRange, SourceRange]
|
| /petsc/lib/petsc/bin/maint/petsclinter/petsclinter/classes/docs/ |
| H A D | _doc_section.py | 10 import clang.cindex as clx # type: ignore[import] namespace 432 def _get_deref_pointer_cursor_type(cursor: CursorLike) -> clx.Type: 438 while canon_type.kind == clx.TypeKind.POINTER: 732 if self._get_deref_pointer_cursor_type(c).kind == clx.TypeKind.FUNCTIONPROTO 777 PARM_DECL_KIND = clx.CursorKind.PARM_DECL 784 if self._get_deref_pointer_cursor_type(cursor).kind == clx.TypeKind.FUNCTIONPROTO:
|
| H A D | _doc_str.py | 13 import clang.cindex as clx # type: ignore[import] namespace 458 clx.TypeKind.FUNCTIONPROTO : ('@', 'functions', Type.FUNCTION), 459 clx.TypeKind.ENUM : ('E', 'enums', Type.ENUM),
|