Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 1 | //===- CXCursor.h - Routines for manipulating CXCursors -------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines routines for manipulating CXCursors. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_CLANG_CXCURSOR_H |
Ted Kremenek | 2cd10b0 | 2010-01-25 21:09:34 +0000 | [diff] [blame] | 15 | #define LLVM_CLANG_CXCURSOR_H |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 16 | |
| 17 | #include "clang-c/Index.h" |
Douglas Gregor | 2e331b9 | 2010-01-16 14:00:32 +0000 | [diff] [blame] | 18 | #include "clang/Basic/SourceLocation.h" |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 19 | #include "llvm/ADT/PointerUnion.h" |
Douglas Gregor | 2e331b9 | 2010-01-16 14:00:32 +0000 | [diff] [blame] | 20 | #include <utility> |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 21 | |
| 22 | namespace clang { |
| 23 | |
Douglas Gregor | f46034a | 2010-01-18 23:41:10 +0000 | [diff] [blame] | 24 | class ASTContext; |
Douglas Gregor | b2cd487 | 2010-01-20 23:57:43 +0000 | [diff] [blame] | 25 | class ASTUnit; |
Ted Kremenek | e77f443 | 2010-02-18 03:09:07 +0000 | [diff] [blame] | 26 | class Attr; |
Ted Kremenek | 3064ef9 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 27 | class CXXBaseSpecifier; |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 28 | class Decl; |
Douglas Gregor | 283cae3 | 2010-01-15 21:56:13 +0000 | [diff] [blame] | 29 | class Expr; |
Douglas Gregor | a67e03f | 2010-09-09 21:42:20 +0000 | [diff] [blame] | 30 | class FieldDecl; |
Douglas Gregor | ecdcb88 | 2010-10-20 22:00:55 +0000 | [diff] [blame] | 31 | class InclusionDirective; |
Douglas Gregor | 36897b0 | 2010-09-10 00:22:18 +0000 | [diff] [blame] | 32 | class LabelStmt; |
Douglas Gregor | 572feb2 | 2010-03-18 18:04:21 +0000 | [diff] [blame] | 33 | class MacroDefinition; |
Chandler Carruth | 9e5bb85 | 2011-07-14 08:20:46 +0000 | [diff] [blame] | 34 | class MacroExpansion; |
Douglas Gregor | 283cae3 | 2010-01-15 21:56:13 +0000 | [diff] [blame] | 35 | class NamedDecl; |
Douglas Gregor | 2e331b9 | 2010-01-16 14:00:32 +0000 | [diff] [blame] | 36 | class ObjCInterfaceDecl; |
Douglas Gregor | 78db0cd | 2010-01-16 15:44:18 +0000 | [diff] [blame] | 37 | class ObjCProtocolDecl; |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 38 | class OverloadedTemplateStorage; |
| 39 | class OverloadExpr; |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 40 | class Stmt; |
Douglas Gregor | 0b36e61 | 2010-08-31 20:37:03 +0000 | [diff] [blame] | 41 | class TemplateDecl; |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 42 | class TemplateName; |
Douglas Gregor | 7d0d40e | 2010-01-21 16:28:34 +0000 | [diff] [blame] | 43 | class TypeDecl; |
Douglas Gregor | 011d8b9 | 2012-02-15 00:54:55 +0000 | [diff] [blame] | 44 | class VarDecl; |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 45 | |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 46 | namespace cxcursor { |
Argyrios Kyrtzidis | 671436e | 2011-09-27 00:30:33 +0000 | [diff] [blame] | 47 | |
| 48 | CXCursor getCursor(CXTranslationUnit, SourceLocation); |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 49 | |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 50 | CXCursor MakeCXCursor(const clang::Attr *A, clang::Decl *Parent, |
| 51 | CXTranslationUnit TU); |
| 52 | CXCursor MakeCXCursor(clang::Decl *D, CXTranslationUnit TU, |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 53 | SourceRange RegionOfInterest = SourceRange(), |
Ted Kremenek | 007a7c9 | 2010-11-01 23:26:51 +0000 | [diff] [blame] | 54 | bool FirstInDeclGroup = true); |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 55 | CXCursor MakeCXCursor(clang::Stmt *S, clang::Decl *Parent, |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 56 | CXTranslationUnit TU, |
| 57 | SourceRange RegionOfInterest = SourceRange()); |
Ted Kremenek | bbf66ca | 2012-04-30 19:06:49 +0000 | [diff] [blame] | 58 | CXCursor MakeCXCursorInvalid(CXCursorKind K, CXTranslationUnit TU = 0); |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 59 | |
Douglas Gregor | 2e331b9 | 2010-01-16 14:00:32 +0000 | [diff] [blame] | 60 | /// \brief Create an Objective-C superclass reference at the given location. |
| 61 | CXCursor MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super, |
Douglas Gregor | b2cd487 | 2010-01-20 23:57:43 +0000 | [diff] [blame] | 62 | SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 63 | CXTranslationUnit TU); |
Douglas Gregor | 2e331b9 | 2010-01-16 14:00:32 +0000 | [diff] [blame] | 64 | |
| 65 | /// \brief Unpack an ObjCSuperClassRef cursor into the interface it references |
| 66 | /// and optionally the location where the reference occurred. |
| 67 | std::pair<ObjCInterfaceDecl *, SourceLocation> |
Douglas Gregor | 78db0cd | 2010-01-16 15:44:18 +0000 | [diff] [blame] | 68 | getCursorObjCSuperClassRef(CXCursor C); |
| 69 | |
| 70 | /// \brief Create an Objective-C protocol reference at the given location. |
Argyrios Kyrtzidis | 4e7064f | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 71 | CXCursor MakeCursorObjCProtocolRef(const ObjCProtocolDecl *Proto, |
| 72 | SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 73 | CXTranslationUnit TU); |
Douglas Gregor | 78db0cd | 2010-01-16 15:44:18 +0000 | [diff] [blame] | 74 | |
| 75 | /// \brief Unpack an ObjCProtocolRef cursor into the protocol it references |
| 76 | /// and optionally the location where the reference occurred. |
| 77 | std::pair<ObjCProtocolDecl *, SourceLocation> |
| 78 | getCursorObjCProtocolRef(CXCursor C); |
Douglas Gregor | 2e331b9 | 2010-01-16 14:00:32 +0000 | [diff] [blame] | 79 | |
Douglas Gregor | 1adb082 | 2010-01-16 17:14:40 +0000 | [diff] [blame] | 80 | /// \brief Create an Objective-C class reference at the given location. |
Argyrios Kyrtzidis | 4e7064f | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 81 | CXCursor MakeCursorObjCClassRef(const ObjCInterfaceDecl *Class, |
| 82 | SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 83 | CXTranslationUnit TU); |
Douglas Gregor | 1adb082 | 2010-01-16 17:14:40 +0000 | [diff] [blame] | 84 | |
| 85 | /// \brief Unpack an ObjCClassRef cursor into the class it references |
| 86 | /// and optionally the location where the reference occurred. |
| 87 | std::pair<ObjCInterfaceDecl *, SourceLocation> |
| 88 | getCursorObjCClassRef(CXCursor C); |
| 89 | |
Douglas Gregor | 7d0d40e | 2010-01-21 16:28:34 +0000 | [diff] [blame] | 90 | /// \brief Create a type reference at the given location. |
Argyrios Kyrtzidis | 4e7064f | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 91 | CXCursor MakeCursorTypeRef(const TypeDecl *Type, SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 92 | CXTranslationUnit TU); |
Douglas Gregor | 0b36e61 | 2010-08-31 20:37:03 +0000 | [diff] [blame] | 93 | |
Douglas Gregor | 7d0d40e | 2010-01-21 16:28:34 +0000 | [diff] [blame] | 94 | /// \brief Unpack a TypeRef cursor into the class it references |
| 95 | /// and optionally the location where the reference occurred. |
| 96 | std::pair<TypeDecl *, SourceLocation> getCursorTypeRef(CXCursor C); |
| 97 | |
Douglas Gregor | 0b36e61 | 2010-08-31 20:37:03 +0000 | [diff] [blame] | 98 | /// \brief Create a reference to a template at the given location. |
Argyrios Kyrtzidis | b395c63 | 2011-11-18 00:26:51 +0000 | [diff] [blame] | 99 | CXCursor MakeCursorTemplateRef(const TemplateDecl *Template, SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 100 | CXTranslationUnit TU); |
Douglas Gregor | 0b36e61 | 2010-08-31 20:37:03 +0000 | [diff] [blame] | 101 | |
| 102 | /// \brief Unpack a TemplateRef cursor into the template it references and |
| 103 | /// the location where the reference occurred. |
| 104 | std::pair<TemplateDecl *, SourceLocation> getCursorTemplateRef(CXCursor C); |
Douglas Gregor | 6931900 | 2010-08-31 23:48:11 +0000 | [diff] [blame] | 105 | |
| 106 | /// \brief Create a reference to a namespace or namespace alias at the given |
| 107 | /// location. |
Argyrios Kyrtzidis | b395c63 | 2011-11-18 00:26:51 +0000 | [diff] [blame] | 108 | CXCursor MakeCursorNamespaceRef(const NamedDecl *NS, SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 109 | CXTranslationUnit TU); |
Douglas Gregor | 6931900 | 2010-08-31 23:48:11 +0000 | [diff] [blame] | 110 | |
| 111 | /// \brief Unpack a NamespaceRef cursor into the namespace or namespace alias |
| 112 | /// it references and the location where the reference occurred. |
| 113 | std::pair<NamedDecl *, SourceLocation> getCursorNamespaceRef(CXCursor C); |
| 114 | |
Douglas Gregor | 011d8b9 | 2012-02-15 00:54:55 +0000 | [diff] [blame] | 115 | /// \brief Create a reference to a variable at the given location. |
| 116 | CXCursor MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc, |
| 117 | CXTranslationUnit TU); |
| 118 | |
| 119 | /// \brief Unpack a VariableRef cursor into the variable it references and the |
| 120 | /// location where the where the reference occurred. |
| 121 | std::pair<VarDecl *, SourceLocation> getCursorVariableRef(CXCursor C); |
| 122 | |
Douglas Gregor | a67e03f | 2010-09-09 21:42:20 +0000 | [diff] [blame] | 123 | /// \brief Create a reference to a field at the given location. |
Argyrios Kyrtzidis | b395c63 | 2011-11-18 00:26:51 +0000 | [diff] [blame] | 124 | CXCursor MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 125 | CXTranslationUnit TU); |
Douglas Gregor | a67e03f | 2010-09-09 21:42:20 +0000 | [diff] [blame] | 126 | |
| 127 | /// \brief Unpack a MemberRef cursor into the field it references and the |
| 128 | /// location where the reference occurred. |
| 129 | std::pair<FieldDecl *, SourceLocation> getCursorMemberRef(CXCursor C); |
| 130 | |
Ted Kremenek | 3064ef9 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 131 | /// \brief Create a CXX base specifier cursor. |
Argyrios Kyrtzidis | 2957e6f | 2011-11-22 07:24:51 +0000 | [diff] [blame] | 132 | CXCursor MakeCursorCXXBaseSpecifier(const CXXBaseSpecifier *B, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 133 | CXTranslationUnit TU); |
Ted Kremenek | 3064ef9 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 134 | |
| 135 | /// \brief Unpack a CXXBaseSpecifier cursor into a CXXBaseSpecifier. |
| 136 | CXXBaseSpecifier *getCursorCXXBaseSpecifier(CXCursor C); |
| 137 | |
Douglas Gregor | 9f1e3ff | 2010-03-18 00:42:48 +0000 | [diff] [blame] | 138 | /// \brief Create a preprocessing directive cursor. |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 139 | CXCursor MakePreprocessingDirectiveCursor(SourceRange Range, |
| 140 | CXTranslationUnit TU); |
Douglas Gregor | 9f1e3ff | 2010-03-18 00:42:48 +0000 | [diff] [blame] | 141 | |
| 142 | /// \brief Unpack a given preprocessing directive to retrieve its source range. |
| 143 | SourceRange getCursorPreprocessingDirective(CXCursor C); |
Douglas Gregor | 4807231 | 2010-03-18 15:23:44 +0000 | [diff] [blame] | 144 | |
Douglas Gregor | 572feb2 | 2010-03-18 18:04:21 +0000 | [diff] [blame] | 145 | /// \brief Create a macro definition cursor. |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 146 | CXCursor MakeMacroDefinitionCursor(MacroDefinition *, CXTranslationUnit TU); |
Douglas Gregor | 572feb2 | 2010-03-18 18:04:21 +0000 | [diff] [blame] | 147 | |
| 148 | /// \brief Unpack a given macro definition cursor to retrieve its |
| 149 | /// source range. |
| 150 | MacroDefinition *getCursorMacroDefinition(CXCursor C); |
| 151 | |
Chandler Carruth | 9e5bb85 | 2011-07-14 08:20:46 +0000 | [diff] [blame] | 152 | /// \brief Create a macro expansion cursor. |
| 153 | CXCursor MakeMacroExpansionCursor(MacroExpansion *, |
| 154 | CXTranslationUnit TU); |
Douglas Gregor | 4807231 | 2010-03-18 15:23:44 +0000 | [diff] [blame] | 155 | |
Chandler Carruth | 9e5bb85 | 2011-07-14 08:20:46 +0000 | [diff] [blame] | 156 | /// \brief Unpack a given macro expansion cursor to retrieve its |
Douglas Gregor | 4807231 | 2010-03-18 15:23:44 +0000 | [diff] [blame] | 157 | /// source range. |
Chandler Carruth | 9e5bb85 | 2011-07-14 08:20:46 +0000 | [diff] [blame] | 158 | MacroExpansion *getCursorMacroExpansion(CXCursor C); |
Douglas Gregor | 4807231 | 2010-03-18 15:23:44 +0000 | [diff] [blame] | 159 | |
Douglas Gregor | ecdcb88 | 2010-10-20 22:00:55 +0000 | [diff] [blame] | 160 | /// \brief Create an inclusion directive cursor. |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 161 | CXCursor MakeInclusionDirectiveCursor(InclusionDirective *, |
| 162 | CXTranslationUnit TU); |
Douglas Gregor | ecdcb88 | 2010-10-20 22:00:55 +0000 | [diff] [blame] | 163 | |
| 164 | /// \brief Unpack a given inclusion directive cursor to retrieve its |
| 165 | /// source range. |
| 166 | InclusionDirective *getCursorInclusionDirective(CXCursor C); |
| 167 | |
Douglas Gregor | 36897b0 | 2010-09-10 00:22:18 +0000 | [diff] [blame] | 168 | /// \brief Create a label reference at the given location. |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 169 | CXCursor MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc, |
| 170 | CXTranslationUnit TU); |
Douglas Gregor | 36897b0 | 2010-09-10 00:22:18 +0000 | [diff] [blame] | 171 | |
| 172 | /// \brief Unpack a label reference into the label statement it refers to and |
| 173 | /// the location of the reference. |
| 174 | std::pair<LabelStmt *, SourceLocation> getCursorLabelRef(CXCursor C); |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 175 | |
| 176 | /// \brief Create a overloaded declaration reference cursor for an expression. |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 177 | CXCursor MakeCursorOverloadedDeclRef(OverloadExpr *E, CXTranslationUnit TU); |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 178 | |
| 179 | /// \brief Create a overloaded declaration reference cursor for a declaration. |
| 180 | CXCursor MakeCursorOverloadedDeclRef(Decl *D, SourceLocation Location, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 181 | CXTranslationUnit TU); |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 182 | |
| 183 | /// \brief Create a overloaded declaration reference cursor for a template name. |
| 184 | CXCursor MakeCursorOverloadedDeclRef(TemplateName Template, |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 185 | SourceLocation Location, |
| 186 | CXTranslationUnit TU); |
Douglas Gregor | 1f60d9e | 2010-09-13 22:52:57 +0000 | [diff] [blame] | 187 | |
| 188 | /// \brief Internal storage for an overloaded declaration reference cursor; |
| 189 | typedef llvm::PointerUnion3<OverloadExpr *, Decl *, |
| 190 | OverloadedTemplateStorage *> |
| 191 | OverloadedDeclRefStorage; |
| 192 | |
| 193 | /// \brief Unpack an overloaded declaration reference into an expression, |
| 194 | /// declaration, or template name along with the source location. |
| 195 | std::pair<OverloadedDeclRefStorage, SourceLocation> |
| 196 | getCursorOverloadedDeclRef(CXCursor C); |
Douglas Gregor | 36897b0 | 2010-09-10 00:22:18 +0000 | [diff] [blame] | 197 | |
Douglas Gregor | 283cae3 | 2010-01-15 21:56:13 +0000 | [diff] [blame] | 198 | Decl *getCursorDecl(CXCursor Cursor); |
| 199 | Expr *getCursorExpr(CXCursor Cursor); |
| 200 | Stmt *getCursorStmt(CXCursor Cursor); |
Ted Kremenek | 95f3355 | 2010-08-26 01:42:22 +0000 | [diff] [blame] | 201 | Attr *getCursorAttr(CXCursor Cursor); |
Argyrios Kyrtzidis | 8ccac3d | 2011-06-29 22:20:07 +0000 | [diff] [blame] | 202 | Decl *getCursorParentDecl(CXCursor Cursor); |
Ted Kremenek | 95f3355 | 2010-08-26 01:42:22 +0000 | [diff] [blame] | 203 | |
Douglas Gregor | f46034a | 2010-01-18 23:41:10 +0000 | [diff] [blame] | 204 | ASTContext &getCursorContext(CXCursor Cursor); |
Douglas Gregor | b2cd487 | 2010-01-20 23:57:43 +0000 | [diff] [blame] | 205 | ASTUnit *getCursorASTUnit(CXCursor Cursor); |
Ted Kremenek | a60ed47 | 2010-11-16 08:15:36 +0000 | [diff] [blame] | 206 | CXTranslationUnit getCursorTU(CXCursor Cursor); |
Argyrios Kyrtzidis | b11be04 | 2011-10-06 07:00:46 +0000 | [diff] [blame] | 207 | |
| 208 | void getOverriddenCursors(CXCursor cursor, |
Ted Kremenek | bbf66ca | 2012-04-30 19:06:49 +0000 | [diff] [blame] | 209 | SmallVectorImpl<CXCursor> &overridden); |
| 210 | |
| 211 | /// \brief Create an opaque pool used for fast generation of overriden |
| 212 | /// CXCursor arrays. |
| 213 | void *createOverridenCXCursorsPool(); |
Argyrios Kyrtzidis | b11be04 | 2011-10-06 07:00:46 +0000 | [diff] [blame] | 214 | |
Ted Kremenek | bbf66ca | 2012-04-30 19:06:49 +0000 | [diff] [blame] | 215 | /// \brief Dispose of the overriden CXCursors pool. |
| 216 | void disposeOverridenCXCursorsPool(void *pool); |
| 217 | |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 218 | /// \brief Returns a index/location pair for a selector identifier if the cursor |
| 219 | /// points to one. |
| 220 | std::pair<int, SourceLocation> getSelectorIdentifierIndexAndLoc(CXCursor); |
| 221 | static inline int getSelectorIdentifierIndex(CXCursor cursor) { |
| 222 | return getSelectorIdentifierIndexAndLoc(cursor).first; |
| 223 | } |
| 224 | static inline SourceLocation getSelectorIdentifierLoc(CXCursor cursor) { |
| 225 | return getSelectorIdentifierIndexAndLoc(cursor).second; |
| 226 | } |
| 227 | |
| 228 | CXCursor getSelectorIdentifierCursor(int SelIdx, CXCursor cursor); |
| 229 | |
| 230 | static inline CXCursor getTypeRefedCallExprCursor(CXCursor cursor) { |
| 231 | CXCursor newCursor = cursor; |
| 232 | if (cursor.kind == CXCursor_CallExpr) |
| 233 | newCursor.xdata = 1; |
| 234 | return newCursor; |
| 235 | } |
| 236 | |
| 237 | CXCursor getTypeRefCursor(CXCursor cursor); |
| 238 | |
Argyrios Kyrtzidis | b6a4ac4 | 2011-10-12 07:07:36 +0000 | [diff] [blame] | 239 | /// \brief Generate a USR for \arg D and put it in \arg Buf. |
| 240 | /// \returns true if no USR was computed or the result should be ignored, |
| 241 | /// false otherwise. |
Argyrios Kyrtzidis | 4e7064f | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 242 | bool getDeclCursorUSR(const Decl *D, SmallVectorImpl<char> &Buf); |
Argyrios Kyrtzidis | b6a4ac4 | 2011-10-12 07:07:36 +0000 | [diff] [blame] | 243 | |
Douglas Gregor | 283cae3 | 2010-01-15 21:56:13 +0000 | [diff] [blame] | 244 | bool operator==(CXCursor X, CXCursor Y); |
| 245 | |
| 246 | inline bool operator!=(CXCursor X, CXCursor Y) { |
| 247 | return !(X == Y); |
| 248 | } |
| 249 | |
Ted Kremenek | 007a7c9 | 2010-11-01 23:26:51 +0000 | [diff] [blame] | 250 | /// \brief Return true if the cursor represents a declaration that is the |
| 251 | /// first in a declaration group. |
| 252 | bool isFirstInDeclGroup(CXCursor C); |
| 253 | |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 254 | }} // end namespace: clang::cxcursor |
| 255 | |
| 256 | #endif |