2010-01-16 04:35:54 +08:00
|
|
|
//===- CXCursor.h - Routines for manipulating CXCursors -------------------===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2010-01-16 04:35:54 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines routines for manipulating CXCursors.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:25:19 +08:00
|
|
|
#ifndef LLVM_CLANG_TOOLS_LIBCLANG_CXCURSOR_H
|
|
|
|
#define LLVM_CLANG_TOOLS_LIBCLANG_CXCURSOR_H
|
2010-01-16 04:35:54 +08:00
|
|
|
|
|
|
|
#include "clang-c/Index.h"
|
2010-01-16 22:00:32 +08:00
|
|
|
#include "clang/Basic/SourceLocation.h"
|
2010-09-14 06:52:57 +08:00
|
|
|
#include "llvm/ADT/PointerUnion.h"
|
2010-01-16 22:00:32 +08:00
|
|
|
#include <utility>
|
2010-01-16 04:35:54 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
2010-01-19 07:41:10 +08:00
|
|
|
class ASTContext;
|
2010-01-21 07:57:43 +08:00
|
|
|
class ASTUnit;
|
2010-02-18 11:09:07 +08:00
|
|
|
class Attr;
|
2010-08-28 05:34:58 +08:00
|
|
|
class CXXBaseSpecifier;
|
2010-01-16 04:35:54 +08:00
|
|
|
class Decl;
|
2010-01-16 05:56:13 +08:00
|
|
|
class Expr;
|
2010-09-10 05:42:20 +08:00
|
|
|
class FieldDecl;
|
2010-10-21 06:00:55 +08:00
|
|
|
class InclusionDirective;
|
2010-09-10 08:22:18 +08:00
|
|
|
class LabelStmt;
|
2015-05-04 10:25:31 +08:00
|
|
|
class MacroDefinitionRecord;
|
2011-07-14 16:20:46 +08:00
|
|
|
class MacroExpansion;
|
2010-01-16 05:56:13 +08:00
|
|
|
class NamedDecl;
|
2010-01-16 22:00:32 +08:00
|
|
|
class ObjCInterfaceDecl;
|
2010-01-16 23:44:18 +08:00
|
|
|
class ObjCProtocolDecl;
|
2010-09-14 06:52:57 +08:00
|
|
|
class OverloadedTemplateStorage;
|
|
|
|
class OverloadExpr;
|
2010-01-16 04:35:54 +08:00
|
|
|
class Stmt;
|
2010-09-01 04:37:03 +08:00
|
|
|
class TemplateDecl;
|
2010-09-14 06:52:57 +08:00
|
|
|
class TemplateName;
|
2010-01-22 00:28:34 +08:00
|
|
|
class TypeDecl;
|
2012-02-15 08:54:55 +08:00
|
|
|
class VarDecl;
|
2013-01-08 03:16:25 +08:00
|
|
|
class IdentifierInfo;
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2010-01-16 04:35:54 +08:00
|
|
|
namespace cxcursor {
|
2011-09-27 08:30:33 +08:00
|
|
|
|
|
|
|
CXCursor getCursor(CXTranslationUnit, SourceLocation);
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2013-01-14 08:46:27 +08:00
|
|
|
CXCursor MakeCXCursor(const clang::Attr *A, const clang::Decl *Parent,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2013-01-12 05:01:49 +08:00
|
|
|
CXCursor MakeCXCursor(const clang::Decl *D, CXTranslationUnit TU,
|
2011-10-06 15:00:54 +08:00
|
|
|
SourceRange RegionOfInterest = SourceRange(),
|
2010-11-02 07:26:51 +08:00
|
|
|
bool FirstInDeclGroup = true);
|
2013-01-14 08:46:27 +08:00
|
|
|
CXCursor MakeCXCursor(const clang::Stmt *S, const clang::Decl *Parent,
|
2011-10-06 15:00:54 +08:00
|
|
|
CXTranslationUnit TU,
|
|
|
|
SourceRange RegionOfInterest = SourceRange());
|
2014-06-08 16:38:04 +08:00
|
|
|
CXCursor MakeCXCursorInvalid(CXCursorKind K, CXTranslationUnit TU = nullptr);
|
2010-01-16 04:35:54 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create an Objective-C superclass reference at the given location.
|
2020-03-25 22:26:14 +08:00
|
|
|
CXCursor MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super,
|
|
|
|
SourceLocation Loc, CXTranslationUnit TU);
|
2010-01-16 22:00:32 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack an ObjCSuperClassRef cursor into the interface it references
|
2010-01-16 22:00:32 +08:00
|
|
|
/// and optionally the location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const ObjCInterfaceDecl *, SourceLocation>
|
2020-03-25 22:26:14 +08:00
|
|
|
getCursorObjCSuperClassRef(CXCursor C);
|
2010-01-16 23:44:18 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create an Objective-C protocol reference at the given location.
|
2011-10-18 03:48:19 +08:00
|
|
|
CXCursor MakeCursorObjCProtocolRef(const ObjCProtocolDecl *Proto,
|
2020-03-25 22:26:14 +08:00
|
|
|
SourceLocation Loc, CXTranslationUnit TU);
|
2010-01-16 23:44:18 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack an ObjCProtocolRef cursor into the protocol it references
|
2010-01-16 23:44:18 +08:00
|
|
|
/// and optionally the location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const ObjCProtocolDecl *, SourceLocation>
|
2020-03-25 22:26:14 +08:00
|
|
|
getCursorObjCProtocolRef(CXCursor C);
|
2010-01-16 22:00:32 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create an Objective-C class reference at the given location.
|
2011-10-18 03:48:19 +08:00
|
|
|
CXCursor MakeCursorObjCClassRef(const ObjCInterfaceDecl *Class,
|
2020-03-25 22:26:14 +08:00
|
|
|
SourceLocation Loc, CXTranslationUnit TU);
|
2010-01-17 01:14:40 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack an ObjCClassRef cursor into the class it references
|
2010-01-17 01:14:40 +08:00
|
|
|
/// and optionally the location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const ObjCInterfaceDecl *, SourceLocation>
|
2020-03-25 22:26:14 +08:00
|
|
|
getCursorObjCClassRef(CXCursor C);
|
2010-01-17 01:14:40 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a type reference at the given location.
|
2011-10-18 03:48:19 +08:00
|
|
|
CXCursor MakeCursorTypeRef(const TypeDecl *Type, SourceLocation Loc,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2020-03-25 22:26:14 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a TypeRef cursor into the class it references
|
2010-01-22 00:28:34 +08:00
|
|
|
/// and optionally the location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const TypeDecl *, SourceLocation> getCursorTypeRef(CXCursor C);
|
2010-01-22 00:28:34 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a reference to a template at the given location.
|
2011-11-18 08:26:51 +08:00
|
|
|
CXCursor MakeCursorTemplateRef(const TemplateDecl *Template, SourceLocation Loc,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2010-09-01 04:37:03 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a TemplateRef cursor into the template it references and
|
2010-09-01 04:37:03 +08:00
|
|
|
/// the location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const TemplateDecl *, SourceLocation>
|
2020-03-25 22:26:14 +08:00
|
|
|
getCursorTemplateRef(CXCursor C);
|
2010-09-01 07:48:11 +08:00
|
|
|
|
2020-03-25 22:26:14 +08:00
|
|
|
/// Create a reference to a namespace or namespace alias at the given
|
2010-09-01 07:48:11 +08:00
|
|
|
/// location.
|
2011-11-18 08:26:51 +08:00
|
|
|
CXCursor MakeCursorNamespaceRef(const NamedDecl *NS, SourceLocation Loc,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2010-09-01 07:48:11 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a NamespaceRef cursor into the namespace or namespace alias
|
2010-09-01 07:48:11 +08:00
|
|
|
/// it references and the location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const NamedDecl *, SourceLocation> getCursorNamespaceRef(CXCursor C);
|
2010-09-01 07:48:11 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a reference to a variable at the given location.
|
2020-03-25 22:26:14 +08:00
|
|
|
CXCursor MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc,
|
2012-02-15 08:54:55 +08:00
|
|
|
CXTranslationUnit TU);
|
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a VariableRef cursor into the variable it references and the
|
2012-02-15 08:54:55 +08:00
|
|
|
/// location where the where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const VarDecl *, SourceLocation> getCursorVariableRef(CXCursor C);
|
2012-02-15 08:54:55 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a reference to a field at the given location.
|
2020-03-25 22:26:14 +08:00
|
|
|
CXCursor MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2020-03-25 22:26:14 +08:00
|
|
|
/// Unpack a MemberRef cursor into the field it references and the
|
2010-09-10 05:42:20 +08:00
|
|
|
/// location where the reference occurred.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const FieldDecl *, SourceLocation> getCursorMemberRef(CXCursor C);
|
2010-09-10 05:42:20 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a CXX base specifier cursor.
|
2011-11-22 15:24:51 +08:00
|
|
|
CXCursor MakeCursorCXXBaseSpecifier(const CXXBaseSpecifier *B,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2010-08-28 05:34:58 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a CXXBaseSpecifier cursor into a CXXBaseSpecifier.
|
2013-01-12 05:01:49 +08:00
|
|
|
const CXXBaseSpecifier *getCursorCXXBaseSpecifier(CXCursor C);
|
2010-08-28 05:34:58 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a preprocessing directive cursor.
|
2010-11-16 16:15:36 +08:00
|
|
|
CXCursor MakePreprocessingDirectiveCursor(SourceRange Range,
|
|
|
|
CXTranslationUnit TU);
|
2010-03-18 08:42:48 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a given preprocessing directive to retrieve its source range.
|
2010-03-18 08:42:48 +08:00
|
|
|
SourceRange getCursorPreprocessingDirective(CXCursor C);
|
2010-03-18 23:23:44 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a macro definition cursor.
|
2015-05-04 10:25:31 +08:00
|
|
|
CXCursor MakeMacroDefinitionCursor(const MacroDefinitionRecord *,
|
2013-01-12 05:01:49 +08:00
|
|
|
CXTranslationUnit TU);
|
2010-03-19 02:04:21 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a given macro definition cursor to retrieve its
|
2010-03-19 02:04:21 +08:00
|
|
|
/// source range.
|
2015-05-04 10:25:31 +08:00
|
|
|
const MacroDefinitionRecord *getCursorMacroDefinition(CXCursor C);
|
2010-03-19 02:04:21 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a macro expansion cursor.
|
2015-05-04 10:25:31 +08:00
|
|
|
CXCursor MakeMacroExpansionCursor(MacroExpansion *, CXTranslationUnit TU);
|
2010-03-18 23:23:44 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a "pseudo" macro expansion cursor, using a macro definition
|
2013-01-08 03:16:25 +08:00
|
|
|
/// and a source location.
|
2015-05-04 10:25:31 +08:00
|
|
|
CXCursor MakeMacroExpansionCursor(MacroDefinitionRecord *, SourceLocation Loc,
|
2013-01-08 03:16:25 +08:00
|
|
|
CXTranslationUnit TU);
|
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Wraps a macro expansion cursor and provides a common interface
|
2013-01-08 03:16:25 +08:00
|
|
|
/// for a normal macro expansion cursor or a "pseudo" one.
|
|
|
|
///
|
|
|
|
/// "Pseudo" macro expansion cursors (essentially a macro definition along with
|
|
|
|
/// a source location) are created in special cases, for example they can be
|
|
|
|
/// created for identifiers inside macro definitions, if these identifiers are
|
|
|
|
/// macro names.
|
|
|
|
class MacroExpansionCursor {
|
|
|
|
CXCursor C;
|
|
|
|
|
2015-05-04 10:25:31 +08:00
|
|
|
bool isPseudo() const { return C.data[1] != nullptr; }
|
|
|
|
const MacroDefinitionRecord *getAsMacroDefinition() const {
|
2013-01-08 03:16:25 +08:00
|
|
|
assert(isPseudo());
|
2015-05-04 10:25:31 +08:00
|
|
|
return static_cast<const MacroDefinitionRecord *>(C.data[0]);
|
2013-01-08 03:16:25 +08:00
|
|
|
}
|
2013-01-12 05:01:49 +08:00
|
|
|
const MacroExpansion *getAsMacroExpansion() const {
|
2013-01-08 03:16:25 +08:00
|
|
|
assert(!isPseudo());
|
2013-01-12 05:01:49 +08:00
|
|
|
return static_cast<const MacroExpansion *>(C.data[0]);
|
2013-01-08 03:16:25 +08:00
|
|
|
}
|
|
|
|
SourceLocation getPseudoLoc() const {
|
|
|
|
assert(isPseudo());
|
|
|
|
return SourceLocation::getFromPtrEncoding(C.data[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
MacroExpansionCursor(CXCursor C) : C(C) {
|
|
|
|
assert(C.kind == CXCursor_MacroExpansion);
|
|
|
|
}
|
|
|
|
|
|
|
|
const IdentifierInfo *getName() const;
|
2015-05-04 10:25:31 +08:00
|
|
|
const MacroDefinitionRecord *getDefinition() const;
|
2013-01-08 03:16:25 +08:00
|
|
|
SourceRange getSourceRange() const;
|
|
|
|
};
|
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a given macro expansion cursor to retrieve its info.
|
2013-01-08 03:16:25 +08:00
|
|
|
static inline MacroExpansionCursor getCursorMacroExpansion(CXCursor C) {
|
|
|
|
return C;
|
|
|
|
}
|
2010-03-18 23:23:44 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create an inclusion directive cursor.
|
2010-11-16 16:15:36 +08:00
|
|
|
CXCursor MakeInclusionDirectiveCursor(InclusionDirective *,
|
|
|
|
CXTranslationUnit TU);
|
2010-10-21 06:00:55 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a given inclusion directive cursor to retrieve its
|
2010-10-21 06:00:55 +08:00
|
|
|
/// source range.
|
2013-01-12 05:01:49 +08:00
|
|
|
const InclusionDirective *getCursorInclusionDirective(CXCursor C);
|
2010-10-21 06:00:55 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a label reference at the given location.
|
2010-11-16 16:15:36 +08:00
|
|
|
CXCursor MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc,
|
|
|
|
CXTranslationUnit TU);
|
2010-09-10 08:22:18 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack a label reference into the label statement it refers to and
|
2010-09-10 08:22:18 +08:00
|
|
|
/// the location of the reference.
|
2013-01-12 05:01:49 +08:00
|
|
|
std::pair<const LabelStmt *, SourceLocation> getCursorLabelRef(CXCursor C);
|
2010-09-14 06:52:57 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a overloaded declaration reference cursor for an expression.
|
2013-01-24 01:25:27 +08:00
|
|
|
CXCursor MakeCursorOverloadedDeclRef(const OverloadExpr *E,
|
|
|
|
CXTranslationUnit TU);
|
2010-09-14 06:52:57 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a overloaded declaration reference cursor for a declaration.
|
2013-01-24 01:25:27 +08:00
|
|
|
CXCursor MakeCursorOverloadedDeclRef(const Decl *D, SourceLocation Location,
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit TU);
|
2010-09-14 06:52:57 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create a overloaded declaration reference cursor for a template name.
|
2020-03-25 22:26:14 +08:00
|
|
|
CXCursor MakeCursorOverloadedDeclRef(TemplateName Template,
|
2010-11-16 16:15:36 +08:00
|
|
|
SourceLocation Location,
|
|
|
|
CXTranslationUnit TU);
|
2010-09-14 06:52:57 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Internal storage for an overloaded declaration reference cursor;
|
2020-01-14 22:46:13 +08:00
|
|
|
typedef llvm::PointerUnion<const OverloadExpr *, const Decl *,
|
|
|
|
OverloadedTemplateStorage *>
|
|
|
|
OverloadedDeclRefStorage;
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Unpack an overloaded declaration reference into an expression,
|
2010-09-14 06:52:57 +08:00
|
|
|
/// declaration, or template name along with the source location.
|
|
|
|
std::pair<OverloadedDeclRefStorage, SourceLocation>
|
2020-03-25 22:26:14 +08:00
|
|
|
getCursorOverloadedDeclRef(CXCursor C);
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2013-01-24 01:25:27 +08:00
|
|
|
const Decl *getCursorDecl(CXCursor Cursor);
|
2013-01-26 23:29:08 +08:00
|
|
|
const Expr *getCursorExpr(CXCursor Cursor);
|
|
|
|
const Stmt *getCursorStmt(CXCursor Cursor);
|
2013-01-27 02:08:08 +08:00
|
|
|
const Attr *getCursorAttr(CXCursor Cursor);
|
2010-08-26 09:42:22 +08:00
|
|
|
|
2010-01-19 07:41:10 +08:00
|
|
|
ASTContext &getCursorContext(CXCursor Cursor);
|
2010-01-21 07:57:43 +08:00
|
|
|
ASTUnit *getCursorASTUnit(CXCursor Cursor);
|
2010-11-16 16:15:36 +08:00
|
|
|
CXTranslationUnit getCursorTU(CXCursor Cursor);
|
2011-10-06 15:00:46 +08:00
|
|
|
|
|
|
|
void getOverriddenCursors(CXCursor cursor,
|
2012-05-01 03:06:49 +08:00
|
|
|
SmallVectorImpl<CXCursor> &overridden);
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Create an opaque pool used for fast generation of overridden
|
2012-05-01 03:06:49 +08:00
|
|
|
/// CXCursor arrays.
|
|
|
|
void *createOverridenCXCursorsPool();
|
2011-10-06 15:00:46 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Dispose of the overridden CXCursors pool.
|
2012-05-01 03:06:49 +08:00
|
|
|
void disposeOverridenCXCursorsPool(void *pool);
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Returns a index/location pair for a selector identifier if the cursor
|
2011-10-06 15:00:54 +08:00
|
|
|
/// points to one.
|
|
|
|
std::pair<int, SourceLocation> getSelectorIdentifierIndexAndLoc(CXCursor);
|
|
|
|
static inline int getSelectorIdentifierIndex(CXCursor cursor) {
|
|
|
|
return getSelectorIdentifierIndexAndLoc(cursor).first;
|
|
|
|
}
|
|
|
|
static inline SourceLocation getSelectorIdentifierLoc(CXCursor cursor) {
|
|
|
|
return getSelectorIdentifierIndexAndLoc(cursor).second;
|
|
|
|
}
|
|
|
|
|
|
|
|
CXCursor getSelectorIdentifierCursor(int SelIdx, CXCursor cursor);
|
|
|
|
|
|
|
|
static inline CXCursor getTypeRefedCallExprCursor(CXCursor cursor) {
|
|
|
|
CXCursor newCursor = cursor;
|
|
|
|
if (cursor.kind == CXCursor_CallExpr)
|
|
|
|
newCursor.xdata = 1;
|
|
|
|
return newCursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
CXCursor getTypeRefCursor(CXCursor cursor);
|
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Generate a USR for \arg D and put it in \arg Buf.
|
2011-10-12 15:07:36 +08:00
|
|
|
/// \returns true if no USR was computed or the result should be ignored,
|
|
|
|
/// false otherwise.
|
2011-10-18 03:48:19 +08:00
|
|
|
bool getDeclCursorUSR(const Decl *D, SmallVectorImpl<char> &Buf);
|
2011-10-12 15:07:36 +08:00
|
|
|
|
2010-01-16 05:56:13 +08:00
|
|
|
bool operator==(CXCursor X, CXCursor Y);
|
2018-11-20 16:00:00 +08:00
|
|
|
|
2020-03-25 22:26:14 +08:00
|
|
|
inline bool operator!=(CXCursor X, CXCursor Y) { return !(X == Y); }
|
2010-01-16 05:56:13 +08:00
|
|
|
|
2018-05-09 09:00:01 +08:00
|
|
|
/// Return true if the cursor represents a declaration that is the
|
2010-11-02 07:26:51 +08:00
|
|
|
/// first in a declaration group.
|
|
|
|
bool isFirstInDeclGroup(CXCursor C);
|
|
|
|
|
2020-03-25 22:26:14 +08:00
|
|
|
} // namespace cxcursor
|
|
|
|
} // namespace clang
|
2010-01-16 04:35:54 +08:00
|
|
|
|
|
|
|
#endif
|