(Arch, VarDecl, Cursor)
| 272 | return Arch |
| 273 | |
| 274 | def HandleVarDeclElements(Arch, VarDecl, Cursor): |
| 275 | for Child in Cursor.get_children(): |
| 276 | |
| 277 | if (Child.kind == CursorKind.ANNOTATE_ATTR): |
| 278 | if (Child.spelling.startswith("ioctl-alias-")): |
| 279 | Sections = Child.spelling.split("-") |
| 280 | if (Sections[2] == "x86_32"): |
| 281 | VarDecl.Aliases.append(AliasType(Sections[3], AliasType.ALIAS_X86_32)) |
| 282 | elif (Sections[2] == "x86_64"): |
| 283 | VarDecl.Aliases.append(AliasType(Sections[3], AliasType.ALIAS_X86_64)) |
| 284 | elif (Sections[2] == "aarch64"): |
| 285 | VarDecl.Aliases.append(AliasType(Sections[3], AliasType.ALIAS_AARCH64)) |
| 286 | elif (Sections[2] == "win32"): |
| 287 | VarDecl.Aliases.append(AliasType(Sections[3], AliasType.ALIAS_WIN32)) |
| 288 | elif (Sections[2] == "win64"): |
| 289 | VarDecl.Aliases.append(AliasType(Sections[3], AliasType.ALIAS_WIN64)) |
| 290 | else: |
| 291 | logging.critical ("Can't handle alias type '{0}'".format(Child.spelling)) |
| 292 | Arch.Parsed = False |
| 293 | elif (Child.spelling == "fex-match"): |
| 294 | VarDecl.ExpectedFEXMatch = True |
| 295 | else: |
| 296 | # Unknown annotation |
| 297 | pass |
| 298 | elif (Child.kind == CursorKind.TYPE_REF or |
| 299 | Child.kind == CursorKind.UNEXPOSED_EXPR or |
| 300 | Child.kind == CursorKind.PAREN_EXPR or |
| 301 | Child.kind == CursorKind.BINARY_OPERATOR |
| 302 | ): |
| 303 | pass |
| 304 | |
| 305 | return VarDecl |
| 306 | |
| 307 | def HandleTypeDefDeclCursor(Arch, Cursor): |
| 308 | TypeDefType = Cursor.underlying_typedef_type |
no test coverage detected