Home | History | Annotate | Download | only in libclang

Lines Matching full:cxcursor

1 //===- CXCursor.cpp - Routines for manipulating CXCursors -----------------===//
12 // CXCursor.
17 #include "CXCursor.h"
33 using namespace cxcursor;
35 CXCursor cxcursor::MakeCXCursorInvalid(CXCursorKind K, CXTranslationUnit TU) {
37 CXCursor C = { K, 0, { nullptr, nullptr, TU } };
69 CXCursor cxcursor::MakeCXCursor(const Attr *A, const Decl *Parent,
72 CXCursor C = { GetCursorKind(A), 0, { Parent, A, TU } };
76 CXCursor cxcursor::MakeCXCursor(const Decl *D, CXTranslationUnit TU,
96 CXCursor C = { K, SelectorIdIndex,
101 CXCursor C = { K, 0, { D, (void*)(intptr_t) (FirstInDeclGroup ? 1 : 0), TU }};
105 CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent,
530 CXCursor C = { K, 0, { Parent, S, TU } };
623 CXCursor C = { K, 0, { Parent, S, TU } };
627 CXCursor cxcursor::MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super,
632 CXCursor C = { CXCursor_ObjCSuperClassRef, 0, { Super, RawLoc, TU } };
637 cxcursor::getCursorObjCSuperClassRef(CXCursor C) {
643 CXCursor cxcursor::MakeCursorObjCProtocolRef(const ObjCProtocolDecl *Proto,
648 CXCursor C = { CXCursor_ObjCProtocolRef, 0, { Proto, RawLoc, TU } };
653 cxcursor::getCursorObjCProtocolRef(CXCursor C) {
659 CXCursor cxcursor::MakeCursorObjCClassRef(const ObjCInterfaceDecl *Class,
667 CXCursor C = { CXCursor_ObjCClassRef, 0, { Class, RawLoc, TU } };
672 cxcursor::getCursorObjCClassRef(CXCursor C) {
678 CXCursor cxcursor::MakeCursorTypeRef(const TypeDecl *Type, SourceLocation Loc,
682 CXCursor C = { CXCursor_TypeRef, 0, { Type, RawLoc, TU } };
687 cxcursor::getCursorTypeRef(CXCursor C) {
693 CXCursor cxcursor::MakeCursorTemplateRef(const TemplateDecl *Template,
698 CXCursor C = { CXCursor_TemplateRef, 0, { Template, RawLoc, TU } };
703 cxcursor::getCursorTemplateRef(CXCursor C) {
709 CXCursor cxcursor::MakeCursorNamespaceRef(const NamedDecl *NS,
716 CXCursor C = { CXCursor_NamespaceRef, 0, { NS, RawLoc, TU } };
721 cxcursor::getCursorNamespaceRef(CXCursor C) {
727 CXCursor cxcursor::MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc,
732 CXCursor C = { CXCursor_VariableRef, 0, { Var, RawLoc, TU } };
737 cxcursor::getCursorVariableRef(CXCursor C) {
743 CXCursor cxcursor::MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc,
748 CXCursor C = { CXCursor_MemberRef, 0, { Field, RawLoc, TU } };
753 cxcursor::getCursorMemberRef(CXCursor C) {
759 CXCursor cxcursor::MakeCursorCXXBaseSpecifier(const CXXBaseSpecifier *B,
761 CXCursor C = { CXCursor_CXXBaseSpecifier, 0, { B, nullptr, TU } };
765 const CXXBaseSpecifier *cxcursor::getCursorCXXBaseSpecifier(CXCursor C) {
770 CXCursor cxcursor::MakePreprocessingDirectiveCursor(SourceRange Range,
772 CXCursor C = { CXCursor_PreprocessingDirective, 0,
780 SourceRange cxcursor::getCursorPreprocessingDirective(CXCursor C) {
788 CXCursor cxcursor::MakeMacroDefinitionCursor(const MacroDefinitionRecord *MI,
790 CXCursor C = {CXCursor_MacroDefinition, 0, {MI, nullptr, TU}};
794 const MacroDefinitionRecord *cxcursor::getCursorMacroDefinition(CXCursor C) {
799 CXCursor cxcursor::MakeMacroExpansionCursor(MacroExpansion *MI,
801 CXCursor C = { CXCursor_MacroExpansion, 0, { MI, nullptr, TU } };
805 CXCursor cxcursor::MakeMacroExpansionCursor(MacroDefinitionRecord *MI,
809 CXCursor C = {CXCursor_MacroExpansion, 0, {MI, Loc.getPtrEncoding(), TU}};
813 const IdentifierInfo *cxcursor::MacroExpansionCursor::getName() const {
819 cxcursor::MacroExpansionCursor::getDefinition() const {
824 SourceRange cxcursor::MacroExpansionCursor::getSourceRange() const {
830 CXCursor cxcursor::MakeInclusionDirectiveCursor(InclusionDirective *ID,
832 CXCursor C = { CXCursor_InclusionDirective, 0, { ID, nullptr, TU } };
836 const InclusionDirective *cxcursor::getCursorInclusionDirective(CXCursor C) {
841 CXCursor cxcursor::MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc,
846 CXCursor C = { CXCursor_LabelRef, 0, { Label, RawLoc, TU } };
851 cxcursor::getCursorLabelRef(CXCursor C) {
857 CXCursor cxcursor::MakeCursorOverloadedDeclRef(const OverloadExpr *E,
862 CXCursor C = {
869 CXCursor cxcursor::MakeCursorOverloadedDeclRef(const Decl *D,
875 CXCursor C = {
882 CXCursor cxcursor::MakeCursorOverloadedDeclRef(TemplateName Name,
888 CXCursor C = {
895 std::pair<cxcursor::OverloadedDeclRefStorage, SourceLocation>
896 cxcursor::getCursorOverloadedDeclRef(CXCursor C) {
903 const Decl *cxcursor::getCursorDecl(CXCursor Cursor) {
907 const Expr *cxcursor::getCursorExpr(CXCursor Cursor) {
911 const Stmt *cxcursor::getCursorStmt(CXCursor Cursor) {
920 const Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
924 const Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
928 ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
932 ASTUnit *cxcursor::getCursorASTUnit(CXCursor Cursor) {
939 CXTranslationUnit cxcursor::getCursorTU(CXCursor Cursor) {
943 void cxcursor::getOverriddenCursors(CXCursor cursor,
944 SmallVectorImpl<CXCursor> &overridden) {
961 cxcursor::getSelectorIdentifierIndexAndLoc(CXCursor cursor) {
978 CXCursor cxcursor::getSelectorIdentifierCursor(int SelIdx, CXCursor cursor) {
979 CXCursor newCursor = cursor;
1001 CXCursor cxcursor::getTypeRefCursor(CXCursor cursor) {
1042 bool cxcursor::operator==(CXCursor X, CXCursor Y) {
1049 bool cxcursor::isFirstInDeclGroup(CXCursor C) {
1055 // libclang CXCursor APIs
1060 int clang_Cursor_isNull(CXCursor cursor) {
1064 CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor cursor) {
1068 int clang_Cursor_getNumArguments(CXCursor C) {
1070 const Decl *D = cxcursor::getCursorDecl(C);
1078 const Expr *E = cxcursor::getCursorExpr(C);
1087 CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i) {
1089 const Decl *D = cxcursor::getCursorDecl(C);
1092 return cxcursor::MakeCXCursor(MD->parameters()[i],
1093 cxcursor::getCursorTU(C));
1096 return cxcursor::MakeCXCursor(FD->parameters()[i],
1097 cxcursor::getCursorTU(C));
1102 const Expr *E = cxcursor::getCursorExpr(C);
1105 return cxcursor::MakeCXCursor(CE->getArg(i),
1107 cxcursor::getCursorTU(C));
1115 int clang_Cursor_getNumTemplateArguments(CXCursor C) {
1153 CXCursor C, unsigned I, TemplateArgument *TA) {
1178 enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind(CXCursor C,
1202 CXType clang_Cursor_getTemplateArgumentType(CXCursor C, unsigned I) {
1216 long long clang_Cursor_getTemplateArgumentValue(CXCursor C, unsigned I) {
1232 unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue(CXCursor C,
1255 typedef llvm::DenseMap<CXCursor, unsigned> CXCursorSet_Impl;
1264 template<> struct DenseMapInfo<CXCursor> {
1266 static inline CXCursor getEmptyKey() {
1269 static inline CXCursor getTombstoneKey() {
1272 static inline unsigned getHashValue(const CXCursor &cursor) {
1276 static inline bool isEqual(const CXCursor &x, const CXCursor &y) {
1293 unsigned clang_CXCursorSet_contains(CXCursorSet set, CXCursor cursor) {
1300 unsigned clang_CXCursorSet_insert(CXCursorSet set, CXCursor cursor) {
1315 CXCompletionString clang_getCursorCompletionString(CXCursor cursor) {
1351 typedef SmallVector<CXCursor, 2> CursorVec;
1364 void *cxcursor::createOverridenCXCursorsPool() {
1368 void cxcursor::disposeOverridenCXCursorsPool(void *pool) {
1373 void clang_getOverriddenCursors(CXCursor cursor,
1374 CXCursor **overridden,
1381 CXTranslationUnit TU = cxcursor::getCursorTU(cursor);
1409 CXCursor backRefCursor = MakeCXCursorInvalid(CXCursor_InvalidFile, TU);
1411 assert(cxcursor::getCursorTU(backRefCursor) == TU);
1415 cxcursor::getOverriddenCursors(cursor, *Vec);
1430 void clang_disposeOverriddenCursors(CXCursor *overridden) {
1450 int clang_Cursor_isDynamicCall(CXCursor C) {
1483 CXType clang_Cursor_getReceiverType(CXCursor C) {
1484 CXTranslationUnit TU = cxcursor::getCursorTU(C);