Home | History | Annotate | Download | only in libclang

Lines Matching refs: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 } };
65 CXCursor cxcursor::MakeCXCursor(const Attr *A, const Decl *Parent,
68 CXCursor C = { GetCursorKind(A), 0, { Parent, A, TU } };
72 CXCursor cxcursor::MakeCXCursor(const Decl *D, CXTranslationUnit TU,
92 CXCursor C = { K, SelectorIdIndex,
97 CXCursor C = { K, 0, { D, (void*)(intptr_t) (FirstInDeclGroup ? 1 : 0), TU }};
101 CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent,
513 CXCursor C = { K, 0, { Parent, S, TU } };
546 CXCursor C = { K, 0, { Parent, S, TU } };
550 CXCursor cxcursor::MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super,
555 CXCursor C = { CXCursor_ObjCSuperClassRef, 0, { Super, RawLoc, TU } };
560 cxcursor::getCursorObjCSuperClassRef(CXCursor C) {
566 CXCursor cxcursor::MakeCursorObjCProtocolRef(const ObjCProtocolDecl *Proto,
571 CXCursor C = { CXCursor_ObjCProtocolRef, 0, { Proto, RawLoc, TU } };
576 cxcursor::getCursorObjCProtocolRef(CXCursor C) {
582 CXCursor cxcursor::MakeCursorObjCClassRef(const ObjCInterfaceDecl *Class,
590 CXCursor C = { CXCursor_ObjCClassRef, 0, { Class, RawLoc, TU } };
595 cxcursor::getCursorObjCClassRef(CXCursor C) {
601 CXCursor cxcursor::MakeCursorTypeRef(const TypeDecl *Type, SourceLocation Loc,
605 CXCursor C = { CXCursor_TypeRef, 0, { Type, RawLoc, TU } };
610 cxcursor::getCursorTypeRef(CXCursor C) {
616 CXCursor cxcursor::MakeCursorTemplateRef(const TemplateDecl *Template,
621 CXCursor C = { CXCursor_TemplateRef, 0, { Template, RawLoc, TU } };
626 cxcursor::getCursorTemplateRef(CXCursor C) {
632 CXCursor cxcursor::MakeCursorNamespaceRef(const NamedDecl *NS,
639 CXCursor C = { CXCursor_NamespaceRef, 0, { NS, RawLoc, TU } };
644 cxcursor::getCursorNamespaceRef(CXCursor C) {
650 CXCursor cxcursor::MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc,
655 CXCursor C = { CXCursor_VariableRef, 0, { Var, RawLoc, TU } };
660 cxcursor::getCursorVariableRef(CXCursor C) {
666 CXCursor cxcursor::MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc,
671 CXCursor C = { CXCursor_MemberRef, 0, { Field, RawLoc, TU } };
676 cxcursor::getCursorMemberRef(CXCursor C) {
682 CXCursor cxcursor::MakeCursorCXXBaseSpecifier(const CXXBaseSpecifier *B,
684 CXCursor C = { CXCursor_CXXBaseSpecifier, 0, { B, nullptr, TU } };
688 const CXXBaseSpecifier *cxcursor::getCursorCXXBaseSpecifier(CXCursor C) {
693 CXCursor cxcursor::MakePreprocessingDirectiveCursor(SourceRange Range,
695 CXCursor C = { CXCursor_PreprocessingDirective, 0,
703 SourceRange cxcursor::getCursorPreprocessingDirective(CXCursor C) {
711 CXCursor cxcursor::MakeMacroDefinitionCursor(const MacroDefinition *MI,
713 CXCursor C = { CXCursor_MacroDefinition, 0, { MI, nullptr, TU } };
717 const MacroDefinition *cxcursor::getCursorMacroDefinition(CXCursor C) {
722 CXCursor cxcursor::MakeMacroExpansionCursor(MacroExpansion *MI,
724 CXCursor C = { CXCursor_MacroExpansion, 0, { MI, nullptr, TU } };
728 CXCursor cxcursor::MakeMacroExpansionCursor(MacroDefinition *MI,
732 CXCursor C = { CXCursor_MacroExpansion, 0, { MI, Loc.getPtrEncoding(), TU } };
736 const IdentifierInfo *cxcursor::MacroExpansionCursor::getName() const {
741 const MacroDefinition *cxcursor::MacroExpansionCursor::getDefinition() const {
746 SourceRange cxcursor::MacroExpansionCursor::getSourceRange() const {
752 CXCursor cxcursor::MakeInclusionDirectiveCursor(InclusionDirective *ID,
754 CXCursor C = { CXCursor_InclusionDirective, 0, { ID, nullptr, TU } };
758 const InclusionDirective *cxcursor::getCursorInclusionDirective(CXCursor C) {
763 CXCursor cxcursor::MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc,
768 CXCursor C = { CXCursor_LabelRef, 0, { Label, RawLoc, TU } };
773 cxcursor::getCursorLabelRef(CXCursor C) {
779 CXCursor cxcursor::MakeCursorOverloadedDeclRef(const OverloadExpr *E,
784 CXCursor C = {
791 CXCursor cxcursor::MakeCursorOverloadedDeclRef(const Decl *D,
797 CXCursor C = {
804 CXCursor cxcursor::MakeCursorOverloadedDeclRef(TemplateName Name,
810 CXCursor C = {
817 std::pair<cxcursor::OverloadedDeclRefStorage, SourceLocation>
818 cxcursor::getCursorOverloadedDeclRef(CXCursor C) {
825 const Decl *cxcursor::getCursorDecl(CXCursor Cursor) {
829 const Expr *cxcursor::getCursorExpr(CXCursor Cursor) {
833 const Stmt *cxcursor::getCursorStmt(CXCursor Cursor) {
842 const Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
846 const Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
850 ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
854 ASTUnit *cxcursor::getCursorASTUnit(CXCursor Cursor) {
861 CXTranslationUnit cxcursor::getCursorTU(CXCursor Cursor) {
865 void cxcursor::getOverriddenCursors(CXCursor cursor,
866 SmallVectorImpl<CXCursor> &overridden) {
883 cxcursor::getSelectorIdentifierIndexAndLoc(CXCursor cursor) {
900 CXCursor cxcursor::getSelectorIdentifierCursor(int SelIdx, CXCursor cursor) {
901 CXCursor newCursor = cursor;
923 CXCursor cxcursor::getTypeRefCursor(CXCursor cursor) {
964 bool cxcursor::operator==(CXCursor X, CXCursor Y) {
971 bool cxcursor::isFirstInDeclGroup(CXCursor C) {
977 // libclang CXCursor APIs
982 int clang_Cursor_isNull(CXCursor cursor) {
986 CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor cursor) {
990 int clang_Cursor_getNumArguments(CXCursor C) {
992 const Decl *D = cxcursor::getCursorDecl(C);
1000 const Expr *E = cxcursor::getCursorExpr(C);
1009 CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i) {
1011 const Decl *D = cxcursor::getCursorDecl(C);
1014 return cxcursor::MakeCXCursor(MD->parameters()[i],
1015 cxcursor::getCursorTU(C));
1018 return cxcursor::MakeCXCursor(FD->parameters()[i],
1019 cxcursor::getCursorTU(C));
1024 const Expr *E = cxcursor::getCursorExpr(C);
1027 return cxcursor::MakeCXCursor(CE->getArg(i),
1029 cxcursor::getCursorTU(C));
1043 typedef llvm::DenseMap<CXCursor, unsigned> CXCursorSet_Impl;
1052 template<> struct DenseMapInfo<CXCursor> {
1054 static inline CXCursor getEmptyKey() {
1057 static inline CXCursor
1060 static inline unsigned getHashValue(const CXCursor &cursor) {
1064 static inline bool isEqual(const CXCursor &x, const CXCursor &y) {
1081 unsigned clang_CXCursorSet_contains(CXCursorSet set, CXCursor cursor) {
1088 unsigned clang_CXCursorSet_insert(CXCursorSet set, CXCursor cursor) {
1103 CXCompletionString clang_getCursorCompletionString(CXCursor cursor) {
1138 typedef SmallVector<CXCursor, 2> CursorVec;
1151 void *cxcursor::createOverridenCXCursorsPool() {
1155 void cxcursor::disposeOverridenCXCursorsPool(void *pool) {
1160 void clang_getOverriddenCursors(CXCursor cursor,
1161 CXCursor **overridden,
1168 CXTranslationUnit TU = cxcursor::getCursorTU(cursor);
1196 CXCursor backRefCursor = MakeCXCursorInvalid(CXCursor_InvalidFile, TU);
1198 assert(cxcursor::getCursorTU(backRefCursor) == TU);
1202 cxcursor::getOverriddenCursors(cursor, *Vec);
1217 void clang_disposeOverriddenCursors(CXCursor *overridden) {
1237 int clang_Cursor_isDynamicCall(CXCursor C) {
1262 CXType clang_Cursor_getReceiverType(CXCursor C) {
1263 CXTranslationUnit TU = cxcursor::getCursorTU(C);