diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-11 21:01:49 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-01-11 21:01:49 +0000 |
| commit | ba2f746feaa4ec4fce9fb12b20759bdc66662e53 (patch) | |
| tree | 33b5b151dac997e9cf9e2abeddec2cc45b41e7f9 /clang/tools/libclang/CXCursor.h | |
| parent | 1e0c88401e36576854ca7118dd30ec512ff72cf2 (diff) | |
| download | bcm5719-llvm-ba2f746feaa4ec4fce9fb12b20759bdc66662e53.tar.gz bcm5719-llvm-ba2f746feaa4ec4fce9fb12b20759bdc66662e53.zip | |
libclang: change CXCursor to store 'const void *' pointers for
const-correctness, and update all users
llvm-svn: 172252
Diffstat (limited to 'clang/tools/libclang/CXCursor.h')
| -rw-r--r-- | clang/tools/libclang/CXCursor.h | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/clang/tools/libclang/CXCursor.h b/clang/tools/libclang/CXCursor.h index 86fb9752439..79892f4d29f 100644 --- a/clang/tools/libclang/CXCursor.h +++ b/clang/tools/libclang/CXCursor.h @@ -50,10 +50,10 @@ CXCursor getCursor(CXTranslationUnit, SourceLocation); CXCursor MakeCXCursor(const clang::Attr *A, clang::Decl *Parent, CXTranslationUnit TU); -CXCursor MakeCXCursor(clang::Decl *D, CXTranslationUnit TU, +CXCursor MakeCXCursor(const clang::Decl *D, CXTranslationUnit TU, SourceRange RegionOfInterest = SourceRange(), bool FirstInDeclGroup = true); -CXCursor MakeCXCursor(clang::Stmt *S, clang::Decl *Parent, +CXCursor MakeCXCursor(const clang::Stmt *S, clang::Decl *Parent, CXTranslationUnit TU, SourceRange RegionOfInterest = SourceRange()); CXCursor MakeCXCursorInvalid(CXCursorKind K, CXTranslationUnit TU = 0); @@ -65,7 +65,7 @@ CXCursor MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super, /// \brief Unpack an ObjCSuperClassRef cursor into the interface it references /// and optionally the location where the reference occurred. -std::pair<ObjCInterfaceDecl *, SourceLocation> +std::pair<const ObjCInterfaceDecl *, SourceLocation> getCursorObjCSuperClassRef(CXCursor C); /// \brief Create an Objective-C protocol reference at the given location. @@ -75,7 +75,7 @@ CXCursor MakeCursorObjCProtocolRef(const ObjCProtocolDecl *Proto, /// \brief Unpack an ObjCProtocolRef cursor into the protocol it references /// and optionally the location where the reference occurred. -std::pair<ObjCProtocolDecl *, SourceLocation> +std::pair<const ObjCProtocolDecl *, SourceLocation> getCursorObjCProtocolRef(CXCursor C); /// \brief Create an Objective-C class reference at the given location. @@ -85,7 +85,7 @@ CXCursor MakeCursorObjCClassRef(const ObjCInterfaceDecl *Class, /// \brief Unpack an ObjCClassRef cursor into the class it references /// and optionally the location where the reference occurred. -std::pair<ObjCInterfaceDecl *, SourceLocation> +std::pair<const ObjCInterfaceDecl *, SourceLocation> getCursorObjCClassRef(CXCursor C); /// \brief Create a type reference at the given location. @@ -94,7 +94,7 @@ CXCursor MakeCursorTypeRef(const TypeDecl *Type, SourceLocation Loc, /// \brief Unpack a TypeRef cursor into the class it references /// and optionally the location where the reference occurred. -std::pair<TypeDecl *, SourceLocation> getCursorTypeRef(CXCursor C); +std::pair<const TypeDecl *, SourceLocation> getCursorTypeRef(CXCursor C); /// \brief Create a reference to a template at the given location. CXCursor MakeCursorTemplateRef(const TemplateDecl *Template, SourceLocation Loc, @@ -102,7 +102,8 @@ CXCursor MakeCursorTemplateRef(const TemplateDecl *Template, SourceLocation Loc, /// \brief Unpack a TemplateRef cursor into the template it references and /// the location where the reference occurred. -std::pair<TemplateDecl *, SourceLocation> getCursorTemplateRef(CXCursor C); +std::pair<const TemplateDecl *, SourceLocation> + getCursorTemplateRef(CXCursor C); /// \brief Create a reference to a namespace or namespace alias at the given /// location. @@ -111,7 +112,7 @@ CXCursor MakeCursorNamespaceRef(const NamedDecl *NS, SourceLocation Loc, /// \brief Unpack a NamespaceRef cursor into the namespace or namespace alias /// it references and the location where the reference occurred. -std::pair<NamedDecl *, SourceLocation> getCursorNamespaceRef(CXCursor C); +std::pair<const NamedDecl *, SourceLocation> getCursorNamespaceRef(CXCursor C); /// \brief Create a reference to a variable at the given location. CXCursor MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc, @@ -119,7 +120,7 @@ CXCursor MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc, /// \brief Unpack a VariableRef cursor into the variable it references and the /// location where the where the reference occurred. -std::pair<VarDecl *, SourceLocation> getCursorVariableRef(CXCursor C); +std::pair<const VarDecl *, SourceLocation> getCursorVariableRef(CXCursor C); /// \brief Create a reference to a field at the given location. CXCursor MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc, @@ -127,14 +128,14 @@ CXCursor MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc, /// \brief Unpack a MemberRef cursor into the field it references and the /// location where the reference occurred. -std::pair<FieldDecl *, SourceLocation> getCursorMemberRef(CXCursor C); +std::pair<const FieldDecl *, SourceLocation> getCursorMemberRef(CXCursor C); /// \brief Create a CXX base specifier cursor. CXCursor MakeCursorCXXBaseSpecifier(const CXXBaseSpecifier *B, CXTranslationUnit TU); /// \brief Unpack a CXXBaseSpecifier cursor into a CXXBaseSpecifier. -CXXBaseSpecifier *getCursorCXXBaseSpecifier(CXCursor C); +const CXXBaseSpecifier *getCursorCXXBaseSpecifier(CXCursor C); /// \brief Create a preprocessing directive cursor. CXCursor MakePreprocessingDirectiveCursor(SourceRange Range, @@ -144,11 +145,12 @@ CXCursor MakePreprocessingDirectiveCursor(SourceRange Range, SourceRange getCursorPreprocessingDirective(CXCursor C); /// \brief Create a macro definition cursor. -CXCursor MakeMacroDefinitionCursor(MacroDefinition *, CXTranslationUnit TU); +CXCursor MakeMacroDefinitionCursor(const MacroDefinition *, + CXTranslationUnit TU); /// \brief Unpack a given macro definition cursor to retrieve its /// source range. -MacroDefinition *getCursorMacroDefinition(CXCursor C); +const MacroDefinition *getCursorMacroDefinition(CXCursor C); /// \brief Create a macro expansion cursor. CXCursor MakeMacroExpansionCursor(MacroExpansion *, @@ -172,13 +174,13 @@ class MacroExpansionCursor { bool isPseudo() const { return C.data[1] != 0; } - MacroDefinition *getAsMacroDefinition() const { + const MacroDefinition *getAsMacroDefinition() const { assert(isPseudo()); - return static_cast<MacroDefinition *>(C.data[0]); + return static_cast<const MacroDefinition *>(C.data[0]); } - MacroExpansion *getAsMacroExpansion() const { + const MacroExpansion *getAsMacroExpansion() const { assert(!isPseudo()); - return static_cast<MacroExpansion *>(C.data[0]); + return static_cast<const MacroExpansion *>(C.data[0]); } SourceLocation getPseudoLoc() const { assert(isPseudo()); @@ -191,7 +193,7 @@ public: } const IdentifierInfo *getName() const; - MacroDefinition *getDefinition() const; + const MacroDefinition *getDefinition() const; SourceRange getSourceRange() const; }; @@ -206,7 +208,7 @@ CXCursor MakeInclusionDirectiveCursor(InclusionDirective *, /// \brief Unpack a given inclusion directive cursor to retrieve its /// source range. -InclusionDirective *getCursorInclusionDirective(CXCursor C); +const InclusionDirective *getCursorInclusionDirective(CXCursor C); /// \brief Create a label reference at the given location. CXCursor MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc, @@ -214,7 +216,7 @@ CXCursor MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc, /// \brief Unpack a label reference into the label statement it refers to and /// the location of the reference. -std::pair<LabelStmt *, SourceLocation> getCursorLabelRef(CXCursor C); +std::pair<const LabelStmt *, SourceLocation> getCursorLabelRef(CXCursor C); /// \brief Create a overloaded declaration reference cursor for an expression. CXCursor MakeCursorOverloadedDeclRef(OverloadExpr *E, CXTranslationUnit TU); |

