Lines Matching defs:Cursor
688 static void PrintCursorComments(CXCursor Cursor,
696 RawComment = clang_Cursor_getRawCommentText(Cursor);
700 PrintRange(clang_Cursor_getCommentRange(Cursor), "RawCommentRange");
702 BriefComment = clang_Cursor_getBriefCommentText(Cursor);
712 CXComment Comment = clang_Cursor_getParsedComment(Cursor);
742 static CXString CursorToText(CXCursor Cursor) {
746 return clang_getCursorSpelling(Cursor);
748 return clang_getCursorDisplayName(Cursor);
750 CXPrintingPolicy Policy = clang_getCursorPrintingPolicy(Cursor);
752 text = clang_getCursorPrettyPrinted(Cursor, Policy);
764 static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
765 CXTranslationUnit TU = clang_Cursor_getTranslationUnit(Cursor);
766 if (clang_isInvalid(Cursor.kind)) {
767 CXString ks = clang_getCursorKindSpelling(Cursor.kind);
768 printf("Invalid Cursor => %s", clang_getCString(ks));
789 ks = clang_getCursorKindSpelling(Cursor.kind);
790 string = CursorToText(Cursor);
796 Referenced = clang_getCursorReferenced(Cursor);
829 if (clang_isCursorDefinition(Cursor))
832 switch (clang_getCursorAvailability(Cursor)) {
850 = clang_getCursorPlatformAvailability(Cursor,
890 if (clang_CXXConstructor_isDefaultConstructor(Cursor))
893 if (clang_CXXConstructor_isMoveConstructor(Cursor))
895 if (clang_CXXConstructor_isCopyConstructor(Cursor))
897 if (clang_CXXConstructor_isConvertingConstructor(Cursor))
899 if (clang_CXXField_isMutable(Cursor))
901 if (clang_CXXMethod_isDefaulted(Cursor))
903 if (clang_CXXMethod_isStatic(Cursor))
905 if (clang_CXXMethod_isVirtual(Cursor))
907 if (clang_CXXMethod_isConst(Cursor))
909 if (clang_CXXMethod_isPureVirtual(Cursor))
911 if (clang_CXXRecord_isAbstract(Cursor))
913 if (clang_EnumDecl_isScoped(Cursor))
915 if (clang_Cursor_isVariadic(Cursor))
917 if (clang_Cursor_isObjCOptional(Cursor))
919 if (clang_isInvalidDeclaration(Cursor))
922 switch (clang_getCursorExceptionSpecificationType(Cursor))
957 if (clang_Cursor_isExternalSymbol(Cursor, &language, &definedIn,
966 if (Cursor.kind == CXCursor_IBOutletCollectionAttr) {
968 clang_getCanonicalType(clang_getIBOutletCollectionType(Cursor));
974 if (Cursor.kind == CXCursor_CXXBaseSpecifier) {
975 enum CX_CXXAccessSpecifier access = clang_getCXXAccessSpecifier(Cursor);
976 unsigned isVirtual = clang_isVirtualBase(Cursor);
994 SpecializationOf = clang_getSpecializedCursorTemplate(Cursor);
1003 if (Cursor.kind == CXCursor_FunctionDecl) {
1005 int NumTemplateArgs = clang_Cursor_getNumTemplateArguments(Cursor);
1012 clang_Cursor_getTemplateArgumentKind(Cursor, I);
1016 CXType T = clang_Cursor_getTemplateArgumentType(Cursor, I);
1025 I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I));
1034 clang_getOverriddenCursors(Cursor, &overridden, &num_overridden);
1057 if (Cursor.kind == CXCursor_InclusionDirective) {
1058 CXFile File = clang_getIncludedFile(Cursor);
1068 CursorExtent = clang_getCursorExtent(Cursor);
1069 RefNameRange = clang_getCursorReferenceNameRange(Cursor,
1078 RefNameRange = clang_getCursorReferenceNameRange(Cursor,
1088 PrintCursorComments(Cursor, CommentSchemaFile);
1091 unsigned PropAttrs = clang_Cursor_getObjCPropertyAttributes(Cursor, 0);
1113 if (Cursor.kind == CXCursor_ObjCPropertyDecl) {
1114 CXString Name = clang_Cursor_getObjCPropertyGetterName(Cursor);
1115 CXString Spelling = clang_getCursorSpelling(Cursor);
1125 if (Cursor.kind == CXCursor_ObjCPropertyDecl) {
1126 CXString Name = clang_Cursor_getObjCPropertySetterName(Cursor);
1127 CXString Spelling = clang_getCursorSpelling(Cursor);
1142 unsigned QT = clang_Cursor_getObjCDeclQualifiers(Cursor);
1159 static const char* GetCursorSource(CXCursor Cursor) {
1160 CXSourceLocation Loc = clang_getCursorLocation(Cursor);
1297 enum CXChildVisitResult FilteredPrintingVisitor(CXCursor Cursor,
1301 if (!Data->Filter || (Cursor.kind == *(enum CXCursorKind *)Data->Filter)) {
1302 CXSourceLocation Loc = clang_getCursorLocation(Cursor);
1306 GetCursorSource(Cursor), line, column);
1307 PrintCursor(Cursor, Data->CommentSchemaFile);
1308 PrintCursorExtent(Cursor);
1309 if (clang_isDeclaration(Cursor.kind)) {
1310 enum CX_CXXAccessSpecifier access = clang_getCXXAccessSpecifier(Cursor);
1333 static enum CXChildVisitResult FunctionScanVisitor(CXCursor Cursor,
1341 if (Cursor.kind != CXCursor_FunctionDecl ||
1342 !clang_isCursorDefinition(Cursor))
1345 clang_getDefinitionSpellingAndExtent(Cursor, &startBuf, &endBuf,
1364 Loc = clang_getCursorLocation(Cursor);
1448 static enum CXChildVisitResult PrintLinkage(CXCursor cursor, CXCursor p,
1452 if (clang_isInvalid(clang_getCursorKind(cursor)))
1455 switch (clang_getCursorLinkage(cursor)) {
1464 PrintCursor(cursor, NULL);
1475 static enum CXChildVisitResult PrintVisibility(CXCursor cursor, CXCursor p,
1479 if (clang_isInvalid(clang_getCursorKind(cursor)))
1482 switch (clang_getCursorVisibility(cursor)) {
1490 PrintCursor(cursor, NULL);
1564 static enum CXChildVisitResult PrintType(CXCursor cursor, CXCursor p,
1566 if (!clang_isInvalid(clang_getCursorKind(cursor))) {
1567 CXType T = clang_getCursorType(cursor);
1570 PrintCursor(cursor, NULL);
1608 CXType RT = clang_getCursorResultType(cursor);
1616 int NumArgs = clang_Cursor_getNumArguments(cursor);
1621 CXType T = clang_getCursorType(clang_Cursor_getArgument(cursor, i));
1685 unsigned isAnon = clang_Cursor_isAnonymous(cursor);
1693 unsigned isAnonRecDecl = clang_Cursor_isAnonymousRecordDecl(cursor);
1699 unsigned isInlineNamespace = clang_Cursor_isInlineNamespace(cursor);
1737 static enum CXChildVisitResult PrintTypeSize(CXCursor cursor, CXCursor p,
1740 enum CXCursorKind K = clang_getCursorKind(cursor);
1743 T = clang_getCursorType(cursor);
1744 PrintCursor(cursor, NULL);
1749 CXString FieldSpelling = clang_getCursorSpelling(cursor);
1753 if (clang_getCursorKind(cursor) == CXCursor_FieldDecl) {
1767 long long Offset2 = clang_Cursor_getOffsetOfField(cursor);
1780 int IsBitfield = clang_Cursor_isBitField(cursor);
1782 printf(" [BitFieldSize=%d]", clang_getFieldDeclBitWidth(cursor));
1794 static enum CXChildVisitResult PrintMangledName(CXCursor cursor, CXCursor p,
1797 if (clang_isUnexposed(clang_getCursorKind(cursor)))
1799 PrintCursor(cursor, NULL);
1800 MangledName = clang_Cursor_getMangling(cursor);
1806 static enum CXChildVisitResult PrintManglings(CXCursor cursor, CXCursor p,
1810 if (clang_isUnexposed(clang_getCursorKind(cursor)))
1812 if (!clang_isDeclaration(clang_getCursorKind(cursor)))
1814 if (clang_getCursorKind(cursor) == CXCursor_ParmDecl)
1816 PrintCursor(cursor, NULL);
1817 Manglings = clang_Cursor_getCXXManglings(cursor);
1824 Manglings = clang_Cursor_getObjCManglings(cursor);
1838 static enum CXChildVisitResult PrintBitWidth(CXCursor cursor, CXCursor p,
1841 if (clang_getCursorKind(cursor) != CXCursor_FieldDecl)
1844 Bitwidth = clang_getFieldDeclBitWidth(cursor);
1846 PrintCursor(cursor, NULL);
1857 static enum CXChildVisitResult PrintTypeDeclaration(CXCursor cursor, CXCursor p,
1859 CXCursor typeDeclaration = clang_getTypeDeclaration(clang_getCursorType(cursor));
1862 PrintCursor(cursor, NULL);
1873 static enum CXChildVisitResult PrintDeclAttributes(CXCursor cursor, CXCursor p,
1875 if (clang_isDeclaration(cursor.kind)) {
1877 PrintCursor(cursor, NULL);
1879 } else if (clang_isAttribute(cursor.kind)) {
1881 PrintCursor(cursor, NULL);
2252 static void print_cursor_file_scan(CXTranslationUnit TU, CXCursor cursor,
2261 PrintCursor(cursor, NULL);
2292 CXCursor cursor;
2301 /* Check the cursor at this position, and dump the previous one if we have
2304 cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
2305 if ((c == EOF || !clang_equalCursors(cursor, prevCursor)) &&
2315 prevCursor = cursor;
2811 typedef void (*cursor_handler_t)(CXCursor cursor);
2822 CXCursor Cursor;
2889 Cursor = clang_getCursor(TU,
2897 handler(Cursor);
2911 static void inspect_print_cursor(CXCursor Cursor) {
2912 CXTranslationUnit TU = clang_Cursor_getTranslationUnit(Cursor);
2914 Cursor);
2915 CXSourceLocation CursorLoc = clang_getCursorLocation(Cursor);
2921 PrintCursor(Cursor, NULL);
2922 PrintCursorExtent(Cursor);
2923 Spelling = clang_getCursorSpelling(Cursor);
2930 clang_Cursor_getSpellingNameRange(Cursor, pieceIndex, 0);
2938 if (clang_Cursor_getObjCSelectorIndex(Cursor) != -1)
2940 clang_Cursor_getObjCSelectorIndex(Cursor));
2941 if (clang_Cursor_isDynamicCall(Cursor))
2943 if (Cursor.kind == CXCursor_ObjCMessageExpr ||
2944 Cursor.kind == CXCursor_MemberRefExpr) {
2945 CXType T = clang_Cursor_getReceiverType(Cursor);
2954 CXModule mod = clang_Cursor_getModule(Cursor);
3028 static void inspect_evaluate_cursor(CXCursor Cursor) {
3029 CXSourceLocation CursorLoc = clang_getCursorLocation(Cursor);
3037 PrintCursor(Cursor, NULL);
3038 PrintCursorExtent(Cursor);
3039 Spelling = clang_getCursorSpelling(Cursor);
3046 clang_Cursor_getSpellingNameRange(Cursor, pieceIndex, 0);
3055 ER = clang_Cursor_Evaluate(Cursor);
3065 static void inspect_macroinfo_cursor(CXCursor Cursor) {
3066 CXSourceLocation CursorLoc = clang_getCursorLocation(Cursor);
3072 PrintCursor(Cursor, NULL);
3073 PrintCursorExtent(Cursor);
3074 Spelling = clang_getCursorSpelling(Cursor);
3081 clang_Cursor_getSpellingNameRange(Cursor, pieceIndex, 0);
3090 if (clang_Cursor_isMacroBuiltin(Cursor)) {
3092 } else if (clang_Cursor_isMacroFunctionLike(Cursor)) {
3099 CXCursor cursor, CXSourceRange range) {
3103 PrintCursor(cursor, NULL);
3116 CXCursor Cursor;
3184 Cursor = clang_getCursor(TU,
3193 PrintCursor(Cursor, NULL);
3195 clang_findReferencesInFile(Cursor, file, visitor);
3213 CXCursor cursor, CXSourceRange range) {
3214 PrintCursor(cursor, NULL);
3563 PrintCursor(Attr->cursor, NULL);
3570 printf(" | cursor: ");
3571 PrintCursor(info->cursor, NULL);
3582 printf(" | cursor: ");
3583 PrintCursor(ProtoInfo->protocols[i]->cursor, NULL);
3731 printf(" | cursor: ");
3732 PrintCursor(info->cursor, NULL);
3752 PrintCursor(Attr->cursor, NULL);
3774 printf(" | cursor: ");
3820 printf(" | cursor: ");
3821 PrintCursor(info->cursor, NULL);
4801 " c-index-test -cursor-at=<site> <compiler arguments>\n"
4802 " c-index-test -evaluate-cursor-at=<site> <compiler arguments>\n"
4803 " c-index-test -get-macro-info-cursor-at=<site> <compiler arguments>\n"
4869 if (argc > 2 && strstr(argv[1], "-cursor-at=") == argv[1])
4870 return inspect_cursor_at(argc, argv, "-cursor-at=", inspect_print_cursor);
4871 if (argc > 2 && strstr(argv[1], "-evaluate-cursor-at=") == argv[1])
4872 return inspect_cursor_at(argc, argv, "-evaluate-cursor-at=",
4874 if (argc > 2 && strstr(argv[1], "-get-macro-info-cursor-at=") == argv[1])
4875 return inspect_cursor_at(argc, argv, "-get-macro-info-cursor-at=",