Skip to content

Commit eb264d8

Browse files
authored
Add some missing Kinds to libclang python bindings (llvm#85571)
Add some Kinds existing in Index.h but missing in cindex.py.
1 parent 276847a commit eb264d8

File tree

3 files changed

+175
-2
lines changed

3 files changed

+175
-2
lines changed

clang/bindings/python/clang/cindex.py

Lines changed: 172 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,29 @@ def __repr__(self):
10911091
# Represents an @available(...) check.
10921092
CursorKind.OBJC_AVAILABILITY_CHECK_EXPR = CursorKind(148)
10931093

1094+
# Fixed point literal.
1095+
CursorKind.FIXED_POINT_LITERAL = CursorKind(149)
1096+
1097+
# OpenMP 5.0 [2.1.4, Array Shaping].
1098+
CursorKind.OMP_ARRAY_SHAPING_EXPR = CursorKind(150)
1099+
1100+
# OpenMP 5.0 [2.1.6 Iterators].
1101+
CursorKind.OMP_ITERATOR_EXPR = CursorKind(151)
1102+
1103+
# OpenCL's addrspace_cast<> expression.
1104+
CursorKind.CXX_ADDRSPACE_CAST_EXPR = CursorKind(152)
1105+
1106+
# Expression that references a C++20 concept.
1107+
CursorKind.CONCEPT_SPECIALIZATION_EXPR = CursorKind(153)
1108+
1109+
# Expression that references a C++20 requires expression.
1110+
CursorKind.REQUIRES_EXPR = CursorKind(154)
1111+
1112+
# Expression that references a C++20 parenthesized list aggregate initializer.
1113+
CursorKind.CXX_PAREN_LIST_INIT_EXPR = CursorKind(155)
1114+
1115+
# Represents a C++26 pack indexing expression.
1116+
CursorKind.PACK_INDEXING_EXPR = CursorKind(156)
10941117

10951118
# A statement whose specific kind is not exposed via this interface.
10961119
#
@@ -1312,6 +1335,114 @@ def __repr__(self):
13121335
# OpenMP teams distribute directive.
13131336
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(271)
13141337

1338+
# OpenMP teams distribute simd directive.
1339+
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(272)
1340+
1341+
# OpenMP teams distribute parallel for simd directive.
1342+
CursorKind.OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE = CursorKind(273)
1343+
1344+
# OpenMP teams distribute parallel for directive.
1345+
CursorKind.OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE = CursorKind(274)
1346+
1347+
# OpenMP target teams directive.
1348+
CursorKind.OMP_TARGET_TEAMS_DIRECTIVE = CursorKind(275)
1349+
1350+
# OpenMP target teams distribute directive.
1351+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(276)
1352+
1353+
# OpenMP target teams distribute parallel for directive.
1354+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE = CursorKind(277)
1355+
1356+
# OpenMP target teams distribute parallel for simd directive.
1357+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE = CursorKind(278)
1358+
1359+
# OpenMP target teams distribute simd directive.
1360+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE = CursorKind(279)
1361+
1362+
# C++2a std::bit_cast expression.
1363+
CursorKind.BUILTIN_BIT_CAST_EXPR = CursorKind(280)
1364+
1365+
# OpenMP master taskloop directive.
1366+
CursorKind.OMP_MASTER_TASK_LOOP_DIRECTIVE = CursorKind(281)
1367+
1368+
# OpenMP parallel master taskloop directive.
1369+
CursorKind.OMP_PARALLEL_MASTER_TASK_LOOP_DIRECTIVE = CursorKind(282)
1370+
1371+
# OpenMP master taskloop simd directive.
1372+
CursorKind.OMP_MASTER_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(283)
1373+
1374+
# OpenMP parallel master taskloop simd directive.
1375+
CursorKind.OMP_PARALLEL_MASTER_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(284)
1376+
1377+
# OpenMP parallel master directive.
1378+
CursorKind.OMP_PARALLEL_MASTER_DIRECTIVE = CursorKind(285)
1379+
1380+
# OpenMP depobj directive.
1381+
CursorKind.OMP_DEPOBJ_DIRECTIVE = CursorKind(286)
1382+
1383+
# OpenMP scan directive.
1384+
CursorKind.OMP_SCAN_DIRECTIVE = CursorKind(287)
1385+
1386+
# OpenMP tile directive.
1387+
CursorKind.OMP_TILE_DIRECTIVE = CursorKind(288)
1388+
1389+
# OpenMP canonical loop.
1390+
CursorKind.OMP_CANONICAL_LOOP = CursorKind(289)
1391+
1392+
# OpenMP interop directive.
1393+
CursorKind.OMP_INTEROP_DIRECTIVE = CursorKind(290)
1394+
1395+
# OpenMP dispatch directive.
1396+
CursorKind.OMP_DISPATCH_DIRECTIVE = CursorKind(291)
1397+
1398+
# OpenMP masked directive.
1399+
CursorKind.OMP_MASKED_DIRECTIVE = CursorKind(292)
1400+
1401+
# OpenMP unroll directive.
1402+
CursorKind.OMP_UNROLL_DIRECTIVE = CursorKind(293)
1403+
1404+
# OpenMP metadirective directive.
1405+
CursorKind.OMP_META_DIRECTIVE = CursorKind(294)
1406+
1407+
# OpenMP loop directive.
1408+
CursorKind.OMP_GENERIC_LOOP_DIRECTIVE = CursorKind(295)
1409+
1410+
# OpenMP teams loop directive.
1411+
CursorKind.OMP_TEAMS_GENERIC_LOOP_DIRECTIVE = CursorKind(296)
1412+
1413+
# OpenMP target teams loop directive.
1414+
CursorKind.OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE = CursorKind(297)
1415+
1416+
# OpenMP parallel loop directive.
1417+
CursorKind.OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE = CursorKind(298)
1418+
1419+
# OpenMP target parallel loop directive.
1420+
CursorKind.OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE = CursorKind(299)
1421+
1422+
# OpenMP parallel masked directive.
1423+
CursorKind.OMP_PARALLEL_MASKED_DIRECTIVE = CursorKind(300)
1424+
1425+
# OpenMP masked taskloop directive.
1426+
CursorKind.OMP_MASKED_TASK_LOOP_DIRECTIVE = CursorKind(301)
1427+
1428+
# OpenMP masked taskloop simd directive.
1429+
CursorKind.OMP_MASKED_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(302)
1430+
1431+
# OpenMP parallel masked taskloop directive.
1432+
CursorKind.OMP_PARALLEL_MASKED_TASK_LOOP_DIRECTIVE = CursorKind(303)
1433+
1434+
# OpenMP parallel masked taskloop simd directive.
1435+
CursorKind.OMP_PARALLEL_MASKED_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(304)
1436+
1437+
# OpenMP error directive.
1438+
CursorKind.OMP_ERROR_DIRECTIVE = CursorKind(305)
1439+
1440+
# OpenMP scope directive.
1441+
CursorKind.OMP_SCOPE_DIRECTIVE = CursorKind(306)
1442+
1443+
# OpenACC Compute Construct.
1444+
CursorKind.OPEN_ACC_COMPUTE_DIRECTIVE = CursorKind(320)
1445+
13151446
###
13161447
# Other Kinds
13171448

@@ -1349,6 +1480,24 @@ def __repr__(self):
13491480

13501481
CursorKind.DLLEXPORT_ATTR = CursorKind(418)
13511482
CursorKind.DLLIMPORT_ATTR = CursorKind(419)
1483+
CursorKind.NS_RETURNS_RETAINED = CursorKind(420)
1484+
CursorKind.NS_RETURNS_NOT_RETAINED = CursorKind(421)
1485+
CursorKind.NS_RETURNS_AUTORELEASED = CursorKind(422)
1486+
CursorKind.NS_CONSUMES_SELF = CursorKind(423)
1487+
CursorKind.NS_CONSUMED = CursorKind(424)
1488+
CursorKind.OBJC_EXCEPTION = CursorKind(425)
1489+
CursorKind.OBJC_NSOBJECT = CursorKind(426)
1490+
CursorKind.OBJC_INDEPENDENT_CLASS = CursorKind(427)
1491+
CursorKind.OBJC_PRECISE_LIFETIME = CursorKind(428)
1492+
CursorKind.OBJC_RETURNS_INNER_POINTER = CursorKind(429)
1493+
CursorKind.OBJC_REQUIRES_SUPER = CursorKind(430)
1494+
CursorKind.OBJC_ROOT_CLASS = CursorKind(431)
1495+
CursorKind.OBJC_SUBCLASSING_RESTRICTED = CursorKind(432)
1496+
CursorKind.OBJC_EXPLICIT_PROTOCOL_IMPL = CursorKind(433)
1497+
CursorKind.OBJC_DESIGNATED_INITIALIZER = CursorKind(434)
1498+
CursorKind.OBJC_RUNTIME_VISIBLE = CursorKind(435)
1499+
CursorKind.OBJC_BOXABLE = CursorKind(436)
1500+
CursorKind.FLAG_ENUM = CursorKind(437)
13521501
CursorKind.CONVERGENT_ATTR = CursorKind(438)
13531502
CursorKind.WARN_UNUSED_ATTR = CursorKind(439)
13541503
CursorKind.WARN_UNUSED_RESULT_ATTR = CursorKind(440)
@@ -1395,6 +1544,11 @@ class TemplateArgumentKind(BaseEnumeration):
13951544
TemplateArgumentKind.DECLARATION = TemplateArgumentKind(2)
13961545
TemplateArgumentKind.NULLPTR = TemplateArgumentKind(3)
13971546
TemplateArgumentKind.INTEGRAL = TemplateArgumentKind(4)
1547+
TemplateArgumentKind.TEMPLATE = TemplateArgumentKind(5)
1548+
TemplateArgumentKind.TEMPLATE_EXPANSION = TemplateArgumentKind(6)
1549+
TemplateArgumentKind.EXPRESSION = TemplateArgumentKind(7)
1550+
TemplateArgumentKind.PACK = TemplateArgumentKind(8)
1551+
TemplateArgumentKind.INVALID = TemplateArgumentKind(9)
13981552

13991553
### Exception Specification Kinds ###
14001554
class ExceptionSpecificationKind(BaseEnumeration):
@@ -2240,9 +2394,26 @@ def __repr__(self):
22402394
TypeKind.OCLQUEUE = TypeKind(159)
22412395
TypeKind.OCLRESERVEID = TypeKind(160)
22422396

2397+
TypeKind.OBJCOBJECT = TypeKind(161)
2398+
TypeKind.OBJCCLASS = TypeKind(162)
2399+
TypeKind.ATTRIBUTED = TypeKind(163)
2400+
2401+
TypeKind.OCLINTELSUBGROUPAVCMCEPAYLOAD = TypeKind(164)
2402+
TypeKind.OCLINTELSUBGROUPAVCIMEPAYLOAD = TypeKind(165)
2403+
TypeKind.OCLINTELSUBGROUPAVCREFPAYLOAD = TypeKind(166)
2404+
TypeKind.OCLINTELSUBGROUPAVCSICPAYLOAD = TypeKind(167)
2405+
TypeKind.OCLINTELSUBGROUPAVCMCERESULT = TypeKind(168)
2406+
TypeKind.OCLINTELSUBGROUPAVCIMERESULT = TypeKind(169)
2407+
TypeKind.OCLINTELSUBGROUPAVCREFRESULT = TypeKind(170)
2408+
TypeKind.OCLINTELSUBGROUPAVCSICRESULT = TypeKind(171)
2409+
TypeKind.OCLINTELSUBGROUPAVCIMERESULTSINGLEREFERENCESTREAMOUT = TypeKind(172)
2410+
TypeKind.OCLINTELSUBGROUPAVCIMERESULTSDUALREFERENCESTREAMOUT = TypeKind(173)
2411+
TypeKind.OCLINTELSUBGROUPAVCIMERESULTSSINGLEREFERENCESTREAMIN = TypeKind(174)
2412+
TypeKind.OCLINTELSUBGROUPAVCIMEDUALREFERENCESTREAMIN = TypeKind(175)
2413+
22432414
TypeKind.EXTVECTOR = TypeKind(176)
22442415
TypeKind.ATOMIC = TypeKind(177)
2245-
2416+
TypeKind.BTFTAGATTRIBUTED = TypeKind(178)
22462417

22472418
class RefQualifierKind(BaseEnumeration):
22482419
"""Describes a specific ref-qualifier of a type."""

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ Python Binding Changes
550550
----------------------
551551

552552
- Exposed `CXRewriter` API as `class Rewriter`.
553+
- Add some missing kinds from Index.h (CursorKind: 149-156, 272-320, 420-437.
554+
TemplateArgumentKind: 5-9. TypeKind: 161-175 and 178).
553555

554556
OpenMP Support
555557
--------------

clang/include/clang-c/Index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ enum CXCursorKind {
16751675
CXCursor_ConceptSpecializationExpr = 153,
16761676

16771677
/**
1678-
* Expression that references a C++20 concept.
1678+
* Expression that references a C++20 requires expression.
16791679
*/
16801680
CXCursor_RequiresExpr = 154,
16811681

0 commit comments

Comments
 (0)