clang

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: BSD-3-Clause Imports: 7 Imported by: 5

Documentation

Overview

Package clang provides the Clang C API bindings for Go.

Index

Constants

View Source
const (
	AccessSpecifier_Invalid   AccessSpecifier = C.CX_CXXInvalidAccessSpecifier
	AccessSpecifier_Public                    = C.CX_CXXPublic
	AccessSpecifier_Protected                 = C.CX_CXXProtected
	AccessSpecifier_Private                   = C.CX_CXXPrivate
)
View Source
const (
	// Availability_Available the entity is available.
	Availability_Available AvailabilityKind = C.CXAvailability_Available
	// Availability_Deprecated the entity is available, but has been deprecated (and its use is not recommended).
	Availability_Deprecated = C.CXAvailability_Deprecated
	// Availability_NotAvailable the entity is not available; any use of it will be an error.
	Availability_NotAvailable = C.CXAvailability_NotAvailable
	// Availability_NotAccessible the entity is available, but not accessible; any use of it will be an error.
	Availability_NotAccessible = C.CXAvailability_NotAccessible
)
View Source
const (
	CallingConv_Default           CallingConv = C.CXCallingConv_Default
	CallingConv_C                             = C.CXCallingConv_C
	CallingConv_X86StdCall                    = C.CXCallingConv_X86StdCall
	CallingConv_X86FastCall                   = C.CXCallingConv_X86FastCall
	CallingConv_X86ThisCall                   = C.CXCallingConv_X86ThisCall
	CallingConv_X86Pascal                     = C.CXCallingConv_X86Pascal
	CallingConv_AAPCS                         = C.CXCallingConv_AAPCS
	CallingConv_AAPCS_VFP                     = C.CXCallingConv_AAPCS_VFP
	CallingConv_X86RegCall                    = C.CXCallingConv_X86RegCall
	CallingConv_IntelOclBicc                  = C.CXCallingConv_IntelOclBicc
	CallingConv_Win64                         = C.CXCallingConv_Win64
	CallingConv_X86_64Win64                   = C.CXCallingConv_X86_64Win64
	CallingConv_X86_64SysV                    = C.CXCallingConv_X86_64SysV
	CallingConv_X86VectorCall                 = C.CXCallingConv_X86VectorCall
	CallingConv_Swift                         = C.CXCallingConv_Swift
	CallingConv_PreserveMost                  = C.CXCallingConv_PreserveMost
	CallingConv_PreserveAll                   = C.CXCallingConv_PreserveAll
	CallingConv_AArch64VectorCall             = C.CXCallingConv_AArch64VectorCall
	CallingConv_SwiftAsync                    = C.CXCallingConv_SwiftAsync
	CallingConv_Invalid                       = C.CXCallingConv_Invalid
	CallingConv_Unexposed                     = C.CXCallingConv_Unexposed
)
View Source
const (
	// ChildVisit_Break terminates the cursor traversal.
	ChildVisit_Break ChildVisitResult = C.CXChildVisit_Break
	// ChildVisit_Continue continues the cursor traversal with the next sibling of the cursor just visited, without visiting its children.
	ChildVisit_Continue = C.CXChildVisit_Continue
	// ChildVisit_Recurse recursively traverse the children of this cursor, using the same visitor and client data.
	ChildVisit_Recurse = C.CXChildVisit_Recurse
)
View Source
const (
	// CodeComplete_IncludeMacros whether to include macros within the set of code completions returned.
	CodeComplete_IncludeMacros CodeComplete_Flags = C.CXCodeComplete_IncludeMacros
	// CodeComplete_IncludeCodePatterns whether to include code patterns for language constructs within the set of code completions, e.g., for loops.
	CodeComplete_IncludeCodePatterns = C.CXCodeComplete_IncludeCodePatterns
	// CodeComplete_IncludeBriefComments whether to include brief documentation within the set of code completions returned.
	CodeComplete_IncludeBriefComments = C.CXCodeComplete_IncludeBriefComments
	// CodeComplete_SkipPreamble whether to speed up completion by omitting top- or namespace-level entities defined in the preamble. There's no guarantee any particular entity is omitted. This may be useful if the headers are indexed externally.
	CodeComplete_SkipPreamble = C.CXCodeComplete_SkipPreamble
	// CodeComplete_IncludeCompletionsWithFixIts whether to include completions with small fix-its, e.g. change '.' to '->' on member access, etc.
	CodeComplete_IncludeCompletionsWithFixIts = C.CXCodeComplete_IncludeCompletionsWithFixIts
)
View Source
const (
	// CommentInlineCommandRenderKind_Normal command argument should be rendered in a normal font.
	CommentInlineCommandRenderKind_Normal CommentInlineCommandRenderKind = C.CXCommentInlineCommandRenderKind_Normal
	// CommentInlineCommandRenderKind_Bold command argument should be rendered in a bold font.
	CommentInlineCommandRenderKind_Bold = C.CXCommentInlineCommandRenderKind_Bold
	// CommentInlineCommandRenderKind_Monospaced command argument should be rendered in a monospaced font.
	CommentInlineCommandRenderKind_Monospaced = C.CXCommentInlineCommandRenderKind_Monospaced
	// CommentInlineCommandRenderKind_Emphasized command argument should be rendered emphasized (typically italic font).
	CommentInlineCommandRenderKind_Emphasized = C.CXCommentInlineCommandRenderKind_Emphasized
	// CommentInlineCommandRenderKind_Anchor command argument should not be rendered (since it only defines an anchor).
	CommentInlineCommandRenderKind_Anchor = C.CXCommentInlineCommandRenderKind_Anchor
)
View Source
const (
	// Comment_Null null comment. No AST node is constructed at the requested location because there is no text or a syntax error.
	Comment_Null CommentKind = C.CXComment_Null
	// Comment_Text plain text. Inline content.
	Comment_Text = C.CXComment_Text
	// Comment_InlineCommand a command with word-like arguments that is considered inline content.
	//
	// For example: \command.
	Comment_InlineCommand = C.CXComment_InlineCommand
	// Comment_HTMLStartTag hTML start tag with attributes (name-value pairs). Considered
	// inline content.
	//
	// For example:
	//  <br> <br /> <a href="http://example.org/">
	Comment_HTMLStartTag = C.CXComment_HTMLStartTag
	// Comment_HTMLEndTag hTML end tag. Considered inline content.
	//
	// For example:
	//  </a>
	Comment_HTMLEndTag = C.CXComment_HTMLEndTag
	// Comment_Paragraph a paragraph, contains inline comment. The paragraph itself is block content.
	Comment_Paragraph = C.CXComment_Paragraph
	// Comment_BlockCommand a command that has zero or more word-like arguments (number of
	// word-like arguments depends on command name) and a paragraph as an
	// argument. Block command is block content.
	//
	// Paragraph argument is also a child of the block command.
	//
	// For example: \has 0 word-like arguments and a paragraph argument.
	//
	// AST nodes of special kinds that parser knows about (e. g., \\param
	// command) have their own node kinds.
	Comment_BlockCommand = C.CXComment_BlockCommand
	// Comment_ParamCommand a parameter or arg command that describes the function parameter
	// (name, passing direction, description).
	//
	// For example: parameter [in] ParamName description.
	Comment_ParamCommand = C.CXComment_ParamCommand
	// Comment_TParamCommand a template param command that describes a template parameter (name and
	// description).
	//
	// For example: template param T description.
	Comment_TParamCommand = C.CXComment_TParamCommand
	// Comment_VerbatimBlockCommand a verbatim block command (e. g., preformatted code). Verbatim
	// block has an opening and a closing command and contains multiple lines of
	// text (CXComment_VerbatimBlockLine child nodes).
	//
	// For example:
	//  aaa
	Comment_VerbatimBlockCommand = C.CXComment_VerbatimBlockCommand
	// Comment_VerbatimBlockLine a line of text that is contained within a CXComment_VerbatimBlockCommand node.
	Comment_VerbatimBlockLine = C.CXComment_VerbatimBlockLine
	// Comment_VerbatimLine a verbatim line command. Verbatim line has an opening command, a single line of text (up to the newline after the opening command) and has no closing command.
	Comment_VerbatimLine = C.CXComment_VerbatimLine
	// Comment_FullComment a full comment attached to a declaration, contains block content.
	Comment_FullComment = C.CXComment_FullComment
)
View Source
const (
	// CommentParamPassDirection_In the parameter is an input parameter.
	CommentParamPassDirection_In CommentParamPassDirection = C.CXCommentParamPassDirection_In
	// CommentParamPassDirection_Out the parameter is an output parameter.
	CommentParamPassDirection_Out = C.CXCommentParamPassDirection_Out
	// CommentParamPassDirection_InOut the parameter is an input and output parameter.
	CommentParamPassDirection_InOut = C.CXCommentParamPassDirection_InOut
)
View Source
const (
	// CompletionChunk_Optional a code-completion string that describes "optional" text that
	// could be a part of the template (but is not required).
	//
	// The Optional chunk is the only kind of chunk that has a code-completion
	// string for its representation, which is accessible via
	// clang_getCompletionChunkCompletionString(). The code-completion string
	// describes an additional part of the template that is completely optional.
	// For example, optional chunks can be used to describe the placeholders for
	// arguments that match up with defaulted function parameters, e.g. given:
	//
	//  void f(int x, float y = 3.14, double z = 2.71828);
	//
	// The code-completion string for this function would contain:
	// - a TypedText chunk for "f".
	// - a LeftParen chunk for "(".
	// - a Placeholder chunk for "int x"
	// - an Optional chunk containing the remaining defaulted arguments, e.g.,
	// - a Comma chunk for ","
	// - a Placeholder chunk for "float y"
	// - an Optional chunk containing the last defaulted argument:
	// - a Comma chunk for ","
	// - a Placeholder chunk for "double z"
	// - a RightParen chunk for ")"
	//
	// There are many ways to handle Optional chunks. Two simple approaches are:
	// - Completely ignore optional chunks, in which case the template for the
	// function "f" would only include the first parameter ("int x").
	// - Fully expand all optional chunks, in which case the template for the
	// function "f" would have all of the parameters.
	CompletionChunk_Optional CompletionChunkKind = C.CXCompletionChunk_Optional
	// CompletionChunk_TypedText text that a user would be expected to type to get this
	// code-completion result.
	//
	// There will be exactly one "typed text" chunk in a semantic string, which
	// will typically provide the spelling of a keyword or the name of a
	// declaration that could be used at the current code point. Clients are
	// expected to filter the code-completion results based on the text in this
	// chunk.
	CompletionChunk_TypedText = C.CXCompletionChunk_TypedText
	// CompletionChunk_Text text that should be inserted as part of a code-completion result.
	//
	// A "text" chunk represents text that is part of the template to be
	// inserted into user code should this particular code-completion result
	// be selected.
	CompletionChunk_Text = C.CXCompletionChunk_Text
	// CompletionChunk_Placeholder placeholder text that should be replaced by the user.
	//
	// A "placeholder" chunk marks a place where the user should insert text
	// into the code-completion template. For example, placeholders might mark
	// the function parameters for a function declaration, to indicate that the
	// user should provide arguments for each of those parameters. The actual
	// text in a placeholder is a suggestion for the text to display before
	// the user replaces the placeholder with real code.
	CompletionChunk_Placeholder = C.CXCompletionChunk_Placeholder
	// CompletionChunk_Informative informative text that should be displayed but never inserted as
	// part of the template.
	//
	// An "informative" chunk contains annotations that can be displayed to
	// help the user decide whether a particular code-completion result is the
	// right option, but which is not part of the actual template to be inserted
	// by code completion.
	CompletionChunk_Informative = C.CXCompletionChunk_Informative
	// CompletionChunk_CurrentParameter text that describes the current parameter when code-completion is
	// referring to function call, message send, or template specialization.
	//
	// A "current parameter" chunk occurs when code-completion is providing
	// information about a parameter corresponding to the argument at the
	// code-completion point. For example, given a function
	//
	//  int add(int x, int y);
	//
	// and the source code add(, where the code-completion point is after the
	// "(", the code-completion string will contain a "current parameter" chunk
	// for "int x", indicating that the current argument will initialize that
	// parameter. After typing further, to add(17, (where the code-completion
	// point is after the ","), the code-completion string will contain a
	// "current parameter" chunk to "int y".
	CompletionChunk_CurrentParameter = C.CXCompletionChunk_CurrentParameter
	// CompletionChunk_LeftParen a left parenthesis ('('), used to initiate a function call or signal the beginning of a function parameter list.
	CompletionChunk_LeftParen = C.CXCompletionChunk_LeftParen
	// CompletionChunk_RightParen a right parenthesis (')'), used to finish a function call or signal the end of a function parameter list.
	CompletionChunk_RightParen = C.CXCompletionChunk_RightParen
	// CompletionChunk_LeftBracket a left bracket ('[').
	CompletionChunk_LeftBracket = C.CXCompletionChunk_LeftBracket
	// CompletionChunk_RightBracket a right bracket (']').
	CompletionChunk_RightBracket = C.CXCompletionChunk_RightBracket
	// CompletionChunk_LeftBrace a left brace ('{').
	CompletionChunk_LeftBrace = C.CXCompletionChunk_LeftBrace
	// CompletionChunk_RightBrace a right brace ('}').
	CompletionChunk_RightBrace = C.CXCompletionChunk_RightBrace
	// CompletionChunk_LeftAngle a left angle bracket ('<').
	CompletionChunk_LeftAngle = C.CXCompletionChunk_LeftAngle
	// CompletionChunk_RightAngle a right angle bracket ('>').
	CompletionChunk_RightAngle = C.CXCompletionChunk_RightAngle
	// CompletionChunk_Comma a comma separator (',').
	CompletionChunk_Comma = C.CXCompletionChunk_Comma
	// CompletionChunk_ResultType text that specifies the result type of a given result.
	//
	// This special kind of informative chunk is not meant to be inserted into
	// the text buffer. Rather, it is meant to illustrate the type that an
	// expression using the given completion string would have.
	CompletionChunk_ResultType = C.CXCompletionChunk_ResultType
	// CompletionChunk_Colon a colon (':').
	CompletionChunk_Colon = C.CXCompletionChunk_Colon
	// CompletionChunk_SemiColon a semicolon (';').
	CompletionChunk_SemiColon = C.CXCompletionChunk_SemiColon
	// CompletionChunk_Equal an '=' sign.
	CompletionChunk_Equal = C.CXCompletionChunk_Equal
	// CompletionChunk_HorizontalSpace horizontal space (' ').
	CompletionChunk_HorizontalSpace = C.CXCompletionChunk_HorizontalSpace
	// CompletionChunk_VerticalSpace vertical space ('\\n'), after which it is generally a good idea to perform indentation.
	CompletionChunk_VerticalSpace = C.CXCompletionChunk_VerticalSpace
)
View Source
const (
	// CompletionContext_Unexposed the context for completions is unexposed, as only Clang results should be included. (This is equivalent to having no context bits set.)
	CompletionContext_Unexposed CompletionContext = C.CXCompletionContext_Unexposed
	// CompletionContext_AnyType completions for any possible type should be included in the results.
	CompletionContext_AnyType = C.CXCompletionContext_AnyType
	// CompletionContext_AnyValue completions for any possible value (variables, function calls, etc.) should be included in the results.
	CompletionContext_AnyValue = C.CXCompletionContext_AnyValue
	// CompletionContext_ObjCObjectValue completions for values that resolve to an Objective-C object should be included in the results.
	CompletionContext_ObjCObjectValue = C.CXCompletionContext_ObjCObjectValue
	// CompletionContext_ObjCSelectorValue completions for values that resolve to an Objective-C selector should be included in the results.
	CompletionContext_ObjCSelectorValue = C.CXCompletionContext_ObjCSelectorValue
	// CompletionContext_CXXClassTypeValue completions for values that resolve to a C++ class type should be included in the results.
	CompletionContext_CXXClassTypeValue = C.CXCompletionContext_CXXClassTypeValue
	// CompletionContext_DotMemberAccess completions for fields of the member being accessed using the dot operator should be included in the results.
	CompletionContext_DotMemberAccess = C.CXCompletionContext_DotMemberAccess
	// CompletionContext_ArrowMemberAccess completions for fields of the member being accessed using the arrow operator should be included in the results.
	CompletionContext_ArrowMemberAccess = C.CXCompletionContext_ArrowMemberAccess
	// CompletionContext_ObjCPropertyAccess completions for properties of the Objective-C object being accessed using the dot operator should be included in the results.
	CompletionContext_ObjCPropertyAccess = C.CXCompletionContext_ObjCPropertyAccess
	// CompletionContext_EnumTag completions for enum tags should be included in the results.
	CompletionContext_EnumTag = C.CXCompletionContext_EnumTag
	// CompletionContext_UnionTag completions for union tags should be included in the results.
	CompletionContext_UnionTag = C.CXCompletionContext_UnionTag
	// CompletionContext_StructTag completions for struct tags should be included in the results.
	CompletionContext_StructTag = C.CXCompletionContext_StructTag
	// CompletionContext_ClassTag completions for C++ class names should be included in the results.
	CompletionContext_ClassTag = C.CXCompletionContext_ClassTag
	// CompletionContext_Namespace completions for C++ namespaces and namespace aliases should be included in the results.
	CompletionContext_Namespace = C.CXCompletionContext_Namespace
	// CompletionContext_NestedNameSpecifier completions for C++ nested name specifiers should be included in the results.
	CompletionContext_NestedNameSpecifier = C.CXCompletionContext_NestedNameSpecifier
	// CompletionContext_ObjCInterface completions for Objective-C interfaces (classes) should be included in the results.
	CompletionContext_ObjCInterface = C.CXCompletionContext_ObjCInterface
	// CompletionContext_ObjCProtocol completions for Objective-C protocols should be included in the results.
	CompletionContext_ObjCProtocol = C.CXCompletionContext_ObjCProtocol
	// CompletionContext_ObjCCategory completions for Objective-C categories should be included in the results.
	CompletionContext_ObjCCategory = C.CXCompletionContext_ObjCCategory
	// CompletionContext_ObjCInstanceMessage completions for Objective-C instance messages should be included in the results.
	CompletionContext_ObjCInstanceMessage = C.CXCompletionContext_ObjCInstanceMessage
	// CompletionContext_ObjCClassMessage completions for Objective-C class messages should be included in the results.
	CompletionContext_ObjCClassMessage = C.CXCompletionContext_ObjCClassMessage
	// CompletionContext_ObjCSelectorName completions for Objective-C selector names should be included in the results.
	CompletionContext_ObjCSelectorName = C.CXCompletionContext_ObjCSelectorName
	// CompletionContext_MacroName completions for preprocessor macro names should be included in the results.
	CompletionContext_MacroName = C.CXCompletionContext_MacroName
	// CompletionContext_NaturalLanguage natural language completions should be included in the results.
	CompletionContext_NaturalLanguage = C.CXCompletionContext_NaturalLanguage
	// CompletionContext_IncludedFile #include file completions should be included in the results.
	CompletionContext_IncludedFile = C.CXCompletionContext_IncludedFile
	// CompletionContext_Unknown the current context is unknown, so set all contexts.
	CompletionContext_Unknown = C.CXCompletionContext_Unknown
)
View Source
const (
	// Cursor_ExceptionSpecificationKind_None the cursor has no exception specification.
	Cursor_ExceptionSpecificationKind_None Cursor_ExceptionSpecificationKind = C.CXCursor_ExceptionSpecificationKind_None
	// Cursor_ExceptionSpecificationKind_DynamicNone the cursor has exception specification throw()
	Cursor_ExceptionSpecificationKind_DynamicNone = C.CXCursor_ExceptionSpecificationKind_DynamicNone
	// Cursor_ExceptionSpecificationKind_Dynamic the cursor has exception specification throw(T1, T2)
	Cursor_ExceptionSpecificationKind_Dynamic = C.CXCursor_ExceptionSpecificationKind_Dynamic
	// Cursor_ExceptionSpecificationKind_MSAny the cursor has exception specification throw(...).
	Cursor_ExceptionSpecificationKind_MSAny = C.CXCursor_ExceptionSpecificationKind_MSAny
	// Cursor_ExceptionSpecificationKind_BasicNoexcept the cursor has exception specification basic noexcept.
	Cursor_ExceptionSpecificationKind_BasicNoexcept = C.CXCursor_ExceptionSpecificationKind_BasicNoexcept
	// Cursor_ExceptionSpecificationKind_ComputedNoexcept the cursor has exception specification computed noexcept.
	Cursor_ExceptionSpecificationKind_ComputedNoexcept = C.CXCursor_ExceptionSpecificationKind_ComputedNoexcept
	// Cursor_ExceptionSpecificationKind_Unevaluated the exception specification has not yet been evaluated.
	Cursor_ExceptionSpecificationKind_Unevaluated = C.CXCursor_ExceptionSpecificationKind_Unevaluated
	// Cursor_ExceptionSpecificationKind_Uninstantiated the exception specification has not yet been instantiated.
	Cursor_ExceptionSpecificationKind_Uninstantiated = C.CXCursor_ExceptionSpecificationKind_Uninstantiated
	// Cursor_ExceptionSpecificationKind_Unparsed the exception specification has not been parsed yet.
	Cursor_ExceptionSpecificationKind_Unparsed = C.CXCursor_ExceptionSpecificationKind_Unparsed
	// Cursor_ExceptionSpecificationKind_NoThrow the cursor has a __declspec(nothrow) exception specification.
	Cursor_ExceptionSpecificationKind_NoThrow = C.CXCursor_ExceptionSpecificationKind_NoThrow
)
View Source
const (
	// Cursor_UnexposedDecl a declaration whose specific kind is not exposed via this
	// interface.
	//
	// Unexposed declarations have the same operations as any other kind
	// of declaration; one can extract their location information,
	// spelling, find their definitions, etc. However, the specific kind
	// of the declaration is not reported.
	Cursor_UnexposedDecl CursorKind = C.CXCursor_UnexposedDecl
	// Cursor_StructDecl a C or C++ struct.
	Cursor_StructDecl = C.CXCursor_StructDecl
	// Cursor_UnionDecl a C or C++ union.
	Cursor_UnionDecl = C.CXCursor_UnionDecl
	// Cursor_ClassDecl a C++ class.
	Cursor_ClassDecl = C.CXCursor_ClassDecl
	// Cursor_EnumDecl an enumeration.
	Cursor_EnumDecl = C.CXCursor_EnumDecl
	// Cursor_FieldDecl a field (in C) or non-static data member (in C++) in a struct, union, or C++ class.
	Cursor_FieldDecl = C.CXCursor_FieldDecl
	// Cursor_EnumConstantDecl an enumerator constant.
	Cursor_EnumConstantDecl = C.CXCursor_EnumConstantDecl
	// Cursor_FunctionDecl a function.
	Cursor_FunctionDecl = C.CXCursor_FunctionDecl
	// Cursor_VarDecl a variable.
	Cursor_VarDecl = C.CXCursor_VarDecl
	// Cursor_ParmDecl a function or method parameter.
	Cursor_ParmDecl = C.CXCursor_ParmDecl
	// Cursor_ObjCInterfaceDecl an Objective-C \@interface.
	Cursor_ObjCInterfaceDecl = C.CXCursor_ObjCInterfaceDecl
	// Cursor_ObjCCategoryDecl an Objective-C \@interface for a category.
	Cursor_ObjCCategoryDecl = C.CXCursor_ObjCCategoryDecl
	// Cursor_ObjCProtocolDecl an Objective-C \@protocol declaration.
	Cursor_ObjCProtocolDecl = C.CXCursor_ObjCProtocolDecl
	// Cursor_ObjCPropertyDecl an Objective-C \@property declaration.
	Cursor_ObjCPropertyDecl = C.CXCursor_ObjCPropertyDecl
	// Cursor_ObjCIvarDecl an Objective-C instance variable.
	Cursor_ObjCIvarDecl = C.CXCursor_ObjCIvarDecl
	// Cursor_ObjCInstanceMethodDecl an Objective-C instance method.
	Cursor_ObjCInstanceMethodDecl = C.CXCursor_ObjCInstanceMethodDecl
	// Cursor_ObjCClassMethodDecl an Objective-C class method.
	Cursor_ObjCClassMethodDecl = C.CXCursor_ObjCClassMethodDecl
	// Cursor_ObjCImplementationDecl an Objective-C \@implementation.
	Cursor_ObjCImplementationDecl = C.CXCursor_ObjCImplementationDecl
	// Cursor_ObjCCategoryImplDecl an Objective-C \@implementation for a category.
	Cursor_ObjCCategoryImplDecl = C.CXCursor_ObjCCategoryImplDecl
	// Cursor_TypedefDecl a typedef.
	Cursor_TypedefDecl = C.CXCursor_TypedefDecl
	// Cursor_CXXMethod a C++ class method.
	Cursor_CXXMethod = C.CXCursor_CXXMethod
	// Cursor_Namespace a C++ namespace.
	Cursor_Namespace = C.CXCursor_Namespace
	// Cursor_LinkageSpec a linkage specification, e.g. 'extern "C"'.
	Cursor_LinkageSpec = C.CXCursor_LinkageSpec
	// Cursor_Constructor a C++ constructor.
	Cursor_Constructor = C.CXCursor_Constructor
	// Cursor_Destructor a C++ destructor.
	Cursor_Destructor = C.CXCursor_Destructor
	// Cursor_ConversionFunction a C++ conversion function.
	Cursor_ConversionFunction = C.CXCursor_ConversionFunction
	// Cursor_TemplateTypeParameter a C++ template type parameter.
	Cursor_TemplateTypeParameter = C.CXCursor_TemplateTypeParameter
	// Cursor_NonTypeTemplateParameter a C++ non-type template parameter.
	Cursor_NonTypeTemplateParameter = C.CXCursor_NonTypeTemplateParameter
	// Cursor_TemplateTemplateParameter a C++ template template parameter.
	Cursor_TemplateTemplateParameter = C.CXCursor_TemplateTemplateParameter
	// Cursor_FunctionTemplate a C++ function template.
	Cursor_FunctionTemplate = C.CXCursor_FunctionTemplate
	// Cursor_ClassTemplate a C++ class template.
	Cursor_ClassTemplate = C.CXCursor_ClassTemplate
	// Cursor_ClassTemplatePartialSpecialization a C++ class template partial specialization.
	Cursor_ClassTemplatePartialSpecialization = C.CXCursor_ClassTemplatePartialSpecialization
	// Cursor_NamespaceAlias a C++ namespace alias declaration.
	Cursor_NamespaceAlias = C.CXCursor_NamespaceAlias
	// Cursor_UsingDirective a C++ using directive.
	Cursor_UsingDirective = C.CXCursor_UsingDirective
	// Cursor_UsingDeclaration a C++ using declaration.
	Cursor_UsingDeclaration = C.CXCursor_UsingDeclaration
	// Cursor_TypeAliasDecl a C++ alias declaration
	Cursor_TypeAliasDecl = C.CXCursor_TypeAliasDecl
	// Cursor_ObjCSynthesizeDecl an Objective-C \@synthesize definition.
	Cursor_ObjCSynthesizeDecl = C.CXCursor_ObjCSynthesizeDecl
	// Cursor_ObjCDynamicDecl an Objective-C \@dynamic definition.
	Cursor_ObjCDynamicDecl = C.CXCursor_ObjCDynamicDecl
	// Cursor_CXXAccessSpecifier an access specifier.
	Cursor_CXXAccessSpecifier = C.CXCursor_CXXAccessSpecifier
	// Cursor_FirstDecl an access specifier.
	Cursor_FirstDecl = C.CXCursor_FirstDecl
	// Cursor_LastDecl an access specifier.
	Cursor_LastDecl = C.CXCursor_LastDecl
	// Cursor_FirstRef an access specifier.
	Cursor_FirstRef = C.CXCursor_FirstRef
	// Cursor_ObjCSuperClassRef an access specifier.
	Cursor_ObjCSuperClassRef = C.CXCursor_ObjCSuperClassRef
	// Cursor_ObjCProtocolRef an access specifier.
	Cursor_ObjCProtocolRef = C.CXCursor_ObjCProtocolRef
	// Cursor_ObjCClassRef an access specifier.
	Cursor_ObjCClassRef = C.CXCursor_ObjCClassRef
	// Cursor_TypeRef a reference to a type declaration.
	//
	// A type reference occurs anywhere where a type is named but not
	// declared. For example, given:
	//
	//  typedef unsigned size_type;
	//  size_type size;
	//
	// The typedef is a declaration of size_type (CXCursor_TypedefDecl),
	// while the type of the variable "size" is referenced. The cursor
	// referenced by the type of size is the typedef for size_type.
	Cursor_TypeRef = C.CXCursor_TypeRef
	// Cursor_CXXBaseSpecifier a reference to a type declaration.
	//
	// A type reference occurs anywhere where a type is named but not
	// declared. For example, given:
	//
	//  typedef unsigned size_type;
	//  size_type size;
	//
	// The typedef is a declaration of size_type (CXCursor_TypedefDecl),
	// while the type of the variable "size" is referenced. The cursor
	// referenced by the type of size is the typedef for size_type.
	Cursor_CXXBaseSpecifier = C.CXCursor_CXXBaseSpecifier
	// Cursor_TemplateRef a reference to a class template, function template, template template parameter, or class template partial specialization.
	Cursor_TemplateRef = C.CXCursor_TemplateRef
	// Cursor_NamespaceRef a reference to a namespace or namespace alias.
	Cursor_NamespaceRef = C.CXCursor_NamespaceRef
	// Cursor_MemberRef a reference to a member of a struct, union, or class that occurs in some non-expression context, e.g., a designated initializer.
	Cursor_MemberRef = C.CXCursor_MemberRef
	// Cursor_LabelRef a reference to a labeled statement.
	//
	// This cursor kind is used to describe the jump to "start_over" in the
	// goto statement in the following example:
	//
	//  start_over:
	//  ++counter;
	//
	//  goto start_over;
	//
	// A label reference cursor refers to a label statement.
	Cursor_LabelRef = C.CXCursor_LabelRef
	// Cursor_OverloadedDeclRef a reference to a set of overloaded functions or function templates
	// that has not yet been resolved to a specific function or function template.
	//
	// An overloaded declaration reference cursor occurs in C++ templates where
	// a dependent name refers to a function. For example:
	//
	//  template<typename T> void swap(T&, T&);
	//
	//  struct X { ... };
	//  void swap(X&, X&);
	//
	//  template<typename T>
	//  void reverse(T* first, T* last) {
	//  while (first < last - 1) {
	//  swap(*first, *--last);
	//  ++first;
	//  }
	//  }
	//
	//  struct Y { };
	//  void swap(Y&, Y&);
	//
	// Here, the identifier "swap" is associated with an overloaded declaration
	// reference. In the template definition, "swap" refers to either of the two
	// "swap" functions declared above, so both results will be available. At
	// instantiation time, "swap" may also refer to other functions found via
	// argument-dependent lookup (e.g., the "swap" function at the end of the
	// example).
	//
	// The functions clang_getNumOverloadedDecls() and
	// clang_getOverloadedDecl() can be used to retrieve the definitions
	// referenced by this cursor.
	Cursor_OverloadedDeclRef = C.CXCursor_OverloadedDeclRef
	// Cursor_VariableRef a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_VariableRef = C.CXCursor_VariableRef
	// Cursor_LastRef a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_LastRef = C.CXCursor_LastRef
	// Cursor_FirstInvalid a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_FirstInvalid = C.CXCursor_FirstInvalid
	// Cursor_InvalidFile a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_InvalidFile = C.CXCursor_InvalidFile
	// Cursor_NoDeclFound a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_NoDeclFound = C.CXCursor_NoDeclFound
	// Cursor_NotImplemented a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_NotImplemented = C.CXCursor_NotImplemented
	// Cursor_InvalidCode a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_InvalidCode = C.CXCursor_InvalidCode
	// Cursor_LastInvalid a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_LastInvalid = C.CXCursor_LastInvalid
	// Cursor_FirstExpr a reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
	Cursor_FirstExpr = C.CXCursor_FirstExpr
	// Cursor_UnexposedExpr an expression whose specific kind is not exposed via this
	// interface.
	//
	// Unexposed expressions have the same operations as any other kind
	// of expression; one can extract their location information,
	// spelling, children, etc. However, the specific kind of the
	// expression is not reported.
	Cursor_UnexposedExpr = C.CXCursor_UnexposedExpr
	// Cursor_DeclRefExpr an expression that refers to some value declaration, such as a function, variable, or enumerator.
	Cursor_DeclRefExpr = C.CXCursor_DeclRefExpr
	// Cursor_MemberRefExpr an expression that refers to a member of a struct, union, class, Objective-C class, etc.
	Cursor_MemberRefExpr = C.CXCursor_MemberRefExpr
	// Cursor_CallExpr an expression that calls a function.
	Cursor_CallExpr = C.CXCursor_CallExpr
	// Cursor_ObjCMessageExpr an expression that sends a message to an Objective-C  object or class.
	Cursor_ObjCMessageExpr = C.CXCursor_ObjCMessageExpr
	// Cursor_BlockExpr an expression that represents a block literal.
	Cursor_BlockExpr = C.CXCursor_BlockExpr
	// Cursor_IntegerLiteral an integer literal.
	Cursor_IntegerLiteral = C.CXCursor_IntegerLiteral
	// Cursor_FloatingLiteral a floating point number literal.
	Cursor_FloatingLiteral = C.CXCursor_FloatingLiteral
	// Cursor_ImaginaryLiteral an imaginary number literal.
	Cursor_ImaginaryLiteral = C.CXCursor_ImaginaryLiteral
	// Cursor_StringLiteral a string literal.
	Cursor_StringLiteral = C.CXCursor_StringLiteral
	// Cursor_CharacterLiteral a character literal.
	Cursor_CharacterLiteral = C.CXCursor_CharacterLiteral
	// Cursor_ParenExpr a parenthesized expression, e.g. "(1)".
	//
	// This AST node is only formed if full location information is requested.
	Cursor_ParenExpr = C.CXCursor_ParenExpr
	// Cursor_UnaryOperator this represents the unary-expression's (except sizeof and alignof).
	Cursor_UnaryOperator = C.CXCursor_UnaryOperator
	// Cursor_ArraySubscriptExpr [C99 6.5.2.1] Array Subscripting.
	Cursor_ArraySubscriptExpr = C.CXCursor_ArraySubscriptExpr
	// Cursor_BinaryOperator a builtin binary operation expression such as "x + y" or "x <= y".
	Cursor_BinaryOperator = C.CXCursor_BinaryOperator
	// Cursor_CompoundAssignOperator compound assignment such as "+=".
	Cursor_CompoundAssignOperator = C.CXCursor_CompoundAssignOperator
	// Cursor_ConditionalOperator the ?: ternary operator.
	Cursor_ConditionalOperator = C.CXCursor_ConditionalOperator
	// Cursor_CStyleCastExpr an explicit cast in C (C99 6.5.4) or a C-style cast in C++
	// (C++ [expr.cast]), which uses the syntax (Type)expr.
	//
	// For example: (int)f.
	Cursor_CStyleCastExpr = C.CXCursor_CStyleCastExpr
	// Cursor_CompoundLiteralExpr [C99 6.5.2.5]
	Cursor_CompoundLiteralExpr = C.CXCursor_CompoundLiteralExpr
	// Cursor_InitListExpr describes an C or C++ initializer list.
	Cursor_InitListExpr = C.CXCursor_InitListExpr
	// Cursor_AddrLabelExpr the GNU address of label extension, representing &&label.
	Cursor_AddrLabelExpr = C.CXCursor_AddrLabelExpr
	// Cursor_StmtExpr this is the GNU Statement Expression extension: ({int X=4; X;})
	Cursor_StmtExpr = C.CXCursor_StmtExpr
	// Cursor_GenericSelectionExpr represents a C11 generic selection.
	Cursor_GenericSelectionExpr = C.CXCursor_GenericSelectionExpr
	// Cursor_GNUNullExpr implements the GNU __null extension, which is a name for a null
	// pointer constant that has integral type (e.g., int or long) and is the same
	// size and alignment as a pointer.
	//
	// The __null extension is typically only used by system headers, which define
	// NULL as __null in C++ rather than using 0 (which is an integer that may not
	// match the size of a pointer).
	Cursor_GNUNullExpr = C.CXCursor_GNUNullExpr
	// Cursor_CXXStaticCastExpr c++'s static_cast<> expression.
	Cursor_CXXStaticCastExpr = C.CXCursor_CXXStaticCastExpr
	// Cursor_CXXDynamicCastExpr c++'s dynamic_cast<> expression.
	Cursor_CXXDynamicCastExpr = C.CXCursor_CXXDynamicCastExpr
	// Cursor_CXXReinterpretCastExpr c++'s reinterpret_cast<> expression.
	Cursor_CXXReinterpretCastExpr = C.CXCursor_CXXReinterpretCastExpr
	// Cursor_CXXConstCastExpr c++'s const_cast<> expression.
	Cursor_CXXConstCastExpr = C.CXCursor_CXXConstCastExpr
	// Cursor_CXXFunctionalCastExpr represents an explicit C++ type conversion that uses "functional"
	// notion (C++ [expr.type.conv]).
	//
	// Example:
	//  x = int(0.5);
	Cursor_CXXFunctionalCastExpr = C.CXCursor_CXXFunctionalCastExpr
	// Cursor_CXXTypeidExpr a C++ typeid expression (C++ [expr.typeid]).
	Cursor_CXXTypeidExpr = C.CXCursor_CXXTypeidExpr
	// Cursor_CXXBoolLiteralExpr [C++ 2.13.5] C++ Boolean Literal.
	Cursor_CXXBoolLiteralExpr = C.CXCursor_CXXBoolLiteralExpr
	// Cursor_CXXNullPtrLiteralExpr [C++0x 2.14.7] C++ Pointer Literal.
	Cursor_CXXNullPtrLiteralExpr = C.CXCursor_CXXNullPtrLiteralExpr
	// Cursor_CXXThisExpr represents the "this" expression in C++
	Cursor_CXXThisExpr = C.CXCursor_CXXThisExpr
	// Cursor_CXXThrowExpr [C++ 15] C++ Throw Expression.
	//
	// This handles 'throw' and 'throw' assignment-expression. When
	// assignment-expression isn't present, Op will be null.
	Cursor_CXXThrowExpr = C.CXCursor_CXXThrowExpr
	// Cursor_CXXNewExpr a new expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
	Cursor_CXXNewExpr = C.CXCursor_CXXNewExpr
	// Cursor_CXXDeleteExpr a delete expression for memory deallocation and destructor calls, e.g. "delete[] pArray".
	Cursor_CXXDeleteExpr = C.CXCursor_CXXDeleteExpr
	// Cursor_UnaryExpr a unary expression. (noexcept, sizeof, or other traits)
	Cursor_UnaryExpr = C.CXCursor_UnaryExpr
	// Cursor_ObjCStringLiteral an Objective-C string literal i.e. @"foo".
	Cursor_ObjCStringLiteral = C.CXCursor_ObjCStringLiteral
	// Cursor_ObjCEncodeExpr an Objective-C \@encode expression.
	Cursor_ObjCEncodeExpr = C.CXCursor_ObjCEncodeExpr
	// Cursor_ObjCSelectorExpr an Objective-C \@selector expression.
	Cursor_ObjCSelectorExpr = C.CXCursor_ObjCSelectorExpr
	// Cursor_ObjCProtocolExpr an Objective-C \@protocol expression.
	Cursor_ObjCProtocolExpr = C.CXCursor_ObjCProtocolExpr
	// Cursor_ObjCBridgedCastExpr an Objective-C "bridged" cast expression, which casts between
	// Objective-C pointers and C pointers, transferring ownership in the process.
	//
	//  NSString *str = (__bridge_transfer NSString *)CFCreateString();
	Cursor_ObjCBridgedCastExpr = C.CXCursor_ObjCBridgedCastExpr
	// Cursor_PackExpansionExpr represents a C++0x pack expansion that produces a sequence of
	// expressions.
	//
	// A pack expansion expression contains a pattern (which itself is an
	// expression) followed by an ellipsis. For example:
	//
	//  template<typename F, typename ...Types>
	//  void forward(F f, Types &&...args) {
	//  f(static_cast<Types&&>(args)...);
	//  }
	Cursor_PackExpansionExpr = C.CXCursor_PackExpansionExpr
	// Cursor_SizeOfPackExpr represents an expression that computes the length of a parameter
	// pack.
	//
	//  template<typename ...Types>
	//  struct count {
	//  static const unsigned value = sizeof...(Types);
	//  };
	Cursor_SizeOfPackExpr = C.CXCursor_SizeOfPackExpr
	Cursor_LambdaExpr     = C.CXCursor_LambdaExpr
	// Cursor_ObjCBoolLiteralExpr objective-c Boolean Literal.
	Cursor_ObjCBoolLiteralExpr = C.CXCursor_ObjCBoolLiteralExpr
	// Cursor_ObjCSelfExpr represents the "self" expression in an Objective-C method.
	Cursor_ObjCSelfExpr = C.CXCursor_ObjCSelfExpr
	// Cursor_OMPArraySectionExpr openMP 5.0 [2.1.5, Array Section].
	Cursor_OMPArraySectionExpr = C.CXCursor_OMPArraySectionExpr
	// Cursor_ObjCAvailabilityCheckExpr represents an @available(...) check.
	Cursor_ObjCAvailabilityCheckExpr = C.CXCursor_ObjCAvailabilityCheckExpr
	// Cursor_FixedPointLiteral fixed point literal
	Cursor_FixedPointLiteral = C.CXCursor_FixedPointLiteral
	// Cursor_OMPArrayShapingExpr openMP 5.0 [2.1.4, Array Shaping].
	Cursor_OMPArrayShapingExpr = C.CXCursor_OMPArrayShapingExpr
	// Cursor_OMPIteratorExpr openMP 5.0 [2.1.6 Iterators]
	Cursor_OMPIteratorExpr = C.CXCursor_OMPIteratorExpr
	// Cursor_CXXAddrspaceCastExpr openCL's addrspace_cast<> expression.
	Cursor_CXXAddrspaceCastExpr = C.CXCursor_CXXAddrspaceCastExpr
	// Cursor_LastExpr openCL's addrspace_cast<> expression.
	Cursor_LastExpr = C.CXCursor_LastExpr
	// Cursor_FirstStmt openCL's addrspace_cast<> expression.
	Cursor_FirstStmt = C.CXCursor_FirstStmt
	// Cursor_UnexposedStmt a statement whose specific kind is not exposed via this
	// interface.
	//
	// Unexposed statements have the same operations as any other kind of
	// statement; one can extract their location information, spelling,
	// children, etc. However, the specific kind of the statement is not
	// reported.
	Cursor_UnexposedStmt = C.CXCursor_UnexposedStmt
	// Cursor_LabelStmt a labelled statement in a function.
	//
	// This cursor kind is used to describe the "start_over:" label statement in
	// the following example:
	//
	//  start_over:
	//  ++counter;
	Cursor_LabelStmt = C.CXCursor_LabelStmt
	// Cursor_CompoundStmt a group of statements like { stmt stmt }.
	//
	// This cursor kind is used to describe compound statements, e.g. function
	// bodies.
	Cursor_CompoundStmt = C.CXCursor_CompoundStmt
	// Cursor_CaseStmt a case statement.
	Cursor_CaseStmt = C.CXCursor_CaseStmt
	// Cursor_DefaultStmt a default statement.
	Cursor_DefaultStmt = C.CXCursor_DefaultStmt
	// Cursor_IfStmt an if statement
	Cursor_IfStmt = C.CXCursor_IfStmt
	// Cursor_SwitchStmt a switch statement.
	Cursor_SwitchStmt = C.CXCursor_SwitchStmt
	// Cursor_WhileStmt a while statement.
	Cursor_WhileStmt = C.CXCursor_WhileStmt
	// Cursor_DoStmt a do statement.
	Cursor_DoStmt = C.CXCursor_DoStmt
	// Cursor_ForStmt a for statement.
	Cursor_ForStmt = C.CXCursor_ForStmt
	// Cursor_GotoStmt a goto statement.
	Cursor_GotoStmt = C.CXCursor_GotoStmt
	// Cursor_IndirectGotoStmt an indirect goto statement.
	Cursor_IndirectGotoStmt = C.CXCursor_IndirectGotoStmt
	// Cursor_ContinueStmt a continue statement.
	Cursor_ContinueStmt = C.CXCursor_ContinueStmt
	// Cursor_BreakStmt a break statement.
	Cursor_BreakStmt = C.CXCursor_BreakStmt
	// Cursor_ReturnStmt a return statement.
	Cursor_ReturnStmt = C.CXCursor_ReturnStmt
	// Cursor_GCCAsmStmt a GCC inline assembly statement extension.
	Cursor_GCCAsmStmt = C.CXCursor_GCCAsmStmt
	// Cursor_AsmStmt a GCC inline assembly statement extension.
	Cursor_AsmStmt = C.CXCursor_AsmStmt
	// Cursor_ObjCAtTryStmt objective-C's overall try-catch-finallystatement.
	Cursor_ObjCAtTryStmt = C.CXCursor_ObjCAtTryStmt
	// Cursor_ObjCAtCatchStmt objective-C's catch statement.
	Cursor_ObjCAtCatchStmt = C.CXCursor_ObjCAtCatchStmt
	// Cursor_ObjCAtFinallyStmt objective-C's finallystatement.
	Cursor_ObjCAtFinallyStmt = C.CXCursor_ObjCAtFinallyStmt
	// Cursor_ObjCAtThrowStmt objective-C's \@throw statement.
	Cursor_ObjCAtThrowStmt = C.CXCursor_ObjCAtThrowStmt
	// Cursor_ObjCAtSynchronizedStmt objective-C's \@synchronized statement.
	Cursor_ObjCAtSynchronizedStmt = C.CXCursor_ObjCAtSynchronizedStmt
	// Cursor_ObjCAutoreleasePoolStmt objective-C's autorelease pool statement.
	Cursor_ObjCAutoreleasePoolStmt = C.CXCursor_ObjCAutoreleasePoolStmt
	// Cursor_ObjCForCollectionStmt objective-C's collection statement.
	Cursor_ObjCForCollectionStmt = C.CXCursor_ObjCForCollectionStmt
	// Cursor_CXXCatchStmt c++'s catch statement.
	Cursor_CXXCatchStmt = C.CXCursor_CXXCatchStmt
	// Cursor_CXXTryStmt c++'s try statement.
	Cursor_CXXTryStmt = C.CXCursor_CXXTryStmt
	// Cursor_CXXForRangeStmt c++'s for (* : *) statement.
	Cursor_CXXForRangeStmt = C.CXCursor_CXXForRangeStmt
	// Cursor_SEHTryStmt windows Structured Exception Handling's try statement.
	Cursor_SEHTryStmt = C.CXCursor_SEHTryStmt
	// Cursor_SEHExceptStmt windows Structured Exception Handling's except statement.
	Cursor_SEHExceptStmt = C.CXCursor_SEHExceptStmt
	// Cursor_SEHFinallyStmt windows Structured Exception Handling's finally statement.
	Cursor_SEHFinallyStmt = C.CXCursor_SEHFinallyStmt
	// Cursor_MSAsmStmt a MS inline assembly statement extension.
	Cursor_MSAsmStmt = C.CXCursor_MSAsmStmt
	// Cursor_NullStmt the null statement ";": C99 6.8.3p3.
	//
	// This cursor kind is used to describe the null statement.
	Cursor_NullStmt = C.CXCursor_NullStmt
	// Cursor_DeclStmt adaptor class for mixing declarations with statements and expressions.
	Cursor_DeclStmt = C.CXCursor_DeclStmt
	// Cursor_OMPParallelDirective openMP parallel directive.
	Cursor_OMPParallelDirective = C.CXCursor_OMPParallelDirective
	// Cursor_OMPSimdDirective openMP SIMD directive.
	Cursor_OMPSimdDirective = C.CXCursor_OMPSimdDirective
	// Cursor_OMPForDirective openMP for directive.
	Cursor_OMPForDirective = C.CXCursor_OMPForDirective
	// Cursor_OMPSectionsDirective openMP sections directive.
	Cursor_OMPSectionsDirective = C.CXCursor_OMPSectionsDirective
	// Cursor_OMPSectionDirective openMP section directive.
	Cursor_OMPSectionDirective = C.CXCursor_OMPSectionDirective
	// Cursor_OMPSingleDirective openMP single directive.
	Cursor_OMPSingleDirective = C.CXCursor_OMPSingleDirective
	// Cursor_OMPParallelForDirective openMP parallel for directive.
	Cursor_OMPParallelForDirective = C.CXCursor_OMPParallelForDirective
	// Cursor_OMPParallelSectionsDirective openMP parallel sections directive.
	Cursor_OMPParallelSectionsDirective = C.CXCursor_OMPParallelSectionsDirective
	// Cursor_OMPTaskDirective openMP task directive.
	Cursor_OMPTaskDirective = C.CXCursor_OMPTaskDirective
	// Cursor_OMPMasterDirective openMP master directive.
	Cursor_OMPMasterDirective = C.CXCursor_OMPMasterDirective
	// Cursor_OMPCriticalDirective openMP critical directive.
	Cursor_OMPCriticalDirective = C.CXCursor_OMPCriticalDirective
	// Cursor_OMPTaskyieldDirective openMP taskyield directive.
	Cursor_OMPTaskyieldDirective = C.CXCursor_OMPTaskyieldDirective
	// Cursor_OMPBarrierDirective openMP barrier directive.
	Cursor_OMPBarrierDirective = C.CXCursor_OMPBarrierDirective
	// Cursor_OMPTaskwaitDirective openMP taskwait directive.
	Cursor_OMPTaskwaitDirective = C.CXCursor_OMPTaskwaitDirective
	// Cursor_OMPFlushDirective openMP flush directive.
	Cursor_OMPFlushDirective = C.CXCursor_OMPFlushDirective
	// Cursor_SEHLeaveStmt windows Structured Exception Handling's leave statement.
	Cursor_SEHLeaveStmt = C.CXCursor_SEHLeaveStmt
	// Cursor_OMPOrderedDirective openMP ordered directive.
	Cursor_OMPOrderedDirective = C.CXCursor_OMPOrderedDirective
	// Cursor_OMPAtomicDirective openMP atomic directive.
	Cursor_OMPAtomicDirective = C.CXCursor_OMPAtomicDirective
	// Cursor_OMPForSimdDirective openMP for SIMD directive.
	Cursor_OMPForSimdDirective = C.CXCursor_OMPForSimdDirective
	// Cursor_OMPParallelForSimdDirective openMP parallel for SIMD directive.
	Cursor_OMPParallelForSimdDirective = C.CXCursor_OMPParallelForSimdDirective
	// Cursor_OMPTargetDirective openMP target directive.
	Cursor_OMPTargetDirective = C.CXCursor_OMPTargetDirective
	// Cursor_OMPTeamsDirective openMP teams directive.
	Cursor_OMPTeamsDirective = C.CXCursor_OMPTeamsDirective
	// Cursor_OMPTaskgroupDirective openMP taskgroup directive.
	Cursor_OMPTaskgroupDirective = C.CXCursor_OMPTaskgroupDirective
	// Cursor_OMPCancellationPointDirective openMP cancellation point directive.
	Cursor_OMPCancellationPointDirective = C.CXCursor_OMPCancellationPointDirective
	// Cursor_OMPCancelDirective openMP cancel directive.
	Cursor_OMPCancelDirective = C.CXCursor_OMPCancelDirective
	// Cursor_OMPTargetDataDirective openMP target data directive.
	Cursor_OMPTargetDataDirective = C.CXCursor_OMPTargetDataDirective
	// Cursor_OMPTaskLoopDirective openMP taskloop directive.
	Cursor_OMPTaskLoopDirective = C.CXCursor_OMPTaskLoopDirective
	// Cursor_OMPTaskLoopSimdDirective openMP taskloop simd directive.
	Cursor_OMPTaskLoopSimdDirective = C.CXCursor_OMPTaskLoopSimdDirective
	// Cursor_OMPDistributeDirective openMP distribute directive.
	Cursor_OMPDistributeDirective = C.CXCursor_OMPDistributeDirective
	// Cursor_OMPTargetEnterDataDirective openMP target enter data directive.
	Cursor_OMPTargetEnterDataDirective = C.CXCursor_OMPTargetEnterDataDirective
	// Cursor_OMPTargetExitDataDirective openMP target exit data directive.
	Cursor_OMPTargetExitDataDirective = C.CXCursor_OMPTargetExitDataDirective
	// Cursor_OMPTargetParallelDirective openMP target parallel directive.
	Cursor_OMPTargetParallelDirective = C.CXCursor_OMPTargetParallelDirective
	// Cursor_OMPTargetParallelForDirective openMP target parallel for directive.
	Cursor_OMPTargetParallelForDirective = C.CXCursor_OMPTargetParallelForDirective
	// Cursor_OMPTargetUpdateDirective openMP target update directive.
	Cursor_OMPTargetUpdateDirective = C.CXCursor_OMPTargetUpdateDirective
	// Cursor_OMPDistributeParallelForDirective openMP distribute parallel for directive.
	Cursor_OMPDistributeParallelForDirective = C.CXCursor_OMPDistributeParallelForDirective
	// Cursor_OMPDistributeParallelForSimdDirective openMP distribute parallel for simd directive.
	Cursor_OMPDistributeParallelForSimdDirective = C.CXCursor_OMPDistributeParallelForSimdDirective
	// Cursor_OMPDistributeSimdDirective openMP distribute simd directive.
	Cursor_OMPDistributeSimdDirective = C.CXCursor_OMPDistributeSimdDirective
	// Cursor_OMPTargetParallelForSimdDirective openMP target parallel for simd directive.
	Cursor_OMPTargetParallelForSimdDirective = C.CXCursor_OMPTargetParallelForSimdDirective
	// Cursor_OMPTargetSimdDirective openMP target simd directive.
	Cursor_OMPTargetSimdDirective = C.CXCursor_OMPTargetSimdDirective
	// Cursor_OMPTeamsDistributeDirective openMP teams distribute directive.
	Cursor_OMPTeamsDistributeDirective = C.CXCursor_OMPTeamsDistributeDirective
	// Cursor_OMPTeamsDistributeSimdDirective openMP teams distribute simd directive.
	Cursor_OMPTeamsDistributeSimdDirective = C.CXCursor_OMPTeamsDistributeSimdDirective
	// Cursor_OMPTeamsDistributeParallelForSimdDirective openMP teams distribute parallel for simd directive.
	Cursor_OMPTeamsDistributeParallelForSimdDirective = C.CXCursor_OMPTeamsDistributeParallelForSimdDirective
	// Cursor_OMPTeamsDistributeParallelForDirective openMP teams distribute parallel for directive.
	Cursor_OMPTeamsDistributeParallelForDirective = C.CXCursor_OMPTeamsDistributeParallelForDirective
	// Cursor_OMPTargetTeamsDirective openMP target teams directive.
	Cursor_OMPTargetTeamsDirective = C.CXCursor_OMPTargetTeamsDirective
	// Cursor_OMPTargetTeamsDistributeDirective openMP target teams distribute directive.
	Cursor_OMPTargetTeamsDistributeDirective = C.CXCursor_OMPTargetTeamsDistributeDirective
	// Cursor_OMPTargetTeamsDistributeParallelForDirective openMP target teams distribute parallel for directive.
	Cursor_OMPTargetTeamsDistributeParallelForDirective = C.CXCursor_OMPTargetTeamsDistributeParallelForDirective
	// Cursor_OMPTargetTeamsDistributeParallelForSimdDirective openMP target teams distribute parallel for simd directive.
	Cursor_OMPTargetTeamsDistributeParallelForSimdDirective = C.CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective
	// Cursor_OMPTargetTeamsDistributeSimdDirective openMP target teams distribute simd directive.
	Cursor_OMPTargetTeamsDistributeSimdDirective = C.CXCursor_OMPTargetTeamsDistributeSimdDirective
	// Cursor_BuiltinBitCastExpr c++2a std::bit_cast expression.
	Cursor_BuiltinBitCastExpr = C.CXCursor_BuiltinBitCastExpr
	// Cursor_OMPMasterTaskLoopDirective openMP master taskloop directive.
	Cursor_OMPMasterTaskLoopDirective = C.CXCursor_OMPMasterTaskLoopDirective
	// Cursor_OMPParallelMasterTaskLoopDirective openMP parallel master taskloop directive.
	Cursor_OMPParallelMasterTaskLoopDirective = C.CXCursor_OMPParallelMasterTaskLoopDirective
	// Cursor_OMPMasterTaskLoopSimdDirective openMP master taskloop simd directive.
	Cursor_OMPMasterTaskLoopSimdDirective = C.CXCursor_OMPMasterTaskLoopSimdDirective
	// Cursor_OMPParallelMasterTaskLoopSimdDirective openMP parallel master taskloop simd directive.
	Cursor_OMPParallelMasterTaskLoopSimdDirective = C.CXCursor_OMPParallelMasterTaskLoopSimdDirective
	// Cursor_OMPParallelMasterDirective openMP parallel master directive.
	Cursor_OMPParallelMasterDirective = C.CXCursor_OMPParallelMasterDirective
	// Cursor_OMPDepobjDirective openMP depobj directive.
	Cursor_OMPDepobjDirective = C.CXCursor_OMPDepobjDirective
	// Cursor_OMPScanDirective openMP scan directive.
	Cursor_OMPScanDirective = C.CXCursor_OMPScanDirective
	// Cursor_OMPTileDirective openMP tile directive.
	Cursor_OMPTileDirective = C.CXCursor_OMPTileDirective
	// Cursor_OMPCanonicalLoop openMP canonical loop.
	Cursor_OMPCanonicalLoop = C.CXCursor_OMPCanonicalLoop
	// Cursor_OMPInteropDirective openMP interop directive.
	Cursor_OMPInteropDirective = C.CXCursor_OMPInteropDirective
	// Cursor_OMPDispatchDirective openMP dispatch directive.
	Cursor_OMPDispatchDirective = C.CXCursor_OMPDispatchDirective
	// Cursor_OMPMaskedDirective openMP masked directive.
	Cursor_OMPMaskedDirective = C.CXCursor_OMPMaskedDirective
	// Cursor_OMPUnrollDirective openMP unroll directive.
	Cursor_OMPUnrollDirective = C.CXCursor_OMPUnrollDirective
	// Cursor_OMPMetaDirective openMP metadirective directive.
	Cursor_OMPMetaDirective = C.CXCursor_OMPMetaDirective
	// Cursor_OMPGenericLoopDirective openMP loop directive.
	Cursor_OMPGenericLoopDirective = C.CXCursor_OMPGenericLoopDirective
	// Cursor_LastStmt openMP loop directive.
	Cursor_LastStmt = C.CXCursor_LastStmt
	// Cursor_TranslationUnit cursor that represents the translation unit itself.
	//
	// The translation unit cursor exists primarily to act as the root
	// cursor for traversing the contents of a translation unit.
	Cursor_TranslationUnit = C.CXCursor_TranslationUnit
	// Cursor_FirstAttr cursor that represents the translation unit itself.
	//
	// The translation unit cursor exists primarily to act as the root
	// cursor for traversing the contents of a translation unit.
	Cursor_FirstAttr = C.CXCursor_FirstAttr
	// Cursor_UnexposedAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_UnexposedAttr = C.CXCursor_UnexposedAttr
	// Cursor_IBActionAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_IBActionAttr = C.CXCursor_IBActionAttr
	// Cursor_IBOutletAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_IBOutletAttr = C.CXCursor_IBOutletAttr
	// Cursor_IBOutletCollectionAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_IBOutletCollectionAttr = C.CXCursor_IBOutletCollectionAttr
	// Cursor_CXXFinalAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CXXFinalAttr = C.CXCursor_CXXFinalAttr
	// Cursor_CXXOverrideAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CXXOverrideAttr = C.CXCursor_CXXOverrideAttr
	// Cursor_AnnotateAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_AnnotateAttr = C.CXCursor_AnnotateAttr
	// Cursor_AsmLabelAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_AsmLabelAttr = C.CXCursor_AsmLabelAttr
	// Cursor_PackedAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_PackedAttr = C.CXCursor_PackedAttr
	// Cursor_PureAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_PureAttr = C.CXCursor_PureAttr
	// Cursor_ConstAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_ConstAttr = C.CXCursor_ConstAttr
	// Cursor_NoDuplicateAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_NoDuplicateAttr = C.CXCursor_NoDuplicateAttr
	// Cursor_CUDAConstantAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CUDAConstantAttr = C.CXCursor_CUDAConstantAttr
	// Cursor_CUDADeviceAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CUDADeviceAttr = C.CXCursor_CUDADeviceAttr
	// Cursor_CUDAGlobalAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CUDAGlobalAttr = C.CXCursor_CUDAGlobalAttr
	// Cursor_CUDAHostAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CUDAHostAttr = C.CXCursor_CUDAHostAttr
	// Cursor_CUDASharedAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_CUDASharedAttr = C.CXCursor_CUDASharedAttr
	// Cursor_VisibilityAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_VisibilityAttr = C.CXCursor_VisibilityAttr
	// Cursor_DLLExport an attribute whose specific kind is not exposed via this interface.
	Cursor_DLLExport = C.CXCursor_DLLExport
	// Cursor_DLLImport an attribute whose specific kind is not exposed via this interface.
	Cursor_DLLImport = C.CXCursor_DLLImport
	// Cursor_NSReturnsRetained an attribute whose specific kind is not exposed via this interface.
	Cursor_NSReturnsRetained = C.CXCursor_NSReturnsRetained
	// Cursor_NSReturnsNotRetained an attribute whose specific kind is not exposed via this interface.
	Cursor_NSReturnsNotRetained = C.CXCursor_NSReturnsNotRetained
	// Cursor_NSReturnsAutoreleased an attribute whose specific kind is not exposed via this interface.
	Cursor_NSReturnsAutoreleased = C.CXCursor_NSReturnsAutoreleased
	// Cursor_NSConsumesSelf an attribute whose specific kind is not exposed via this interface.
	Cursor_NSConsumesSelf = C.CXCursor_NSConsumesSelf
	// Cursor_NSConsumed an attribute whose specific kind is not exposed via this interface.
	Cursor_NSConsumed = C.CXCursor_NSConsumed
	// Cursor_ObjCException an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCException = C.CXCursor_ObjCException
	// Cursor_ObjCNSObject an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCNSObject = C.CXCursor_ObjCNSObject
	// Cursor_ObjCIndependentClass an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCIndependentClass = C.CXCursor_ObjCIndependentClass
	// Cursor_ObjCPreciseLifetime an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCPreciseLifetime = C.CXCursor_ObjCPreciseLifetime
	// Cursor_ObjCReturnsInnerPointer an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCReturnsInnerPointer = C.CXCursor_ObjCReturnsInnerPointer
	// Cursor_ObjCRequiresSuper an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCRequiresSuper = C.CXCursor_ObjCRequiresSuper
	// Cursor_ObjCRootClass an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCRootClass = C.CXCursor_ObjCRootClass
	// Cursor_ObjCSubclassingRestricted an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCSubclassingRestricted = C.CXCursor_ObjCSubclassingRestricted
	// Cursor_ObjCExplicitProtocolImpl an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCExplicitProtocolImpl = C.CXCursor_ObjCExplicitProtocolImpl
	// Cursor_ObjCDesignatedInitializer an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCDesignatedInitializer = C.CXCursor_ObjCDesignatedInitializer
	// Cursor_ObjCRuntimeVisible an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCRuntimeVisible = C.CXCursor_ObjCRuntimeVisible
	// Cursor_ObjCBoxable an attribute whose specific kind is not exposed via this interface.
	Cursor_ObjCBoxable = C.CXCursor_ObjCBoxable
	// Cursor_FlagEnum an attribute whose specific kind is not exposed via this interface.
	Cursor_FlagEnum = C.CXCursor_FlagEnum
	// Cursor_ConvergentAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_ConvergentAttr = C.CXCursor_ConvergentAttr
	// Cursor_WarnUnusedAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_WarnUnusedAttr = C.CXCursor_WarnUnusedAttr
	// Cursor_WarnUnusedResultAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_WarnUnusedResultAttr = C.CXCursor_WarnUnusedResultAttr
	// Cursor_AlignedAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_AlignedAttr = C.CXCursor_AlignedAttr
	// Cursor_LastAttr an attribute whose specific kind is not exposed via this interface.
	Cursor_LastAttr = C.CXCursor_LastAttr
	// Cursor_PreprocessingDirective an attribute whose specific kind is not exposed via this interface.
	Cursor_PreprocessingDirective = C.CXCursor_PreprocessingDirective
	// Cursor_MacroDefinition an attribute whose specific kind is not exposed via this interface.
	Cursor_MacroDefinition = C.CXCursor_MacroDefinition
	// Cursor_MacroExpansion an attribute whose specific kind is not exposed via this interface.
	Cursor_MacroExpansion = C.CXCursor_MacroExpansion
	// Cursor_MacroInstantiation an attribute whose specific kind is not exposed via this interface.
	Cursor_MacroInstantiation = C.CXCursor_MacroInstantiation
	// Cursor_InclusionDirective an attribute whose specific kind is not exposed via this interface.
	Cursor_InclusionDirective = C.CXCursor_InclusionDirective
	// Cursor_FirstPreprocessing an attribute whose specific kind is not exposed via this interface.
	Cursor_FirstPreprocessing = C.CXCursor_FirstPreprocessing
	// Cursor_LastPreprocessing an attribute whose specific kind is not exposed via this interface.
	Cursor_LastPreprocessing = C.CXCursor_LastPreprocessing
	// Cursor_ModuleImportDecl a module import declaration.
	Cursor_ModuleImportDecl = C.CXCursor_ModuleImportDecl
	// Cursor_TypeAliasTemplateDecl a module import declaration.
	Cursor_TypeAliasTemplateDecl = C.CXCursor_TypeAliasTemplateDecl
	// Cursor_StaticAssert a static_assert or _Static_assert node
	Cursor_StaticAssert = C.CXCursor_StaticAssert
	// Cursor_FriendDecl a friend declaration.
	Cursor_FriendDecl = C.CXCursor_FriendDecl
	// Cursor_FirstExtraDecl a friend declaration.
	Cursor_FirstExtraDecl = C.CXCursor_FirstExtraDecl
	// Cursor_LastExtraDecl a friend declaration.
	Cursor_LastExtraDecl = C.CXCursor_LastExtraDecl
	// Cursor_OverloadCandidate a code completion overload candidate.
	Cursor_OverloadCandidate = C.CXCursor_OverloadCandidate
)
View Source
const (
	DeclQualifier_None   DeclQualifierKind = C.CXObjCDeclQualifier_None
	DeclQualifier_In                       = C.CXObjCDeclQualifier_In
	DeclQualifier_Inout                    = C.CXObjCDeclQualifier_Inout
	DeclQualifier_Out                      = C.CXObjCDeclQualifier_Out
	DeclQualifier_Bycopy                   = C.CXObjCDeclQualifier_Bycopy
	DeclQualifier_Byref                    = C.CXObjCDeclQualifier_Byref
	DeclQualifier_Oneway                   = C.CXObjCDeclQualifier_Oneway
)
View Source
const (
	// Diagnostic_DisplaySourceLocation display the source-location information where the
	// diagnostic was located.
	//
	// When set, diagnostics will be prefixed by the file, line, and
	// (optionally) column to which the diagnostic refers. For example,
	//
	//  test.c:28: warning: extra tokens at end of #endif directive
	//
	// This option corresponds to the clang flag -fshow-source-location.
	Diagnostic_DisplaySourceLocation DiagnosticDisplayOptions = C.CXDiagnostic_DisplaySourceLocation
	// Diagnostic_DisplayColumn if displaying the source-location information of the
	// diagnostic, also include the column number.
	//
	// This option corresponds to the clang flag -fshow-column.
	Diagnostic_DisplayColumn = C.CXDiagnostic_DisplayColumn
	// Diagnostic_DisplaySourceRanges if displaying the source-location information of the
	// diagnostic, also include information about source ranges in a
	// machine-parsable format.
	//
	// This option corresponds to the clang flag
	// -fdiagnostics-print-source-range-info.
	Diagnostic_DisplaySourceRanges = C.CXDiagnostic_DisplaySourceRanges
	// Diagnostic_DisplayOption display the option name associated with this diagnostic, if any.
	//
	// The option name displayed (e.g., -Wconversion) will be placed in brackets
	// after the diagnostic text. This option corresponds to the clang flag
	// -fdiagnostics-show-option.
	Diagnostic_DisplayOption = C.CXDiagnostic_DisplayOption
	// Diagnostic_DisplayCategoryId display the category number associated with this diagnostic, if any.
	//
	// The category number is displayed within brackets after the diagnostic text.
	// This option corresponds to the clang flag
	// -fdiagnostics-show-category=id.
	Diagnostic_DisplayCategoryId = C.CXDiagnostic_DisplayCategoryId
	// Diagnostic_DisplayCategoryName display the category name associated with this diagnostic, if any.
	//
	// The category name is displayed within brackets after the diagnostic text.
	// This option corresponds to the clang flag
	// -fdiagnostics-show-category=name.
	Diagnostic_DisplayCategoryName = C.CXDiagnostic_DisplayCategoryName
)
View Source
const (
	// Diagnostic_Ignored a diagnostic that has been suppressed, e.g., by a command-line option.
	Diagnostic_Ignored DiagnosticSeverity = C.CXDiagnostic_Ignored
	// Diagnostic_Note this diagnostic is a note that should be attached to the previous (non-note) diagnostic.
	Diagnostic_Note = C.CXDiagnostic_Note
	// Diagnostic_Warning this diagnostic indicates suspicious code that may not be wrong.
	Diagnostic_Warning = C.CXDiagnostic_Warning
	// Diagnostic_Error this diagnostic indicates that the code is ill-formed.
	Diagnostic_Error = C.CXDiagnostic_Error
	// Diagnostic_Fatal this diagnostic indicates that the code is ill-formed such that future parser recovery is unlikely to produce useful results.
	Diagnostic_Fatal = C.CXDiagnostic_Fatal
)
View Source
const (
	// Error_Success no error.
	Error_Success ErrorCode = C.CXError_Success
	// Error_Failure a generic error code, no further details are available.
	//
	// Errors of this kind can get their own specific error codes in future
	// libclang versions.
	Error_Failure = C.CXError_Failure
	// Error_Crashed libclang crashed while performing the requested operation.
	Error_Crashed = C.CXError_Crashed
	// Error_InvalidArguments the function detected that the arguments violate the function contract.
	Error_InvalidArguments = C.CXError_InvalidArguments
	// Error_ASTReadError an AST deserialization error has occurred.
	Error_ASTReadError = C.CXError_ASTReadError
)
View Source
const (
	Eval_Int            EvalResultKind = C.CXEval_Int
	Eval_Float                         = C.CXEval_Float
	Eval_ObjCStrLiteral                = C.CXEval_ObjCStrLiteral
	Eval_StrLiteral                    = C.CXEval_StrLiteral
	Eval_CFStr                         = C.CXEval_CFStr
	Eval_Other                         = C.CXEval_Other
	Eval_UnExposed                     = C.CXEval_UnExposed
)
View Source
const (
	// GlobalOpt_None used to indicate that no special CXIndex options are needed.
	GlobalOpt_None GlobalOptFlags = C.CXGlobalOpt_None
	// GlobalOpt_ThreadBackgroundPriorityForIndexing used to indicate that threads that libclang creates for indexing
	// purposes should use background priority.
	//
	// Affects #clang_indexSourceFile, #clang_indexTranslationUnit,
	// #clang_parseTranslationUnit, #clang_saveTranslationUnit.
	GlobalOpt_ThreadBackgroundPriorityForIndexing = C.CXGlobalOpt_ThreadBackgroundPriorityForIndexing
	// GlobalOpt_ThreadBackgroundPriorityForEditing used to indicate that threads that libclang creates for editing
	// purposes should use background priority.
	//
	// Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt,
	// #clang_annotateTokens
	GlobalOpt_ThreadBackgroundPriorityForEditing = C.CXGlobalOpt_ThreadBackgroundPriorityForEditing
	// GlobalOpt_ThreadBackgroundPriorityForAll used to indicate that all threads that libclang creates should use background priority.
	GlobalOpt_ThreadBackgroundPriorityForAll = C.CXGlobalOpt_ThreadBackgroundPriorityForAll
)
View Source
const (
	IdxAttr_Unexposed          IdxAttrKind = C.CXIdxAttr_Unexposed
	IdxAttr_IBAction                       = C.CXIdxAttr_IBAction
	IdxAttr_IBOutlet                       = C.CXIdxAttr_IBOutlet
	IdxAttr_IBOutletCollection             = C.CXIdxAttr_IBOutletCollection
)
View Source
const (
	IdxEntity_NonTemplate                   IdxEntityCXXTemplateKind = C.CXIdxEntity_NonTemplate
	IdxEntity_Template                                               = C.CXIdxEntity_Template
	IdxEntity_TemplatePartialSpecialization                          = C.CXIdxEntity_TemplatePartialSpecialization
	IdxEntity_TemplateSpecialization                                 = C.CXIdxEntity_TemplateSpecialization
)
View Source
const (
	IdxEntity_Unexposed             IdxEntityKind = C.CXIdxEntity_Unexposed
	IdxEntity_Typedef                             = C.CXIdxEntity_Typedef
	IdxEntity_Function                            = C.CXIdxEntity_Function
	IdxEntity_Variable                            = C.CXIdxEntity_Variable
	IdxEntity_Field                               = C.CXIdxEntity_Field
	IdxEntity_EnumConstant                        = C.CXIdxEntity_EnumConstant
	IdxEntity_ObjCClass                           = C.CXIdxEntity_ObjCClass
	IdxEntity_ObjCProtocol                        = C.CXIdxEntity_ObjCProtocol
	IdxEntity_ObjCCategory                        = C.CXIdxEntity_ObjCCategory
	IdxEntity_ObjCInstanceMethod                  = C.CXIdxEntity_ObjCInstanceMethod
	IdxEntity_ObjCClassMethod                     = C.CXIdxEntity_ObjCClassMethod
	IdxEntity_ObjCProperty                        = C.CXIdxEntity_ObjCProperty
	IdxEntity_ObjCIvar                            = C.CXIdxEntity_ObjCIvar
	IdxEntity_Enum                                = C.CXIdxEntity_Enum
	IdxEntity_Struct                              = C.CXIdxEntity_Struct
	IdxEntity_Union                               = C.CXIdxEntity_Union
	IdxEntity_CXXClass                            = C.CXIdxEntity_CXXClass
	IdxEntity_CXXNamespace                        = C.CXIdxEntity_CXXNamespace
	IdxEntity_CXXNamespaceAlias                   = C.CXIdxEntity_CXXNamespaceAlias
	IdxEntity_CXXStaticVariable                   = C.CXIdxEntity_CXXStaticVariable
	IdxEntity_CXXStaticMethod                     = C.CXIdxEntity_CXXStaticMethod
	IdxEntity_CXXInstanceMethod                   = C.CXIdxEntity_CXXInstanceMethod
	IdxEntity_CXXConstructor                      = C.CXIdxEntity_CXXConstructor
	IdxEntity_CXXDestructor                       = C.CXIdxEntity_CXXDestructor
	IdxEntity_CXXConversionFunction               = C.CXIdxEntity_CXXConversionFunction
	IdxEntity_CXXTypeAlias                        = C.CXIdxEntity_CXXTypeAlias
	IdxEntity_CXXInterface                        = C.CXIdxEntity_CXXInterface
)
View Source
const (
	IdxEntityLang_None  IdxEntityLanguage = C.CXIdxEntityLang_None
	IdxEntityLang_C                       = C.CXIdxEntityLang_C
	IdxEntityLang_ObjC                    = C.CXIdxEntityLang_ObjC
	IdxEntityLang_CXX                     = C.CXIdxEntityLang_CXX
	IdxEntityLang_Swift                   = C.CXIdxEntityLang_Swift
)
View Source
const (
	IdxObjCContainer_ForwardRef     IdxObjCContainerKind = C.CXIdxObjCContainer_ForwardRef
	IdxObjCContainer_Interface                           = C.CXIdxObjCContainer_Interface
	IdxObjCContainer_Implementation                      = C.CXIdxObjCContainer_Implementation
)
View Source
const (
	// IndexOpt_None used to indicate that no special indexing options are needed.
	IndexOpt_None IndexOptFlags = C.CXIndexOpt_None
	// IndexOpt_SuppressRedundantRefs used to indicate that IndexerCallbacks#indexEntityReference should be invoked for only one reference of an entity per source file that does not also include a declaration/definition of the entity.
	IndexOpt_SuppressRedundantRefs = C.CXIndexOpt_SuppressRedundantRefs
	// IndexOpt_IndexFunctionLocalSymbols function-local symbols should be indexed. If this is not set function-local symbols will be ignored.
	IndexOpt_IndexFunctionLocalSymbols = C.CXIndexOpt_IndexFunctionLocalSymbols
	// IndexOpt_IndexImplicitTemplateInstantiations implicit function/class template instantiations should be indexed. If this is not set, implicit instantiations will be ignored.
	IndexOpt_IndexImplicitTemplateInstantiations = C.CXIndexOpt_IndexImplicitTemplateInstantiations
	// IndexOpt_SuppressWarnings suppress all compiler warnings when parsing for indexing.
	IndexOpt_SuppressWarnings = C.CXIndexOpt_SuppressWarnings
	// IndexOpt_SkipParsedBodiesInSession skip a function/method body that was already parsed during an indexing session associated with a CXIndexAction object. Bodies in system headers are always skipped.
	IndexOpt_SkipParsedBodiesInSession = C.CXIndexOpt_SkipParsedBodiesInSession
)
View Source
const (
	Language_Invalid   LanguageKind = C.CXLanguage_Invalid
	Language_C                      = C.CXLanguage_C
	Language_ObjC                   = C.CXLanguage_ObjC
	Language_CPlusPlus              = C.CXLanguage_CPlusPlus
)
View Source
const (
	// Linkage_Invalid this value indicates that no linkage information is available for a provided CXCursor.
	Linkage_Invalid LinkageKind = C.CXLinkage_Invalid
	// Linkage_NoLinkage this is the linkage for variables, parameters, and so on that have automatic storage. This covers normal (non-extern) local variables.
	Linkage_NoLinkage = C.CXLinkage_NoLinkage
	// Linkage_Internal this is the linkage for static variables and static functions.
	Linkage_Internal = C.CXLinkage_Internal
	// Linkage_UniqueExternal this is the linkage for entities with external linkage that live in C++ anonymous namespaces.
	Linkage_UniqueExternal = C.CXLinkage_UniqueExternal
	// Linkage_External this is the linkage for entities with true, external linkage.
	Linkage_External = C.CXLinkage_External
)
View Source
const (
	// LoadDiag_None indicates that no error occurred.
	LoadDiag_None LoadDiag_Error = C.CXLoadDiag_None
	// LoadDiag_Unknown indicates that an unknown error occurred while attempting to deserialize diagnostics.
	LoadDiag_Unknown = C.CXLoadDiag_Unknown
	// LoadDiag_CannotLoad indicates that the file containing the serialized diagnostics could not be opened.
	LoadDiag_CannotLoad = C.CXLoadDiag_CannotLoad
	// LoadDiag_InvalidFile indicates that the serialized diagnostics file is invalid or corrupt.
	LoadDiag_InvalidFile = C.CXLoadDiag_InvalidFile
)
View Source
const (
	// NameRange_WantQualifier include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range.
	NameRange_WantQualifier NameRefFlags = C.CXNameRange_WantQualifier
	// NameRange_WantTemplateArgs include the explicit template arguments, e.g. \<int> in x.f<int>, in the range.
	NameRange_WantTemplateArgs = C.CXNameRange_WantTemplateArgs
	// NameRange_WantSinglePiece if the name is non-contiguous, return the full spanning range.
	//
	// Non-contiguous names occur in Objective-C when a selector with two or more
	// parameters is used, or in C++ when using an operator:
	//  [object doSomething:here withValue:there]; // Objective-C
	//  return some_vector[1]; // C++
	NameRange_WantSinglePiece = C.CXNameRange_WantSinglePiece
)
View Source
const (
	PrintingPolicy_Indentation                           PrintingPolicyProperty = C.CXPrintingPolicy_Indentation
	PrintingPolicy_SuppressSpecifiers                                           = C.CXPrintingPolicy_SuppressSpecifiers
	PrintingPolicy_SuppressTagKeyword                                           = C.CXPrintingPolicy_SuppressTagKeyword
	PrintingPolicy_IncludeTagDefinition                                         = C.CXPrintingPolicy_IncludeTagDefinition
	PrintingPolicy_SuppressScope                                                = C.CXPrintingPolicy_SuppressScope
	PrintingPolicy_SuppressUnwrittenScope                                       = C.CXPrintingPolicy_SuppressUnwrittenScope
	PrintingPolicy_SuppressInitializers                                         = C.CXPrintingPolicy_SuppressInitializers
	PrintingPolicy_ConstantArraySizeAsWritten                                   = C.CXPrintingPolicy_ConstantArraySizeAsWritten
	PrintingPolicy_AnonymousTagLocations                                        = C.CXPrintingPolicy_AnonymousTagLocations
	PrintingPolicy_SuppressStrongLifetime                                       = C.CXPrintingPolicy_SuppressStrongLifetime
	PrintingPolicy_SuppressLifetimeQualifiers                                   = C.CXPrintingPolicy_SuppressLifetimeQualifiers
	PrintingPolicy_SuppressTemplateArgsInCXXConstructors                        = C.CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors
	PrintingPolicy_Bool                                                         = C.CXPrintingPolicy_Bool
	PrintingPolicy_Restrict                                                     = C.CXPrintingPolicy_Restrict
	PrintingPolicy_Alignof                                                      = C.CXPrintingPolicy_Alignof
	PrintingPolicy_UnderscoreAlignof                                            = C.CXPrintingPolicy_UnderscoreAlignof
	PrintingPolicy_UseVoidForZeroParams                                         = C.CXPrintingPolicy_UseVoidForZeroParams
	PrintingPolicy_TerseOutput                                                  = C.CXPrintingPolicy_TerseOutput
	PrintingPolicy_PolishForDeclaration                                         = C.CXPrintingPolicy_PolishForDeclaration
	PrintingPolicy_Half                                                         = C.CXPrintingPolicy_Half
	PrintingPolicy_MSWChar                                                      = C.CXPrintingPolicy_MSWChar
	PrintingPolicy_IncludeNewlines                                              = C.CXPrintingPolicy_IncludeNewlines
	PrintingPolicy_MSVCFormatting                                               = C.CXPrintingPolicy_MSVCFormatting
	PrintingPolicy_ConstantsAsWritten                                           = C.CXPrintingPolicy_ConstantsAsWritten
	PrintingPolicy_SuppressImplicitBase                                         = C.CXPrintingPolicy_SuppressImplicitBase
	PrintingPolicy_FullyQualifiedName                                           = C.CXPrintingPolicy_FullyQualifiedName
	PrintingPolicy_LastProperty                                                 = C.CXPrintingPolicy_LastProperty
)
View Source
const (
	PropertyAttr_noattr            PropertyAttrKind = C.CXObjCPropertyAttr_noattr
	PropertyAttr_readonly                           = C.CXObjCPropertyAttr_readonly
	PropertyAttr_getter                             = C.CXObjCPropertyAttr_getter
	PropertyAttr_assign                             = C.CXObjCPropertyAttr_assign
	PropertyAttr_readwrite                          = C.CXObjCPropertyAttr_readwrite
	PropertyAttr_retain                             = C.CXObjCPropertyAttr_retain
	PropertyAttr_copy                               = C.CXObjCPropertyAttr_copy
	PropertyAttr_nonatomic                          = C.CXObjCPropertyAttr_nonatomic
	PropertyAttr_setter                             = C.CXObjCPropertyAttr_setter
	PropertyAttr_atomic                             = C.CXObjCPropertyAttr_atomic
	PropertyAttr_weak                               = C.CXObjCPropertyAttr_weak
	PropertyAttr_strong                             = C.CXObjCPropertyAttr_strong
	PropertyAttr_unsafe_unretained                  = C.CXObjCPropertyAttr_unsafe_unretained
	PropertyAttr_class                              = C.CXObjCPropertyAttr_class
)
View Source
const (
	// RefQualifier_None no ref-qualifier was provided.
	RefQualifier_None RefQualifierKind = C.CXRefQualifier_None
	// RefQualifier_LValue an lvalue ref-qualifier was provided (&).
	RefQualifier_LValue = C.CXRefQualifier_LValue
	// RefQualifier_RValue an rvalue ref-qualifier was provided (&&).
	RefQualifier_RValue = C.CXRefQualifier_RValue
)
View Source
const (
	// Result_Success function returned successfully.
	Result_Success Result = C.CXResult_Success
	// Result_Invalid one of the parameters was invalid for the function.
	Result_Invalid = C.CXResult_Invalid
	// Result_VisitBreak the function was terminated by a callback (e.g. it returned CXVisit_Break)
	Result_VisitBreak = C.CXResult_VisitBreak
)
View Source
const (
	// SaveError_None indicates that no error occurred while saving a translation unit.
	SaveError_None SaveError = C.CXSaveError_None
	// SaveError_Unknown indicates that an unknown error occurred while attempting to save
	// the file.
	//
	// This error typically indicates that file I/O failed when attempting to
	// write the file.
	SaveError_Unknown = C.CXSaveError_Unknown
	// SaveError_TranslationErrors indicates that errors during translation prevented this attempt
	// to save the translation unit.
	//
	// Errors that prevent the translation unit from being saved can be
	// extracted using clang_getNumDiagnostics() and clang_getDiagnostic().
	SaveError_TranslationErrors = C.CXSaveError_TranslationErrors
	// SaveError_InvalidTU indicates that the translation unit to be saved was somehow invalid (e.g., NULL).
	SaveError_InvalidTU = C.CXSaveError_InvalidTU
)
View Source
const (
	SC_Invalid              StorageClass = C.CX_SC_Invalid
	SC_None                              = C.CX_SC_None
	SC_Extern                            = C.CX_SC_Extern
	SC_Static                            = C.CX_SC_Static
	SC_PrivateExtern                     = C.CX_SC_PrivateExtern
	SC_OpenCLWorkGroupLocal              = C.CX_SC_OpenCLWorkGroupLocal
	SC_Auto                              = C.CX_SC_Auto
	SC_Register                          = C.CX_SC_Register
)
View Source
const (
	SymbolRole_None        SymbolRole = C.CXSymbolRole_None
	SymbolRole_Declaration            = C.CXSymbolRole_Declaration
	SymbolRole_Definition             = C.CXSymbolRole_Definition
	SymbolRole_Reference              = C.CXSymbolRole_Reference
	SymbolRole_Read                   = C.CXSymbolRole_Read
	SymbolRole_Write                  = C.CXSymbolRole_Write
	SymbolRole_Call                   = C.CXSymbolRole_Call
	SymbolRole_Dynamic                = C.CXSymbolRole_Dynamic
	SymbolRole_AddressOf              = C.CXSymbolRole_AddressOf
	SymbolRole_Implicit               = C.CXSymbolRole_Implicit
)
View Source
const (
	TemplateArgumentKind_Null              TemplateArgumentKind = C.CXTemplateArgumentKind_Null
	TemplateArgumentKind_Type                                   = C.CXTemplateArgumentKind_Type
	TemplateArgumentKind_Declaration                            = C.CXTemplateArgumentKind_Declaration
	TemplateArgumentKind_NullPtr                                = C.CXTemplateArgumentKind_NullPtr
	TemplateArgumentKind_Integral                               = C.CXTemplateArgumentKind_Integral
	TemplateArgumentKind_Template                               = C.CXTemplateArgumentKind_Template
	TemplateArgumentKind_TemplateExpansion                      = C.CXTemplateArgumentKind_TemplateExpansion
	TemplateArgumentKind_Expression                             = C.CXTemplateArgumentKind_Expression
	TemplateArgumentKind_Pack                                   = C.CXTemplateArgumentKind_Pack
	TemplateArgumentKind_Invalid                                = C.CXTemplateArgumentKind_Invalid
)
View Source
const (
	TLS_None    TLSKind = C.CXTLS_None
	TLS_Dynamic         = C.CXTLS_Dynamic
	TLS_Static          = C.CXTLS_Static
)
View Source
const (
	// Token_Punctuation a token that contains some kind of punctuation.
	Token_Punctuation TokenKind = C.CXToken_Punctuation
	// Token_Keyword a language keyword.
	Token_Keyword = C.CXToken_Keyword
	// Token_Identifier an identifier (that is not a keyword).
	Token_Identifier = C.CXToken_Identifier
	// Token_Literal a numeric, string, or character literal.
	Token_Literal = C.CXToken_Literal
	// Token_Comment a comment.
	Token_Comment = C.CXToken_Comment
)
View Source
const (
	// TranslationUnit_None used to indicate that no special translation-unit options are needed.
	TranslationUnit_None TranslationUnit_Flags = C.CXTranslationUnit_None
	// TranslationUnit_DetailedPreprocessingRecord used to indicate that the parser should construct a "detailed"
	// preprocessing record, including all macro definitions and instantiations.
	//
	// Constructing a detailed preprocessing record requires more memory
	// and time to parse, since the information contained in the record
	// is usually not retained. However, it can be useful for
	// applications that require more detailed information about the
	// behavior of the preprocessor.
	TranslationUnit_DetailedPreprocessingRecord = C.CXTranslationUnit_DetailedPreprocessingRecord
	// TranslationUnit_Incomplete used to indicate that the translation unit is incomplete.
	//
	// When a translation unit is considered "incomplete", semantic
	// analysis that is typically performed at the end of the
	// translation unit will be suppressed. For example, this suppresses
	// the completion of tentative declarations in C and of
	// instantiation of implicitly-instantiation function templates in
	// C++. This option is typically used when parsing a header with the
	// intent of producing a precompiled header.
	TranslationUnit_Incomplete = C.CXTranslationUnit_Incomplete
	// TranslationUnit_PrecompiledPreamble used to indicate that the translation unit should be built with an
	// implicit precompiled header for the preamble.
	//
	// An implicit precompiled header is used as an optimization when a
	// particular translation unit is likely to be reparsed many times
	// when the sources aren't changing that often. In this case, an
	// implicit precompiled header will be built containing all of the
	// initial includes at the top of the main file (what we refer to as
	// the "preamble" of the file). In subsequent parses, if the
	// preamble or the files in it have not changed, \c
	// clang_reparseTranslationUnit() will re-use the implicit
	// precompiled header to improve parsing performance.
	TranslationUnit_PrecompiledPreamble = C.CXTranslationUnit_PrecompiledPreamble
	// TranslationUnit_CacheCompletionResults used to indicate that the translation unit should cache some
	// code-completion results with each reparse of the source file.
	//
	// Caching of code-completion results is a performance optimization that
	// introduces some overhead to reparsing but improves the performance of
	// code-completion operations.
	TranslationUnit_CacheCompletionResults = C.CXTranslationUnit_CacheCompletionResults
	// TranslationUnit_ForSerialization used to indicate that the translation unit will be serialized with
	// clang_saveTranslationUnit.
	//
	// This option is typically used when parsing a header with the intent of
	// producing a precompiled header.
	TranslationUnit_ForSerialization = C.CXTranslationUnit_ForSerialization
	// TranslationUnit_CXXChainedPCH dEPRECATED: Enabled chained precompiled preambles in C++.
	//
	// Note: this is a *temporary* option that is available only while
	// we are testing C++ precompiled preamble support. It is deprecated.
	TranslationUnit_CXXChainedPCH = C.CXTranslationUnit_CXXChainedPCH
	// TranslationUnit_SkipFunctionBodies used to indicate that function/method bodies should be skipped while
	// parsing.
	//
	// This option can be used to search for declarations/definitions while
	// ignoring the usages.
	TranslationUnit_SkipFunctionBodies = C.CXTranslationUnit_SkipFunctionBodies
	// TranslationUnit_IncludeBriefCommentsInCodeCompletion used to indicate that brief documentation comments should be included into the set of code completions returned from this translation unit.
	TranslationUnit_IncludeBriefCommentsInCodeCompletion = C.CXTranslationUnit_IncludeBriefCommentsInCodeCompletion
	// TranslationUnit_CreatePreambleOnFirstParse used to indicate that the precompiled preamble should be created on the first parse. Otherwise it will be created on the first reparse. This trades runtime on the first parse (serializing the preamble takes time) for reduced runtime on the second parse (can now reuse the preamble).
	TranslationUnit_CreatePreambleOnFirstParse = C.CXTranslationUnit_CreatePreambleOnFirstParse
	// TranslationUnit_KeepGoing do not stop processing when fatal errors are encountered.
	//
	// When fatal errors are encountered while parsing a translation unit,
	// semantic analysis is typically stopped early when compiling code. A common
	// source for fatal errors are unresolvable include files. For the
	// purposes of an IDE, this is undesirable behavior and as much information
	// as possible should be reported. Use this flag to enable this behavior.
	TranslationUnit_KeepGoing = C.CXTranslationUnit_KeepGoing
	// TranslationUnit_SingleFileParse sets the preprocessor in a mode for parsing a single file only.
	TranslationUnit_SingleFileParse = C.CXTranslationUnit_SingleFileParse
	// TranslationUnit_LimitSkipFunctionBodiesToPreamble used in combination with CXTranslationUnit_SkipFunctionBodies to
	// constrain the skipping of function bodies to the preamble.
	//
	// The function bodies of the main file are not skipped.
	TranslationUnit_LimitSkipFunctionBodiesToPreamble = C.CXTranslationUnit_LimitSkipFunctionBodiesToPreamble
	// TranslationUnit_IncludeAttributedTypes used to indicate that attributed types should be included in CXType.
	TranslationUnit_IncludeAttributedTypes = C.CXTranslationUnit_IncludeAttributedTypes
	// TranslationUnit_VisitImplicitAttributes used to indicate that implicit attributes should be visited.
	TranslationUnit_VisitImplicitAttributes = C.CXTranslationUnit_VisitImplicitAttributes
	// TranslationUnit_IgnoreNonErrorsFromIncludedFiles used to indicate that non-errors from included files should be ignored.
	//
	// If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from
	// included files anymore. This speeds up clang_getDiagnosticSetFromTU() for
	// the case where these warnings are not of interest, as for an IDE for
	// example, which typically shows only the diagnostics in the main file.
	TranslationUnit_IgnoreNonErrorsFromIncludedFiles = C.CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles
	// TranslationUnit_RetainExcludedConditionalBlocks tells the preprocessor not to skip excluded conditional blocks.
	TranslationUnit_RetainExcludedConditionalBlocks = C.CXTranslationUnit_RetainExcludedConditionalBlocks
)
View Source
const (
	TUResourceUsage_AST                                TUResourceUsageKind = C.CXTUResourceUsage_AST
	TUResourceUsage_Identifiers                                            = C.CXTUResourceUsage_Identifiers
	TUResourceUsage_Selectors                                              = C.CXTUResourceUsage_Selectors
	TUResourceUsage_GlobalCompletionResults                                = C.CXTUResourceUsage_GlobalCompletionResults
	TUResourceUsage_SourceManagerContentCache                              = C.CXTUResourceUsage_SourceManagerContentCache
	TUResourceUsage_AST_SideTables                                         = C.CXTUResourceUsage_AST_SideTables
	TUResourceUsage_SourceManager_Membuffer_Malloc                         = C.CXTUResourceUsage_SourceManager_Membuffer_Malloc
	TUResourceUsage_SourceManager_Membuffer_MMap                           = C.CXTUResourceUsage_SourceManager_Membuffer_MMap
	TUResourceUsage_ExternalASTSource_Membuffer_Malloc                     = C.CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc
	TUResourceUsage_ExternalASTSource_Membuffer_MMap                       = C.CXTUResourceUsage_ExternalASTSource_Membuffer_MMap
	TUResourceUsage_Preprocessor                                           = C.CXTUResourceUsage_Preprocessor
	TUResourceUsage_PreprocessingRecord                                    = C.CXTUResourceUsage_PreprocessingRecord
	TUResourceUsage_SourceManager_DataStructures                           = C.CXTUResourceUsage_SourceManager_DataStructures
	TUResourceUsage_Preprocessor_HeaderSearch                              = C.CXTUResourceUsage_Preprocessor_HeaderSearch
	TUResourceUsage_MEMORY_IN_BYTES_BEGIN                                  = C.CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN
	TUResourceUsage_MEMORY_IN_BYTES_END                                    = C.CXTUResourceUsage_MEMORY_IN_BYTES_END
	TUResourceUsage_First                                                  = C.CXTUResourceUsage_First
	TUResourceUsage_Last                                                   = C.CXTUResourceUsage_Last
)
View Source
const (
	// Type_Invalid represents an invalid type (e.g., where no type is available).
	Type_Invalid TypeKind = C.CXType_Invalid
	// Type_Unexposed a type whose specific kind is not exposed via this interface.
	Type_Unexposed = C.CXType_Unexposed
	// Type_Void a type whose specific kind is not exposed via this interface.
	Type_Void = C.CXType_Void
	// Type_Bool a type whose specific kind is not exposed via this interface.
	Type_Bool = C.CXType_Bool
	// Type_Char_U a type whose specific kind is not exposed via this interface.
	Type_Char_U = C.CXType_Char_U
	// Type_UChar a type whose specific kind is not exposed via this interface.
	Type_UChar = C.CXType_UChar
	// Type_Char16 a type whose specific kind is not exposed via this interface.
	Type_Char16 = C.CXType_Char16
	// Type_Char32 a type whose specific kind is not exposed via this interface.
	Type_Char32 = C.CXType_Char32
	// Type_UShort a type whose specific kind is not exposed via this interface.
	Type_UShort = C.CXType_UShort
	// Type_UInt a type whose specific kind is not exposed via this interface.
	Type_UInt = C.CXType_UInt
	// Type_ULong a type whose specific kind is not exposed via this interface.
	Type_ULong = C.CXType_ULong
	// Type_ULongLong a type whose specific kind is not exposed via this interface.
	Type_ULongLong = C.CXType_ULongLong
	// Type_UInt128 a type whose specific kind is not exposed via this interface.
	Type_UInt128 = C.CXType_UInt128
	// Type_Char_S a type whose specific kind is not exposed via this interface.
	Type_Char_S = C.CXType_Char_S
	// Type_SChar a type whose specific kind is not exposed via this interface.
	Type_SChar = C.CXType_SChar
	// Type_WChar a type whose specific kind is not exposed via this interface.
	Type_WChar = C.CXType_WChar
	// Type_Short a type whose specific kind is not exposed via this interface.
	Type_Short = C.CXType_Short
	// Type_Int a type whose specific kind is not exposed via this interface.
	Type_Int = C.CXType_Int
	// Type_Long a type whose specific kind is not exposed via this interface.
	Type_Long = C.CXType_Long
	// Type_LongLong a type whose specific kind is not exposed via this interface.
	Type_LongLong = C.CXType_LongLong
	// Type_Int128 a type whose specific kind is not exposed via this interface.
	Type_Int128 = C.CXType_Int128
	// Type_Float a type whose specific kind is not exposed via this interface.
	Type_Float = C.CXType_Float
	// Type_Double a type whose specific kind is not exposed via this interface.
	Type_Double = C.CXType_Double
	// Type_LongDouble a type whose specific kind is not exposed via this interface.
	Type_LongDouble = C.CXType_LongDouble
	// Type_NullPtr a type whose specific kind is not exposed via this interface.
	Type_NullPtr = C.CXType_NullPtr
	// Type_Overload a type whose specific kind is not exposed via this interface.
	Type_Overload = C.CXType_Overload
	// Type_Dependent a type whose specific kind is not exposed via this interface.
	Type_Dependent = C.CXType_Dependent
	// Type_ObjCId a type whose specific kind is not exposed via this interface.
	Type_ObjCId = C.CXType_ObjCId
	// Type_ObjCClass a type whose specific kind is not exposed via this interface.
	Type_ObjCClass = C.CXType_ObjCClass
	// Type_ObjCSel a type whose specific kind is not exposed via this interface.
	Type_ObjCSel = C.CXType_ObjCSel
	// Type_Float128 a type whose specific kind is not exposed via this interface.
	Type_Float128 = C.CXType_Float128
	// Type_Half a type whose specific kind is not exposed via this interface.
	Type_Half = C.CXType_Half
	// Type_Float16 a type whose specific kind is not exposed via this interface.
	Type_Float16 = C.CXType_Float16
	// Type_ShortAccum a type whose specific kind is not exposed via this interface.
	Type_ShortAccum = C.CXType_ShortAccum
	// Type_Accum a type whose specific kind is not exposed via this interface.
	Type_Accum = C.CXType_Accum
	// Type_LongAccum a type whose specific kind is not exposed via this interface.
	Type_LongAccum = C.CXType_LongAccum
	// Type_UShortAccum a type whose specific kind is not exposed via this interface.
	Type_UShortAccum = C.CXType_UShortAccum
	// Type_UAccum a type whose specific kind is not exposed via this interface.
	Type_UAccum = C.CXType_UAccum
	// Type_ULongAccum a type whose specific kind is not exposed via this interface.
	Type_ULongAccum = C.CXType_ULongAccum
	// Type_BFloat16 a type whose specific kind is not exposed via this interface.
	Type_BFloat16 = C.CXType_BFloat16
	// Type_Ibm128 a type whose specific kind is not exposed via this interface.
	Type_Ibm128 = C.CXType_Ibm128
	// Type_FirstBuiltin a type whose specific kind is not exposed via this interface.
	Type_FirstBuiltin = C.CXType_FirstBuiltin
	// Type_LastBuiltin a type whose specific kind is not exposed via this interface.
	Type_LastBuiltin = C.CXType_LastBuiltin
	// Type_Complex a type whose specific kind is not exposed via this interface.
	Type_Complex = C.CXType_Complex
	// Type_Pointer a type whose specific kind is not exposed via this interface.
	Type_Pointer = C.CXType_Pointer
	// Type_BlockPointer a type whose specific kind is not exposed via this interface.
	Type_BlockPointer = C.CXType_BlockPointer
	// Type_LValueReference a type whose specific kind is not exposed via this interface.
	Type_LValueReference = C.CXType_LValueReference
	// Type_RValueReference a type whose specific kind is not exposed via this interface.
	Type_RValueReference = C.CXType_RValueReference
	// Type_Record a type whose specific kind is not exposed via this interface.
	Type_Record = C.CXType_Record
	// Type_Enum a type whose specific kind is not exposed via this interface.
	Type_Enum = C.CXType_Enum
	// Type_Typedef a type whose specific kind is not exposed via this interface.
	Type_Typedef = C.CXType_Typedef
	// Type_ObjCInterface a type whose specific kind is not exposed via this interface.
	Type_ObjCInterface = C.CXType_ObjCInterface
	// Type_ObjCObjectPointer a type whose specific kind is not exposed via this interface.
	Type_ObjCObjectPointer = C.CXType_ObjCObjectPointer
	// Type_FunctionNoProto a type whose specific kind is not exposed via this interface.
	Type_FunctionNoProto = C.CXType_FunctionNoProto
	// Type_FunctionProto a type whose specific kind is not exposed via this interface.
	Type_FunctionProto = C.CXType_FunctionProto
	// Type_ConstantArray a type whose specific kind is not exposed via this interface.
	Type_ConstantArray = C.CXType_ConstantArray
	// Type_Vector a type whose specific kind is not exposed via this interface.
	Type_Vector = C.CXType_Vector
	// Type_IncompleteArray a type whose specific kind is not exposed via this interface.
	Type_IncompleteArray = C.CXType_IncompleteArray
	// Type_VariableArray a type whose specific kind is not exposed via this interface.
	Type_VariableArray = C.CXType_VariableArray
	// Type_DependentSizedArray a type whose specific kind is not exposed via this interface.
	Type_DependentSizedArray = C.CXType_DependentSizedArray
	// Type_MemberPointer a type whose specific kind is not exposed via this interface.
	Type_MemberPointer = C.CXType_MemberPointer
	// Type_Auto a type whose specific kind is not exposed via this interface.
	Type_Auto = C.CXType_Auto
	// Type_Elaborated represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_Elaborated = C.CXType_Elaborated
	// Type_Pipe represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_Pipe = C.CXType_Pipe
	// Type_OCLImage1dRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dRO = C.CXType_OCLImage1dRO
	// Type_OCLImage1dArrayRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dArrayRO = C.CXType_OCLImage1dArrayRO
	// Type_OCLImage1dBufferRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dBufferRO = C.CXType_OCLImage1dBufferRO
	// Type_OCLImage2dRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dRO = C.CXType_OCLImage2dRO
	// Type_OCLImage2dArrayRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayRO = C.CXType_OCLImage2dArrayRO
	// Type_OCLImage2dDepthRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dDepthRO = C.CXType_OCLImage2dDepthRO
	// Type_OCLImage2dArrayDepthRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayDepthRO = C.CXType_OCLImage2dArrayDepthRO
	// Type_OCLImage2dMSAARO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dMSAARO = C.CXType_OCLImage2dMSAARO
	// Type_OCLImage2dArrayMSAARO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayMSAARO = C.CXType_OCLImage2dArrayMSAARO
	// Type_OCLImage2dMSAADepthRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dMSAADepthRO = C.CXType_OCLImage2dMSAADepthRO
	// Type_OCLImage2dArrayMSAADepthRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayMSAADepthRO = C.CXType_OCLImage2dArrayMSAADepthRO
	// Type_OCLImage3dRO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage3dRO = C.CXType_OCLImage3dRO
	// Type_OCLImage1dWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dWO = C.CXType_OCLImage1dWO
	// Type_OCLImage1dArrayWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dArrayWO = C.CXType_OCLImage1dArrayWO
	// Type_OCLImage1dBufferWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dBufferWO = C.CXType_OCLImage1dBufferWO
	// Type_OCLImage2dWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dWO = C.CXType_OCLImage2dWO
	// Type_OCLImage2dArrayWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayWO = C.CXType_OCLImage2dArrayWO
	// Type_OCLImage2dDepthWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dDepthWO = C.CXType_OCLImage2dDepthWO
	// Type_OCLImage2dArrayDepthWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayDepthWO = C.CXType_OCLImage2dArrayDepthWO
	// Type_OCLImage2dMSAAWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dMSAAWO = C.CXType_OCLImage2dMSAAWO
	// Type_OCLImage2dArrayMSAAWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayMSAAWO = C.CXType_OCLImage2dArrayMSAAWO
	// Type_OCLImage2dMSAADepthWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dMSAADepthWO = C.CXType_OCLImage2dMSAADepthWO
	// Type_OCLImage2dArrayMSAADepthWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayMSAADepthWO = C.CXType_OCLImage2dArrayMSAADepthWO
	// Type_OCLImage3dWO represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage3dWO = C.CXType_OCLImage3dWO
	// Type_OCLImage1dRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dRW = C.CXType_OCLImage1dRW
	// Type_OCLImage1dArrayRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dArrayRW = C.CXType_OCLImage1dArrayRW
	// Type_OCLImage1dBufferRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage1dBufferRW = C.CXType_OCLImage1dBufferRW
	// Type_OCLImage2dRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dRW = C.CXType_OCLImage2dRW
	// Type_OCLImage2dArrayRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayRW = C.CXType_OCLImage2dArrayRW
	// Type_OCLImage2dDepthRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dDepthRW = C.CXType_OCLImage2dDepthRW
	// Type_OCLImage2dArrayDepthRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayDepthRW = C.CXType_OCLImage2dArrayDepthRW
	// Type_OCLImage2dMSAARW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dMSAARW = C.CXType_OCLImage2dMSAARW
	// Type_OCLImage2dArrayMSAARW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayMSAARW = C.CXType_OCLImage2dArrayMSAARW
	// Type_OCLImage2dMSAADepthRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dMSAADepthRW = C.CXType_OCLImage2dMSAADepthRW
	// Type_OCLImage2dArrayMSAADepthRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage2dArrayMSAADepthRW = C.CXType_OCLImage2dArrayMSAADepthRW
	// Type_OCLImage3dRW represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLImage3dRW = C.CXType_OCLImage3dRW
	// Type_OCLSampler represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLSampler = C.CXType_OCLSampler
	// Type_OCLEvent represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLEvent = C.CXType_OCLEvent
	// Type_OCLQueue represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLQueue = C.CXType_OCLQueue
	// Type_OCLReserveID represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLReserveID = C.CXType_OCLReserveID
	// Type_ObjCObject represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_ObjCObject = C.CXType_ObjCObject
	// Type_ObjCTypeParam represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_ObjCTypeParam = C.CXType_ObjCTypeParam
	// Type_Attributed represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_Attributed = C.CXType_Attributed
	// Type_OCLIntelSubgroupAVCMcePayload represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCMcePayload = C.CXType_OCLIntelSubgroupAVCMcePayload
	// Type_OCLIntelSubgroupAVCImePayload represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCImePayload = C.CXType_OCLIntelSubgroupAVCImePayload
	// Type_OCLIntelSubgroupAVCRefPayload represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCRefPayload = C.CXType_OCLIntelSubgroupAVCRefPayload
	// Type_OCLIntelSubgroupAVCSicPayload represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCSicPayload = C.CXType_OCLIntelSubgroupAVCSicPayload
	// Type_OCLIntelSubgroupAVCMceResult represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCMceResult = C.CXType_OCLIntelSubgroupAVCMceResult
	// Type_OCLIntelSubgroupAVCImeResult represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCImeResult = C.CXType_OCLIntelSubgroupAVCImeResult
	// Type_OCLIntelSubgroupAVCRefResult represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCRefResult = C.CXType_OCLIntelSubgroupAVCRefResult
	// Type_OCLIntelSubgroupAVCSicResult represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCSicResult = C.CXType_OCLIntelSubgroupAVCSicResult
	// Type_OCLIntelSubgroupAVCImeResultSingleRefStreamout represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCImeResultSingleRefStreamout = C.CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout
	// Type_OCLIntelSubgroupAVCImeResultDualRefStreamout represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCImeResultDualRefStreamout = C.CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout
	// Type_OCLIntelSubgroupAVCImeSingleRefStreamin represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCImeSingleRefStreamin = C.CXType_OCLIntelSubgroupAVCImeSingleRefStreamin
	// Type_OCLIntelSubgroupAVCImeDualRefStreamin represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_OCLIntelSubgroupAVCImeDualRefStreamin = C.CXType_OCLIntelSubgroupAVCImeDualRefStreamin
	// Type_ExtVector represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_ExtVector = C.CXType_ExtVector
	// Type_Atomic represents a type that was referred to using an elaborated type keyword.
	//
	// E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
	Type_Atomic = C.CXType_Atomic
)
View Source
const (
	// TypeLayoutError_Invalid type is of kind CXType_Invalid.
	TypeLayoutError_Invalid TypeLayoutError = C.CXTypeLayoutError_Invalid
	// TypeLayoutError_Incomplete the type is an incomplete Type.
	TypeLayoutError_Incomplete = C.CXTypeLayoutError_Incomplete
	// TypeLayoutError_Dependent the type is a dependent Type.
	TypeLayoutError_Dependent = C.CXTypeLayoutError_Dependent
	// TypeLayoutError_NotConstantSize the type is not a constant size type.
	TypeLayoutError_NotConstantSize = C.CXTypeLayoutError_NotConstantSize
	// TypeLayoutError_InvalidFieldName the Field name is not valid for this record.
	TypeLayoutError_InvalidFieldName = C.CXTypeLayoutError_InvalidFieldName
	// TypeLayoutError_Undeduced the type is undeduced.
	TypeLayoutError_Undeduced = C.CXTypeLayoutError_Undeduced
)
View Source
const (
	// TypeNullability_NonNull values of this type can never be null.
	TypeNullability_NonNull TypeNullabilityKind = C.CXTypeNullability_NonNull
	// TypeNullability_Nullable values of this type can be null.
	TypeNullability_Nullable = C.CXTypeNullability_Nullable
	// TypeNullability_Unspecified whether values of this type can be null is (explicitly) unspecified. This captures a (fairly rare) case where we can't conclude anything about the nullability of the type even though it has been considered.
	TypeNullability_Unspecified = C.CXTypeNullability_Unspecified
	// TypeNullability_Invalid nullability is not applicable to this type.
	TypeNullability_Invalid = C.CXTypeNullability_Invalid
	// TypeNullability_NullableResult generally behaves like Nullable, except when used in a block parameter that was imported into a swift async method. There, swift will assume that the parameter can get null even if no error occured. _Nullable parameters are assumed to only get null on error.
	TypeNullability_NullableResult = C.CXTypeNullability_NullableResult
)
View Source
const (
	// Visibility_Invalid this value indicates that no visibility information is available for a provided CXCursor.
	Visibility_Invalid VisibilityKind = C.CXVisibility_Invalid
	// Visibility_Hidden symbol not seen by the linker.
	Visibility_Hidden = C.CXVisibility_Hidden
	// Visibility_Protected symbol seen by the linker but resolves to a symbol inside this object.
	Visibility_Protected = C.CXVisibility_Protected
	// Visibility_Default symbol seen by the linker and acts like a normal symbol.
	Visibility_Default = C.CXVisibility_Default
)

Variables

This section is empty.

Functions

func ConstructUSR_ObjCCategory

func ConstructUSR_ObjCCategory(className string, categoryName string) string

ConstructUSR_ObjCCategory construct a USR for a specified Objective-C category.

func ConstructUSR_ObjCClass

func ConstructUSR_ObjCClass(className string) string

ConstructUSR_ObjCClass construct a USR for a specified Objective-C class.

func ConstructUSR_ObjCIvar

func ConstructUSR_ObjCIvar(name string, classUSR cxstring) string

ConstructUSR_ObjCIvar construct a USR for a specified Objective-C instance variable and the USR for its containing class.

func ConstructUSR_ObjCMethod

func ConstructUSR_ObjCMethod(name string, isInstanceMethod uint32, classUSR cxstring) string

ConstructUSR_ObjCMethod construct a USR for a specified Objective-C method and the USR for its containing class.

func ConstructUSR_ObjCProperty

func ConstructUSR_ObjCProperty(property string, classUSR cxstring) string

ConstructUSR_ObjCProperty construct a USR for a specified Objective-C property and the USR for its containing class.

func ConstructUSR_ObjCProtocol

func ConstructUSR_ObjCProtocol(protocolName string) string

ConstructUSR_ObjCProtocol construct a USR for a specified Objective-C protocol.

func DefaultCodeCompleteOptions

func DefaultCodeCompleteOptions() uint32

DefaultCodeCompleteOptions returns a default set of code-completion options that can be passed toclang_codeCompleteAt().

func DefaultDiagnosticDisplayOptions

func DefaultDiagnosticDisplayOptions() uint32

DefaultDiagnosticDisplayOptions retrieve the set of display options most similar to the default behavior of the clang compiler.

Returns A set of display options suitable for use with \c clang_formatDiagnostic().

func DefaultEditingTranslationUnitOptions

func DefaultEditingTranslationUnitOptions() uint32

DefaultEditingTranslationUnitOptions returns the set of flags that is suitable for parsing a translation unit that is being edited.

The set of flags returned provide options for clang_parseTranslationUnit() to indicate that the translation unit is likely to be reparsed many times, either explicitly (via clang_reparseTranslationUnit()) or implicitly (e.g., by code completion (clang_codeCompletionAt())). The returned flag set contains an unspecified set of optimizations (e.g., the precompiled preamble) geared toward improving the performance of these routines. The set of optimizations enabled may change from one version to the next.

func Dispose

func Dispose(overridden []Cursor)

DisposeOverriddenCursors free the set of overridden cursors returned by \c clang_getOverriddenCursors().

func EnableStackTraces

func EnableStackTraces()

func FromDirectory

func FromDirectory(buildDir string) (CompilationDatabase_Error, CompilationDatabase)

FromDirectory creates a compilation database from the database found in directory buildDir. For example, CMake can output a compile_commands.json which can be used to build the database.

It must be freed by clang_CompilationDatabase_dispose.

func GetBuildSessionTimestamp

func GetBuildSessionTimestamp() uint64

GetBuildSessionTimestamp return the timestamp for use with Clang's -fbuild-session-timestamp= option.

func GetClangVersion

func GetClangVersion() string

GetClangVersion return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable).

func GetDiagnosticCategoryName

func GetDiagnosticCategoryName(category uint32) string

GetDiagnosticCategoryName retrieve the name of a particular diagnostic category. This is now deprecated. Use clang_getDiagnosticCategoryText() instead.

Parameter Category A diagnostic category number, as returned by clang_getDiagnosticCategory().

Returns The name of the given diagnostic category.

func InstallAbortingFatalErrorHandler added in v0.10.0

func InstallAbortingFatalErrorHandler()

Install_aborting_llvm_fatal_error_handler installs error handler that prints error message to stderr and calls abort(). Replaces currently installed error handler (if any).

func LoadDiagnostics

func LoadDiagnostics(file string) (LoadDiag_Error, string, DiagnosticSet)

LoadDiagnostics deserialize a set of diagnostics from a Clang diagnostics bitcode file.

Parameter file The name of the file to deserialize. Parameter error A pointer to a enum value recording if there was a problem deserializing the diagnostics. Parameter errorString A pointer to a CXString for recording the error string if the file was not successfully loaded.

Returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These diagnostics should be released using clang_disposeDiagnosticSet().

func SortCodeCompletionResults

func SortCodeCompletionResults(results []CompletionResult)

SortCodeCompletionResults sort the code-completion results in case-insensitive alphabetical order.

Parameter Results The set of results to sort. Parameter NumResults The number of results in Results.

func ToggleCrashRecovery

func ToggleCrashRecovery(isEnabled uint32)

ToggleCrashRecovery enable/disable crash recovery.

Parameter isEnabled Flag to indicate if crash recovery is enabled. A non-zero value enables crash recovery, while 0 disables it.

func UninstallFatalErrorHandler added in v0.10.0

func UninstallFatalErrorHandler()

Uninstall_llvm_fatal_error_handler removes currently installed error handler (if any). If no error handler is intalled, the default strategy is to print error message to stderr and call exit(1).

Types

type AccessSpecifier

type AccessSpecifier uint32

AccessSpecifier represents the C++ access control level to a base class for a cursor with kind CX_CXXBaseSpecifier.

func (AccessSpecifier) Spelling

func (as AccessSpecifier) Spelling() string

func (AccessSpecifier) String

func (as AccessSpecifier) String() string

type AvailabilityKind

type AvailabilityKind uint32

AvailabilityKind describes the availability of a particular entity, which indicates whether the use of this entity will result in a warning or error due to it being deprecated or unavailable.

func (AvailabilityKind) Spelling

func (ak AvailabilityKind) Spelling() string

func (AvailabilityKind) String

func (ak AvailabilityKind) String() string

type CallingConv

type CallingConv uint32

CallingConv describes the calling convention of a function type

func (CallingConv) Spelling

func (cc CallingConv) Spelling() string

func (CallingConv) String

func (cc CallingConv) String() string

type ChildVisitResult

type ChildVisitResult uint32

ChildVisitResult describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor.

A value of this enumeration type should be returned by each CXCursorVisitor to indicate how clang_visitChildren() proceed.

func GoClangCursorVisitor

func GoClangCursorVisitor(cursor, parent C.CXCursor, cfct unsafe.Pointer) (status ChildVisitResult)

GoClangCursorVisitor calls the cursor visitor.

func (ChildVisitResult) Spelling

func (cvr ChildVisitResult) Spelling() string

func (ChildVisitResult) String

func (cvr ChildVisitResult) String() string

type ClientData

type ClientData struct {
	// contains filtered or unexported fields
}

ClientData opaque pointer representing client data that will be passed through to various callbacks and visitors.

type CodeCompleteResults

type CodeCompleteResults struct {
	// contains filtered or unexported fields
}

CodeCompleteResults contains the results of code-completion.

This data structure contains the results of code completion, as produced by clang_codeCompleteAt(). Its contents must be freed by clang_disposeCodeCompleteResults.

func (*CodeCompleteResults) CompletionFixIt added in v0.7.0

func (ccr *CodeCompleteResults) CompletionFixIt(completionIndex uint32, fixitIndex uint32) (SourceRange, string)

GetCompletionFixIt fix-its that *must* be applied before inserting the text for the corresponding completion.

By default, clang_codeCompleteAt() only returns completions with empty fix-its. Extra completions with non-empty fix-its should be explicitly requested by setting CXCodeComplete_IncludeCompletionsWithFixIts.

For the clients to be able to compute position of the cursor after applying fix-its, the following conditions are guaranteed to hold for replacement_range of the stored fix-its: - Ranges in the fix-its are guaranteed to never contain the completion point (or identifier under completion point, if any) inside them, except at the start or at the end of the range. - If a fix-it range starts or ends with completion point (or starts or ends after the identifier under completion point), it will contain at least one character. It allows to unambiguously recompute completion point after applying the fix-it.

The intuition is that provided fix-its change code around the identifier we complete, but are not allowed to touch the identifier itself or the completion point. One example of completions with corrections are the ones replacing '.' with '->' and vice versa:

std::unique_ptr<std::vector<int>> vec_ptr; In 'vec_ptr.^', one of the completions is 'push_back', it requires replacing '.' with '->'. In 'vec_ptr->^', one of the completions is 'release', it requires replacing '->' with '.'.

Parameter results The structure keeping all completion results

Parameter completion_index The index of the completion

Parameter fixit_index The index of the fix-it for the completion at completion_index

Parameter replacement_range The fix-it range that must be replaced before the completion at completion_index can be applied

Returns The fix-it string that must replace the code at replacement_range before the completion at completion_index can be applied

func (*CodeCompleteResults) CompletionNumFixIts added in v0.7.0

func (ccr *CodeCompleteResults) CompletionNumFixIts(completionIndex uint32) uint32

GetCompletionNumFixIts retrieve the number of fix-its for the given completion index.

Calling this makes sense only if CXCodeComplete_IncludeCompletionsWithFixIts option was set.

Parameter results The structure keeping all completion results

Parameter completion_index The index of the completion

Return The number of fix-its which must be applied before the completion at completion_index can be applied

func (*CodeCompleteResults) ContainerKind

func (ccr *CodeCompleteResults) ContainerKind() (uint32, CursorKind)

CodeCompleteGetContainerKind returns the cursor kind for the container for the current code completion context. The container is only guaranteed to be set for contexts where a container exists (i.e. member accesses or Objective-C message sends); if there is not a container, this function will return CXCursor_InvalidCode.

Parameter Results the code completion results to query

Parameter IsIncomplete on return, this value will be false if Clang has complete information about the container. If Clang does not have complete information, this value will be true.

Returns the container kind, or CXCursor_InvalidCode if there is not a container

func (*CodeCompleteResults) ContainerUSR

func (ccr *CodeCompleteResults) ContainerUSR() string

CodeCompleteGetContainerUSR returns the USR for the container for the current code completion context. If there is not a container for the current context, this function will return the empty string.

Parameter Results the code completion results to query

Returns the USR for the container

func (*CodeCompleteResults) Contexts

func (ccr *CodeCompleteResults) Contexts() uint64

CodeCompleteGetContexts determines what completions are appropriate for the context the given code completion.

Parameter Results the code completion results to query

Returns the kinds of completions that are appropriate for use along with the given code completion results.

func (*CodeCompleteResults) Diagnostic

func (ccr *CodeCompleteResults) Diagnostic(index uint32) Diagnostic

CodeCompleteGetDiagnostic retrieve a diagnostic associated with the given code completion.

Parameter Results the code completion results to query. Parameter Index the zero-based diagnostic number to retrieve.

Returns the requested diagnostic. This diagnostic must be freed via a call to clang_disposeDiagnostic().

func (*CodeCompleteResults) Diagnostics

func (ccr *CodeCompleteResults) Diagnostics() []Diagnostic

Diagnostics determine the number of diagnostics produced prior to the location where code completion was performed.

func (*CodeCompleteResults) Dispose

func (ccr *CodeCompleteResults) Dispose()

DisposeCodeCompleteResults free the given set of code-completion results.

func (*CodeCompleteResults) NumDiagnostics

func (ccr *CodeCompleteResults) NumDiagnostics() uint32

CodeCompleteGetNumDiagnostics determine the number of diagnostics produced prior to the location where code completion was performed.

func (CodeCompleteResults) NumResults

func (ccr CodeCompleteResults) NumResults() uint32

NumResults the number of code-completion results stored in the Results array.

func (CodeCompleteResults) Results

func (ccr CodeCompleteResults) Results() []CompletionResult

Results the code-completion results.

func (*CodeCompleteResults) Selector

func (ccr *CodeCompleteResults) Selector() string

CodeCompleteGetObjCSelector returns the currently-entered selector for an Objective-C message send, formatted like "initWithFoo:bar:". Only guaranteed to return a non-empty string for CXCompletionContext_ObjCInstanceMessage and CXCompletionContext_ObjCClassMessage.

Parameter Results the code completion results to query

Returns the selector (or partial selector) that has been entered thus far for an Objective-C message send.

type CodeComplete_Flags

type CodeComplete_Flags uint32

CodeComplete_Flags flags that can be passed to clang_codeCompleteAt() to modify its behavior.

The enumerators in this enumeration can be bitwise-OR'd together to provide multiple options to clang_codeCompleteAt().

func (CodeComplete_Flags) Spelling

func (ccf CodeComplete_Flags) Spelling() string

func (CodeComplete_Flags) String

func (ccf CodeComplete_Flags) String() string

type Comment

type Comment struct {
	// contains filtered or unexported fields
}

Comment a parsed comment.

func (Comment) BlockCommandComment_getArgText

func (c Comment) BlockCommandComment_getArgText(argIdx uint32) string

BlockCommandComment_getArgText parameter Comment a CXComment_BlockCommand AST node.

Parameter ArgIdx argument index (zero-based).

Returns text of the specified word-like argument.

func (Comment) BlockCommandComment_getCommandName

func (c Comment) BlockCommandComment_getCommandName() string

BlockCommandComment_getCommandName parameter Comment a CXComment_BlockCommand AST node.

Returns name of the block command.

func (Comment) BlockCommandComment_getNumArgs

func (c Comment) BlockCommandComment_getNumArgs() uint32

BlockCommandComment_getNumArgs parameter Comment a CXComment_BlockCommand AST node.

Returns number of word-like arguments.

func (Comment) BlockCommandComment_getParagraph

func (c Comment) BlockCommandComment_getParagraph() Comment

BlockCommandComment_getParagraph parameter Comment a CXComment_BlockCommand or CXComment_VerbatimBlockCommand AST node.

Returns paragraph argument of the block command.

func (Comment) Child

func (c Comment) Child(childIdx uint32) Comment

Child parameter Comment AST node of any kind.

Parameter ChildIdx child index (zero-based).

Returns the specified child of the AST node.

func (Comment) FullComment_getAsHTML

func (c Comment) FullComment_getAsHTML() string

FullComment_getAsHTML convert a given full parsed comment to an HTML fragment.

Specific details of HTML layout are subject to change. Don't try to parse this HTML back into an AST, use other APIs instead.

Currently the following CSS classes are used: The "para-brief" for paragraph and equivalent commands; The "para-returns" for returns paragraph and equivalent commands; The "word-returns" for the "Returns" word in returns paragraph.

Function argument documentation is rendered as a \<dl\> list with arguments sorted in function prototype order. CSS classes used: The "param-name-index-NUMBER" for parameter name (\<dt\>); The "param-descr-index-NUMBER" for parameter description (\<dd\>); The "param-name-index-invalid" and "param-descr-index-invalid" are used if parameter index is invalid.

Template parameter documentation is rendered as a \<dl\> list with parameters sorted in template parameter list order. CSS classes used: The "tparam-name-index-NUMBER" for parameter name (\<dt\>); The "tparam-descr-index-NUMBER" for parameter description (\<dd\>); The "tparam-name-index-other" and "tparam-descr-index-other" are used for names inside template template parameters; The "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if parameter position is invalid.

Parameter Comment a CXComment_FullComment AST node.

Returns string containing an HTML fragment.

func (Comment) FullComment_getAsXML

func (c Comment) FullComment_getAsXML() string

FullComment_getAsXML convert a given full parsed comment to an XML document.

A Relax NG schema for the XML can be found in comment-xml-schema.rng file inside clang source tree.

Parameter Comment a CXComment_FullComment AST node.

Returns string containing an XML document.

func (Comment) HTMLStartTagComment_IsSelfClosing

func (c Comment) HTMLStartTagComment_IsSelfClosing() bool

HTMLStartTagComment_IsSelfClosing parameter Comment a CXComment_HTMLStartTag AST node.

Returns non-zero if tag is self-closing (for example, &lt;br /&gt;).

func (Comment) HTMLStartTag_getAttrName

func (c Comment) HTMLStartTag_getAttrName(attrIdx uint32) string

HTMLStartTag_getAttrName parameter Comment a CXComment_HTMLStartTag AST node.

Parameter AttrIdx attribute index (zero-based).

Returns name of the specified attribute.

func (Comment) HTMLStartTag_getAttrValue

func (c Comment) HTMLStartTag_getAttrValue(attrIdx uint32) string

HTMLStartTag_getAttrValue parameter Comment a CXComment_HTMLStartTag AST node.

Parameter AttrIdx attribute index (zero-based).

Returns value of the specified attribute.

func (Comment) HTMLStartTag_getNumAttrs

func (c Comment) HTMLStartTag_getNumAttrs() uint32

HTMLStartTag_getNumAttrs parameter Comment a CXComment_HTMLStartTag AST node.

Returns number of attributes (name-value pairs) attached to the start tag.

func (Comment) HTMLTagComment_getAsString

func (c Comment) HTMLTagComment_getAsString() string

HTMLTagComment_getAsString convert an HTML tag AST node to string.

Parameter Comment a CXComment_HTMLStartTag or CXComment_HTMLEndTag AST node.

Returns string containing an HTML tag.

func (Comment) HTMLTagComment_getTagName

func (c Comment) HTMLTagComment_getTagName() string

HTMLTagComment_getTagName parameter Comment a CXComment_HTMLStartTag or CXComment_HTMLEndTag AST node.

Returns HTML tag name.

func (Comment) InlineCommandComment_getArgText

func (c Comment) InlineCommandComment_getArgText(argIdx uint32) string

InlineCommandComment_getArgText parameter Comment a CXComment_InlineCommand AST node.

Parameter ArgIdx argument index (zero-based).

Returns text of the specified argument.

func (Comment) InlineCommandComment_getCommandName

func (c Comment) InlineCommandComment_getCommandName() string

InlineCommandComment_getCommandName parameter Comment a CXComment_InlineCommand AST node.

Returns name of the inline command.

func (Comment) InlineCommandComment_getNumArgs

func (c Comment) InlineCommandComment_getNumArgs() uint32

InlineCommandComment_getNumArgs parameter Comment a CXComment_InlineCommand AST node.

Returns number of command arguments.

func (Comment) InlineCommandComment_getRenderKind

func (c Comment) InlineCommandComment_getRenderKind() CommentInlineCommandRenderKind

InlineCommandComment_getRenderKind parameter Comment a CXComment_InlineCommand AST node.

Returns the most appropriate rendering mode, chosen on command semantics in Doxygen.

func (Comment) InlineContentComment_HasTrailingNewline

func (c Comment) InlineContentComment_HasTrailingNewline() bool

InlineContentComment_HasTrailingNewline returns non-zero if Comment is inline content and has a newline immediately following it in the comment text. Newlines between paragraphs do not count.

func (Comment) IsWhitespace

func (c Comment) IsWhitespace() bool

IsWhitespace a CXComment_Paragraph node is considered whitespace if it contains only CXComment_Text nodes that are empty or whitespace.

Other AST nodes (except CXComment_Paragraph and CXComment_Text) are never considered whitespace.

Returns non-zero if Comment is whitespace.

func (Comment) Kind

func (c Comment) Kind() CommentKind

Kind parameter Comment AST node of any kind.

Returns the type of the AST node.

func (Comment) NumChildren

func (c Comment) NumChildren() uint32

NumChildren parameter Comment AST node of any kind.

Returns number of children of the AST node.

func (Comment) ParamCommandComment_IsDirectionExplicit

func (c Comment) ParamCommandComment_IsDirectionExplicit() bool

ParamCommandComment_IsDirectionExplicit parameter Comment a CXComment_ParamCommand AST node.

Returns non-zero if parameter passing direction was specified explicitly in the comment.

func (Comment) ParamCommandComment_IsParamIndexValid

func (c Comment) ParamCommandComment_IsParamIndexValid() bool

ParamCommandComment_IsParamIndexValid parameter Comment a CXComment_ParamCommand AST node.

Returns non-zero if the parameter that this AST node represents was found in the function prototype and clang_ParamCommandComment_getParamIndex function will return a meaningful value.

func (Comment) ParamCommandComment_getDirection

func (c Comment) ParamCommandComment_getDirection() CommentParamPassDirection

ParamCommandComment_getDirection parameter Comment a CXComment_ParamCommand AST node.

Returns parameter passing direction.

func (Comment) ParamCommandComment_getParamIndex

func (c Comment) ParamCommandComment_getParamIndex() uint32

ParamCommandComment_getParamIndex parameter Comment a CXComment_ParamCommand AST node.

Returns zero-based parameter index in function prototype.

func (Comment) ParamCommandComment_getParamName

func (c Comment) ParamCommandComment_getParamName() string

ParamCommandComment_getParamName parameter Comment a CXComment_ParamCommand AST node.

Returns parameter name.

func (Comment) TParamCommandComment_IsParamPositionValid

func (c Comment) TParamCommandComment_IsParamPositionValid() bool

TParamCommandComment_IsParamPositionValid parameter Comment a CXComment_TParamCommand AST node.

Returns non-zero if the parameter that this AST node represents was found in the template parameter list and clang_TParamCommandComment_getDepth and clang_TParamCommandComment_getIndex functions will return a meaningful value.

func (Comment) TParamCommandComment_getDepth

func (c Comment) TParamCommandComment_getDepth() uint32

TParamCommandComment_getDepth parameter Comment a CXComment_TParamCommand AST node.

Returns zero-based nesting depth of this parameter in the template parameter list.

For example,

template<typename C, template<typename T> class TT>
void test(TT<int> aaa);

for C and TT nesting depth is 0, for T nesting depth is 1.

func (Comment) TParamCommandComment_getIndex

func (c Comment) TParamCommandComment_getIndex(depth uint32) uint32

TParamCommandComment_getIndex parameter Comment a CXComment_TParamCommand AST node.

Returns zero-based parameter index in the template parameter list at a given nesting depth.

For example,

template<typename C, template<typename T> class TT>
void test(TT<int> aaa);

for C and TT nesting depth is 0, so we can ask for index at depth 0: at depth 0 C's index is 0, TT's index is 1.

For T nesting depth is 1, so we can ask for index at depth 0 and 1: at depth 0 T's index is 1 (same as TT's), at depth 1 T's index is 0.

func (Comment) TParamCommandComment_getParamName

func (c Comment) TParamCommandComment_getParamName() string

TParamCommandComment_getParamName parameter Comment a CXComment_TParamCommand AST node.

Returns template parameter name.

func (Comment) TextComment_getText

func (c Comment) TextComment_getText() string

TextComment_getText parameter Comment a CXComment_Text AST node.

Returns text contained in the AST node.

func (Comment) TranslationUnit

func (c Comment) TranslationUnit() TranslationUnit

func (Comment) VerbatimBlockLineComment_getText

func (c Comment) VerbatimBlockLineComment_getText() string

VerbatimBlockLineComment_getText parameter Comment a CXComment_VerbatimBlockLine AST node.

Returns text contained in the AST node.

func (Comment) VerbatimLineComment_getText

func (c Comment) VerbatimLineComment_getText() string

VerbatimLineComment_getText parameter Comment a CXComment_VerbatimLine AST node.

Returns text contained in the AST node.

type CommentInlineCommandRenderKind

type CommentInlineCommandRenderKind uint32

CommentInlineCommandRenderKind the most appropriate rendering mode for an inline command, chosen on command semantics in Doxygen.

func (CommentInlineCommandRenderKind) Spelling

func (cicrk CommentInlineCommandRenderKind) Spelling() string

func (CommentInlineCommandRenderKind) String

func (cicrk CommentInlineCommandRenderKind) String() string

type CommentKind

type CommentKind uint32

CommentKind describes the type of the comment AST node (CXComment). A comment node can be considered block content (e. g., paragraph), inline content (plain text) or neither (the root AST node).

func (CommentKind) Spelling

func (ck CommentKind) Spelling() string

func (CommentKind) String

func (ck CommentKind) String() string

type CommentParamPassDirection

type CommentParamPassDirection uint32

CommentParamPassDirection describes parameter passing direction for parameter or arg command.

func (CommentParamPassDirection) Spelling

func (cppd CommentParamPassDirection) Spelling() string

func (CommentParamPassDirection) String

func (cppd CommentParamPassDirection) String() string

type CompilationDatabase

type CompilationDatabase struct {
	// contains filtered or unexported fields
}

CompilationDatabase a compilation database holds all information used to compile files in a project. For each file in the database, it can be queried for the working directory or the command line used for the compiler invocation.

Must be freed by clang_CompilationDatabase_dispose

func (CompilationDatabase) AllCompileCommands

func (cd CompilationDatabase) AllCompileCommands() CompileCommands

AllCompileCommands get all the compile commands in the given compilation database.

func (CompilationDatabase) CompileCommands

func (cd CompilationDatabase) CompileCommands(completeFileName string) CompileCommands

CompileCommands find the compile commands used for a file. The compile commands must be freed by clang_CompileCommands_dispose.

func (CompilationDatabase) Dispose

func (cd CompilationDatabase) Dispose()

Dispose free the given compilation database

type CompilationDatabase_Error

type CompilationDatabase_Error int32

CompilationDatabase_Error error codes for Compilation Database

const (
	CompilationDatabase_NoError            CompilationDatabase_Error = C.CXCompilationDatabase_NoError
	CompilationDatabase_CanNotLoadDatabase                           = C.CXCompilationDatabase_CanNotLoadDatabase
)

func (CompilationDatabase_Error) Error

func (cde CompilationDatabase_Error) Error() string

func (CompilationDatabase_Error) Spelling

func (cde CompilationDatabase_Error) Spelling() string

func (CompilationDatabase_Error) String

func (cde CompilationDatabase_Error) String() string

type CompileCommand

type CompileCommand struct {
	// contains filtered or unexported fields
}

CompileCommand represents the command line invocation to compile a specific file.

func (CompileCommand) Arg

func (cc CompileCommand) Arg(i uint32) string

Arg get the I'th argument value in the compiler invocations

Invariant : - argument 0 is the compiler executable

func (CompileCommand) Directory

func (cc CompileCommand) Directory() string

Directory get the working directory where the CompileCommand was executed from

func (CompileCommand) Filename

func (cc CompileCommand) Filename() string

Filename get the filename associated with the CompileCommand.

func (CompileCommand) NumArgs

func (cc CompileCommand) NumArgs() uint32

NumArgs get the number of arguments in the compiler invocation.

type CompileCommands

type CompileCommands struct {
	// contains filtered or unexported fields
}

CompileCommands contains the results of a search in the compilation database

When searching for the compile command for a file, the compilation db can return several commands, as the file may have been compiled with different options in different places of the project. This choice of compile commands is wrapped in this opaque data structure. It must be freed by clang_CompileCommands_dispose.

func (CompileCommands) Command

func (cc CompileCommands) Command(i uint32) CompileCommand

Command get the I'th CompileCommand for a file

NOTE: 0 <= i < clang_CompileCommands_getSize(CXCompileCommands)

func (CompileCommands) Dispose

func (cc CompileCommands) Dispose()

Dispose free the given CompileCommands

func (CompileCommands) Size

func (cc CompileCommands) Size() uint32

Size get the number of CompileCommand we have for a file

type CompletionChunkKind

type CompletionChunkKind uint32

CompletionChunkKind describes a single piece of text within a code-completion string.

Each "chunk" within a code-completion string (CXCompletionString) is either a piece of text with a specific "kind" that describes how that text should be interpreted by the client or is another completion string.

func (CompletionChunkKind) Spelling

func (cck CompletionChunkKind) Spelling() string

func (CompletionChunkKind) String

func (cck CompletionChunkKind) String() string

type CompletionContext

type CompletionContext uint32

CompletionContext bits that represent the context under which completion is occurring.

The enumerators in this enumeration may be bitwise-OR'd together if multiple contexts are occurring simultaneously.

func (CompletionContext) Spelling

func (cc CompletionContext) Spelling() string

func (CompletionContext) String

func (cc CompletionContext) String() string

type CompletionResult

type CompletionResult struct {
	// contains filtered or unexported fields
}

CompletionResult a single result of code completion.

func (CompletionResult) CompletionString

func (cr CompletionResult) CompletionString() CompletionString

CompletionString the code-completion string that describes how to insert this code-completion result into the editing buffer.

func (CompletionResult) CursorKind

func (cr CompletionResult) CursorKind() CursorKind

CursorKind the kind of entity that this completion refers to.

The cursor kind will be a macro, keyword, or a declaration (one of the *Decl cursor kinds), describing the entity that the completion is referring to.

TODO: In the future, we would like to provide a full cursor, to allow the client to extract additional information from declaration.

type CompletionString

type CompletionString struct {
	// contains filtered or unexported fields
}

CompletionString a semantic string that describes a code-completion result.

A semantic string that describes the formatting of a code-completion result as a single "template" of text that should be inserted into the source buffer when a particular code-completion result is selected. Each semantic string is made up of some number of "chunks", each of which contains some text along with a description of what that text means, e.g., the name of the entity being referenced, whether the text chunk is part of the template, or whether it is a "placeholder" that the user should replace with actual code,of a specific kind. See CXCompletionChunkKind for a description of the different kinds of chunks.

func (CompletionString) Annotation

func (cs CompletionString) Annotation(annotationNumber uint32) string

GetCompletionAnnotation retrieve the annotation associated with the given completion string.

Parameter completion_string the completion string to query.

Parameter annotation_number the 0-based index of the annotation of the completion string.

Returns annotation string associated with the completion at index annotation_number, or a NULL string if that annotation is not available.

func (CompletionString) Availability

func (cs CompletionString) Availability() AvailabilityKind

GetCompletionAvailability determine the availability of the entity that this code-completion string refers to.

Parameter completion_string The completion string to query.

Returns The availability of the completion string.

func (CompletionString) BriefComment

func (cs CompletionString) BriefComment() string

GetCompletionBriefComment retrieve the brief documentation comment attached to the declaration that corresponds to the given completion string.

func (CompletionString) ChunkCompletionString

func (cs CompletionString) ChunkCompletionString(chunkNumber uint32) CompletionString

GetCompletionChunkCompletionString retrieve the completion string associated with a particular chunk within a completion string.

Parameter completion_string the completion string to query.

Parameter chunk_number the 0-based index of the chunk in the completion string.

Returns the completion string associated with the chunk at index chunk_number.

func (CompletionString) ChunkKind

func (cs CompletionString) ChunkKind(chunkNumber uint32) CompletionChunkKind

GetCompletionChunkKind determine the kind of a particular chunk within a completion string.

Parameter completion_string the completion string to query.

Parameter chunk_number the 0-based index of the chunk in the completion string.

Returns the kind of the chunk at the index chunk_number.

func (CompletionString) ChunkText

func (cs CompletionString) ChunkText(chunkNumber uint32) string

GetCompletionChunkText retrieve the text associated with a particular chunk within a completion string.

Parameter completion_string the completion string to query.

Parameter chunk_number the 0-based index of the chunk in the completion string.

Returns the text associated with the chunk at index chunk_number.

func (CompletionString) NumAnnotations

func (cs CompletionString) NumAnnotations() uint32

GetCompletionNumAnnotations retrieve the number of annotations associated with the given completion string.

Parameter completion_string the completion string to query.

Returns the number of annotations associated with the given completion string.

func (CompletionString) NumChunks

func (cs CompletionString) NumChunks() uint32

GetNumCompletionChunks retrieve the number of chunks in the given code-completion string.

func (CompletionString) Parent

func (cs CompletionString) Parent(kind *CursorKind) string

GetCompletionParent retrieve the parent context of the given completion string.

The parent context of a completion string is the semantic parent of the declaration (if any) that the code completion represents. For example, a code completion for an Objective-C method would have the method's class or protocol as its context.

Parameter completion_string The code completion string whose parent is being queried.

Parameter kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL.

Returns The name of the completion parent, e.g., "NSObject" if the completion string represents a method in the NSObject class.

func (CompletionString) Priority

func (cs CompletionString) Priority() uint32

GetCompletionPriority determine the priority of this code completion.

The priority of a code completion indicates how likely it is that this particular completion is the completion that the user will select. The priority is selected by various internal heuristics.

Parameter completion_string The completion string to query.

Returns The priority of this completion string. Smaller values indicate higher-priority (more likely) completions.

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

Cursor a cursor representing some element in the abstract syntax tree for a translation unit.

The cursor abstraction unifies the different kinds of entities in a program--declaration, statements, expressions, references to declarations, etc.--under a single "cursor" abstraction with a common set of operations. Common operation for a cursor include: getting the physical location in a source file where the cursor points, getting the name associated with a cursor, and retrieving cursors for any child nodes of a particular cursor.

Cursors can be produced in two specific ways. clang_getTranslationUnitCursor() produces a cursor for a translation unit, from which one can use clang_visitChildren() to explore the rest of the translation unit. clang_getCursor() maps from a physical source location to the entity that resides at that location, allowing one to map from the source code into the AST.

func NewNullCursor

func NewNullCursor() Cursor

GetNullCursor retrieve the NULL cursor, which represents no entity.

func (Cursor) AccessSpecifier

func (c Cursor) AccessSpecifier() AccessSpecifier

GetCXXAccessSpecifier returns the access control level for the referenced object.

If the cursor refers to a C++ declaration, its access control level within its parent scope is returned. Otherwise, if the cursor refers to a base specifier or access specifier, the specifier itself is returned.

func (Cursor) Argument

func (c Cursor) Argument(i uint32) Cursor

Argument retrieve the argument cursor of a function or method.

The argument cursor can be determined for calls as well as for declarations of functions or methods. For other cursors and for invalid indices, an invalid cursor is returned.

func (Cursor) Availability

func (c Cursor) Availability() AvailabilityKind

GetCursorAvailability determine the availability of the entity that this cursor refers to, taking the current target platform into account.

Parameter cursor The cursor to query.

Returns The availability of the cursor.

func (Cursor) BriefCommentText

func (c Cursor) BriefCommentText() string

BriefCommentText given a cursor that represents a documentable entity (e.g., declaration), return the associated \paragraph; otherwise return the first paragraph.

func (Cursor) CXXConstructor_IsConvertingConstructor

func (c Cursor) CXXConstructor_IsConvertingConstructor() bool

CXXConstructor_IsConvertingConstructor determine if a C++ constructor is a converting constructor.

func (Cursor) CXXConstructor_IsCopyConstructor

func (c Cursor) CXXConstructor_IsCopyConstructor() bool

CXXConstructor_IsCopyConstructor determine if a C++ constructor is a copy constructor.

func (Cursor) CXXConstructor_IsDefaultConstructor

func (c Cursor) CXXConstructor_IsDefaultConstructor() bool

CXXConstructor_IsDefaultConstructor determine if a C++ constructor is the default constructor.

func (Cursor) CXXConstructor_IsMoveConstructor

func (c Cursor) CXXConstructor_IsMoveConstructor() bool

CXXConstructor_IsMoveConstructor determine if a C++ constructor is a move constructor.

func (Cursor) CXXField_IsMutable

func (c Cursor) CXXField_IsMutable() bool

CXXField_IsMutable determine if a C++ field is declared 'mutable'.

func (Cursor) CXXManglings added in v0.6.0

func (c Cursor) CXXManglings() *StringSet

CXXManglings retrieve the CXStrings representing the mangled symbols of the C++ constructor or destructor at the cursor.

func (Cursor) CXXMethod_IsConst

func (c Cursor) CXXMethod_IsConst() bool

CXXMethod_IsConst determine if a C++ member function or member function template is declared 'const'.

func (Cursor) CXXMethod_IsDefaulted

func (c Cursor) CXXMethod_IsDefaulted() bool

CXXMethod_IsDefaulted determine if a C++ method is declared '= default'.

func (Cursor) CXXMethod_IsPureVirtual

func (c Cursor) CXXMethod_IsPureVirtual() bool

CXXMethod_IsPureVirtual determine if a C++ member function or member function template is pure virtual.

func (Cursor) CXXMethod_IsStatic

func (c Cursor) CXXMethod_IsStatic() bool

CXXMethod_IsStatic determine if a C++ member function or member function template is declared 'static'.

func (Cursor) CXXMethod_IsVirtual

func (c Cursor) CXXMethod_IsVirtual() bool

CXXMethod_IsVirtual determine if a C++ member function or member function template is explicitly declared 'virtual' or if it overrides a virtual method from one of the base classes.

func (Cursor) CXXRecord_IsAbstract added in v0.6.0

func (c Cursor) CXXRecord_IsAbstract() bool

CXXRecord_IsAbstract determine if a C++ record is abstract, i.e. whether a class or struct has a pure virtual member function.

func (Cursor) CanonicalCursor

func (c Cursor) CanonicalCursor() Cursor

GetCanonicalCursor retrieve the canonical cursor corresponding to the given cursor.

In the C family of languages, many kinds of entities can be declared several times within a single translation unit. For example, a structure type can be forward-declared (possibly multiple times) and later defined:

struct X;
struct X;
struct X {
int member;
};

The declarations and the definition of X are represented by three different cursors, all of which are declarations of the same underlying entity. One of these cursor is considered the "canonical" cursor, which is effectively the representative for the underlying entity. One can determine if two cursors are declarations of the same underlying entity by comparing their canonical cursors.

Returns The canonical cursor for the entity referred to by the given cursor.

func (Cursor) CommentRange

func (c Cursor) CommentRange() SourceRange

CommentRange given a cursor that represents a declaration, return the associated comment's source range. The range may include multiple consecutive comments with whitespace in between.

func (Cursor) CompletionString

func (c Cursor) CompletionString() CompletionString

GetCursorCompletionString retrieve a completion string for an arbitrary declaration or macro definition cursor.

Parameter cursor The cursor to query.

Returns A non-context-sensitive completion string for declaration and macro definition cursors, or NULL for other kinds of cursors.

func (Cursor) DeclObjCTypeEncoding

func (c Cursor) DeclObjCTypeEncoding() string

GetDeclObjCTypeEncoding returns the Objective-C type encoding for the specified declaration.

func (Cursor) DeclQualifiers

func (c Cursor) DeclQualifiers() uint32

DeclQualifiers given a cursor that represents an Objective-C method or parameter declaration, return the associated Objective-C qualifiers for the return type or the parameter respectively. The bits are formed from CXObjCDeclQualifierKind.

func (Cursor) Definition

func (c Cursor) Definition() Cursor

GetCursorDefinition for a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that describes the definition of that entity.

Some entities can be declared multiple times within a translation unit, but only one of those declarations can also be a definition. For example, given:

int f(int, int);
int g(int x, int y) { return f(x, y); }
int f(int a, int b) { return a + b; }
int f(int, int);

there are three declarations of the function "f", but only the second one is a definition. The GetCursorDefinition() function will take any cursor pointing to a declaration of "f" (the first or fourth lines of the example) or a cursor referenced that uses "f" (the call to "f' inside "g") and will return a declaration cursor pointing to the definition (the second "f" declaration).

If given a cursor for which there is no corresponding definition, e.g., because there is no definition of that entity within this translation unit, returns a NULL cursor.

func (Cursor) DefinitionSpellingAndExtent

func (c Cursor) DefinitionSpellingAndExtent() (string, string, uint32, uint32, uint32, uint32)

func (Cursor) DisplayName

func (c Cursor) DisplayName() string

GetCursorDisplayName retrieve the display name for the entity referenced by this cursor.

The display name contains extra information that helps identify the cursor, such as the parameters of a function or template or the arguments of a class template specialization.

func (Cursor) EnumConstantDeclUnsignedValue

func (c Cursor) EnumConstantDeclUnsignedValue() uint64

GetEnumConstantDeclUnsignedValue retrieve the integer value of an enum constant declaration as an unsigned long long.

If the cursor does not reference an enum constant declaration, ULLONG_MAX is returned. Since this is also potentially a valid constant value, the kind of the cursor must be verified before calling this function.

func (Cursor) EnumConstantDeclValue

func (c Cursor) EnumConstantDeclValue() int64

GetEnumConstantDeclValue retrieve the integer value of an enum constant declaration as a signed long long.

If the cursor does not reference an enum constant declaration, LLONG_MIN is returned. Since this is also potentially a valid constant value, the kind of the cursor must be verified before calling this function.

func (Cursor) EnumDeclIntegerType

func (c Cursor) EnumDeclIntegerType() Type

GetEnumDeclIntegerType retrieve the integer type of an enum declaration.

If the cursor does not reference an enum declaration, an invalid type is returned.

func (Cursor) EnumDecl_IsScoped added in v0.5.0

func (c Cursor) EnumDecl_IsScoped() bool

EnumDecl_IsScoped determine if an enum declaration refers to a scoped enum.

func (Cursor) Equal

func (c Cursor) Equal(c2 Cursor) bool

EqualCursors determine whether two cursors are equivalent.

func (Cursor) Evaluate

func (c Cursor) Evaluate() EvalResult

Evaluate if cursor is a statement declaration tries to evaluate the statement and if its variable, tries to evaluate its initializer, into its corresponding type. If it's an expression, tries to evaluate the expression.

func (Cursor) ExceptionSpecificationType added in v0.5.0

func (c Cursor) ExceptionSpecificationType() int32

GetCursorExceptionSpecificationType retrieve the exception specification type associated with a given cursor. This is a value of type CXCursor_ExceptionSpecificationKind.

This only returns a valid result if the cursor refers to a function or method.

func (Cursor) Extent

func (c Cursor) Extent() SourceRange

GetCursorExtent retrieve the physical extent of the source construct referenced by the given cursor.

The extent of a cursor starts with the file/line/column pointing at the first character within the source construct that the cursor refers to and ends with the last character within that source construct. For a declaration, the extent covers the declaration itself. For a reference, the extent covers the location of the reference (e.g., where the referenced entity was actually used).

func (Cursor) FieldDeclBitWidth

func (c Cursor) FieldDeclBitWidth() int32

GetFieldDeclBitWidth retrieve the bit width of a bit field declaration as an integer.

If a cursor that is not a bit field declaration is passed in, -1 is returned.

func (Cursor) FindReferencesInFile

func (c Cursor) FindReferencesInFile(file File, visitor CursorAndRangeVisitor) Result

FindReferencesInFile find references of a declaration in a specific file.

Parameter cursor pointing to a declaration or a reference of one.

Parameter file to search for references.

Parameter visitor callback that will receive pairs of CXCursor/CXSourceRange for each reference found. The CXSourceRange will point inside the file; if the reference is inside a macro (and not a macro argument) the CXSourceRange will be invalid.

Returns one of the CXResult enumerators.

func (Cursor) HasAttrs

func (c Cursor) HasAttrs() bool

HasAttrs determine whether the given cursor has any attributes.

func (Cursor) HasVarDeclExternalStorage added in v0.12.0

func (c Cursor) HasVarDeclExternalStorage() bool

HasVarDeclExternalStorage if cursor refers to a variable declaration that has external storage returns 1. If cursor refers to a variable declaration that doesn't have external storage returns 0. Otherwise returns -1.

func (Cursor) HasVarDeclGlobalStorage added in v0.12.0

func (c Cursor) HasVarDeclGlobalStorage() bool

HasVarDeclGlobalStorage if cursor refers to a variable declaration that has global storage returns 1. If cursor refers to a variable declaration that doesn't have global storage returns 0. Otherwise returns -1.

func (Cursor) HashCursor

func (c Cursor) HashCursor() uint32

HashCursor compute a hash value for the given cursor.

func (Cursor) IBOutletCollectionType

func (c Cursor) IBOutletCollectionType() Type

GetIBOutletCollectionType for cursors representing an iboutletcollection attribute, this function returns the collection element type.

func (Cursor) IncludedFile

func (c Cursor) IncludedFile() File

GetIncludedFile retrieve the file that is included by the given inclusion directive cursor.

func (Cursor) IsAnonymous

func (c Cursor) IsAnonymous() bool

IsAnonymous determine whether the given cursor represents an anonymous tag or namespace

func (Cursor) IsAnonymousRecordDecl added in v0.9.0

func (c Cursor) IsAnonymousRecordDecl() bool

IsAnonymousRecordDecl determine whether the given cursor represents an anonymous record declaration.

func (Cursor) IsBitField

func (c Cursor) IsBitField() bool

IsBitField returns non-zero if the cursor specifies a Record member that is a bitfield.

func (Cursor) IsCursorDefinition

func (c Cursor) IsCursorDefinition() bool

IsCursorDefinition determine whether the declaration pointed to by this cursor is also a definition of that entity.

func (Cursor) IsDynamicCall

func (c Cursor) IsDynamicCall() bool

IsDynamicCall given a cursor pointing to a C++ method call or an Objective-C message, returns non-zero if the method/message is "dynamic", meaning:

For a C++ method: the call is virtual. For an Objective-C message: the receiver is an object instance, not 'super' or a specific class.

If the method/message is "static" or the cursor does not point to a method/message, it will return zero.

func (Cursor) IsExternalSymbol added in v0.5.0

func (c Cursor) IsExternalSymbol() (string, string, uint32, bool)

IsExternalSymbol returns non-zero if the given cursor points to a symbol marked with external_source_symbol attribute.

Parameter language If non-NULL, and the attribute is present, will be set to the 'language' string from the attribute.

Parameter definedIn If non-NULL, and the attribute is present, will be set to the 'definedIn' string from the attribute.

Parameter isGenerated If non-NULL, and the attribute is present, will be set to non-zero if the 'generated_declaration' is set in the attribute.

func (Cursor) IsFunctionInlined

func (c Cursor) IsFunctionInlined() bool

IsFunctionInlined determine whether a CXCursor that is a function declaration, is an inline declaration.

func (Cursor) IsInlineNamespace added in v0.9.0

func (c Cursor) IsInlineNamespace() bool

IsInlineNamespace determine whether the given cursor represents an inline namespace declaration.

func (Cursor) IsInvalidDeclaration added in v0.7.0

func (c Cursor) IsInvalidDeclaration() bool

IsInvalidDeclaration determine whether the given declaration is invalid.

A declaration is invalid if it could not be parsed successfully.

Returns non-zero if the cursor represents a declaration and it is invalid, otherwise NULL.

func (Cursor) IsMacroBuiltin

func (c Cursor) IsMacroBuiltin() bool

IsMacroBuiltin determine whether a CXCursor that is a macro, is a builtin one.

func (Cursor) IsMacroFunctionLike

func (c Cursor) IsMacroFunctionLike() bool

IsMacroFunctionLike determine whether a CXCursor that is a macro, is function like.

func (Cursor) IsNull

func (c Cursor) IsNull() bool

IsNull returns non-zero if cursor is null.

func (Cursor) IsObjCOptional

func (c Cursor) IsObjCOptional() bool

IsObjCOptional given a cursor that represents an Objective-C method or property declaration, return non-zero if the declaration was affected by "\@optional". Returns zero if the cursor is not such a declaration or it is "\@required".

func (Cursor) IsVariadic

func (c Cursor) IsVariadic() bool

IsVariadic returns non-zero if the given cursor is a variadic function or method.

func (Cursor) IsVirtualBase

func (c Cursor) IsVirtualBase() bool

IsVirtualBase returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual.

func (Cursor) Kind

func (c Cursor) Kind() CursorKind

GetCursorKind retrieve the kind of the given cursor.

func (Cursor) Language

func (c Cursor) Language() LanguageKind

GetCursorLanguage determine the "language" of the entity referred to by a given cursor.

func (Cursor) LexicalParent

func (c Cursor) LexicalParent() Cursor

GetCursorLexicalParent determine the lexical parent of the given cursor.

The lexical parent of a cursor is the cursor in which the given cursor was actually written. For many declarations, the lexical and semantic parents are equivalent (the semantic parent is returned by clang_getCursorSemanticParent()). They diverge when declarations or definitions are provided out-of-line. For example:

class C {
void f();
};

void C::f() { }

In the out-of-line definition of C::f, the semantic parent is the class C, of which this function is a member. The lexical parent is the place where the declaration actually occurs in the source code; in this case, the definition occurs in the translation unit. In general, the lexical parent for a given entity can change without affecting the semantics of the program, and the lexical parent of different declarations of the same entity may be different. Changing the semantic parent of a declaration, on the other hand, can have a major impact on semantics, and redeclarations of a particular entity should all have the same semantic context.

In the example above, both declarations of C::f have C as their semantic context, while the lexical context of the first C::f is C and the lexical context of the second C::f is the translation unit.

For declarations written in the global scope, the lexical parent is the translation unit.

func (Cursor) Linkage

func (c Cursor) Linkage() LinkageKind

GetCursorLinkage determine the linkage of the entity referred to by a given cursor.

func (Cursor) Location

func (c Cursor) Location() SourceLocation

GetCursorLocation retrieve the physical location of the source constructor referenced by the given cursor.

The location of a declaration is typically the location of the name of that declaration, where the name of that declaration would occur if it is unnamed, or some keyword that introduces that particular declaration. The location of a reference is where that reference occurs within the source code.

func (Cursor) Mangling

func (c Cursor) Mangling() string

Mangling retrieve the CXString representing the mangled name of the cursor.

func (Cursor) Module

func (c Cursor) Module() Module

Module given a CXCursor_ModuleImportDecl cursor, return the associated module.

func (Cursor) NumArguments

func (c Cursor) NumArguments() int32

NumArguments retrieve the number of non-variadic arguments associated with a given cursor.

The number of arguments can be determined for calls as well as for declarations of functions or methods. For other cursors -1 is returned.

func (Cursor) NumOverloadedDecls

func (c Cursor) NumOverloadedDecls() uint32

GetNumOverloadedDecls determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.

Parameter cursor The cursor whose overloaded declarations are being queried.

Returns The number of overloaded declarations referenced by cursor. If it is not a CXCursor_OverloadedDeclRef cursor, returns 0.

func (Cursor) NumTemplateArguments

func (c Cursor) NumTemplateArguments() int32

NumTemplateArguments returns the number of template args of a function decl representing a template specialization.

If the argument cursor cannot be converted into a template function declaration, -1 is returned.

For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }

template <> void foo<float, -7, true>();

The value 3 would be returned from this call.

func (Cursor) ObjCManglings added in v0.6.0

func (c Cursor) ObjCManglings() *StringSet

ObjCManglings retrieve the CXStrings representing the mangled symbols of the ObjC class interface or implementation at the cursor.

func (Cursor) OffsetOfField

func (c Cursor) OffsetOfField() int64

OffsetOfField return the offset of the field represented by the Cursor.

If the cursor is not a field declaration, -1 is returned. If the cursor semantic parent is not a record field declaration, CXTypeLayoutError_Invalid is returned. If the field's type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the field's type declaration is a dependent type, CXTypeLayoutError_Dependent is returned. If the field's name S is not found, CXTypeLayoutError_InvalidFieldName is returned.

func (Cursor) OverloadedDecl

func (c Cursor) OverloadedDecl(index uint32) Cursor

GetOverloadedDecl retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.

Parameter cursor The cursor whose overloaded declarations are being queried.

Parameter index The zero-based index into the set of overloaded declarations in the cursor.

Returns A cursor representing the declaration referenced by the given cursor at the specified index. If the cursor does not have an associated set of overloaded declarations, or if the index is out of bounds, returns clang_getNullCursor();

func (Cursor) OverriddenCursors

func (c Cursor) OverriddenCursors() []Cursor

GetOverriddenCursors determine the set of methods that are overridden by the given method.

In both Objective-C and C++, a method (aka virtual member function, in C++) can override a virtual method in a base class. For Objective-C, a method is said to override any method in the class's base class, its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). If no such method exists, the search continues to the class's superclass, its protocols, and its categories, and so on. A method from an Objective-C implementation is considered to override the same methods as its corresponding method in the interface.

For C++, a virtual member function overrides any virtual member function with the same signature that occurs in its base classes. With multiple inheritance, a virtual member function can override several virtual member functions coming from different base classes.

In all cases, this function determines the immediate overridden method, rather than all of the overridden methods. For example, if a method is originally declared in a class A, then overridden in B (which in inherits from A) and also in C (which inherited from B), then the only overridden method returned from this function when invoked on C's method will be B's method. The client may then invoke this function again, given the previously-found overridden methods, to map out the complete method-override set.

Parameter cursor A cursor representing an Objective-C or C++ method. This routine will compute the set of methods that this method overrides.

Parameter overridden A pointer whose pointee will be replaced with a pointer to an array of cursors, representing the set of overridden methods. If there are no overridden methods, the pointee will be set to NULL. The pointee must be freed via a call to clang_disposeOverriddenCursors().

Parameter num_overridden A pointer to the number of overridden functions, will be set to the number of overridden functions in the array pointed to by overridden.

func (Cursor) ParsedComment

func (c Cursor) ParsedComment() Comment

ParsedComment given a cursor that represents a documentable entity (e.g., declaration), return the associated parsed comment as a CXComment_FullComment AST node.

func (Cursor) PlatformAvailability

func (c Cursor) PlatformAvailability(availabilitySize int) (alwaysDeprecated bool, deprecated_msg string, always_unavailable bool, unavailable_msg string, availability []PlatformAvailability)

PlatformAvailability determine the availability of the entity that this cursor refers to on any platforms for which availability information is known.

availabilitySize is the number of elements available in the availability array.

alwaysDeprecated is if non-NULL, will be set to indicate whether the entity is deprecated on all platforms. deprecatedMessage is if non-NULL, will be set to the message text provided along with the unconditional deprecation of this entity. The client is responsible for deallocating this string. alwaysUnavailable is if non-NULL, will be set to indicate whether the entity is unavailable on all platforms. unavailableMessage is if non-NULL, will be set to the message text provided along with the unconditional unavailability of this entity. The client is responsible for deallocating this string. availability is if non-NULL, an array of PlatformAvailability instances that will be populated with platform availability information, up to either the number of platforms for which availability information is available (as returned by this function) or availabilitySize, whichever is smaller.

Returns The number of platforms (N) for which availability information is available (which is unrelated to availabilitySize). Note that the client is responsible for calling Dispose to free each of the PlatformAvailability structures returned. There are min(N, availabilitySize) such structures.

func (Cursor) PrettyPrinted added in v0.7.0

func (c Cursor) PrettyPrinted(policy PrintingPolicy) string

GetCursorPrettyPrinted pretty print declarations.

Parameter Cursor The cursor representing a declaration.

Parameter Policy The policy to control the entities being printed. If NULL, a default policy is used.

Returns The pretty printed declaration or the empty string for other cursors.

func (Cursor) PrintingPolicy added in v0.7.0

func (c Cursor) PrintingPolicy() PrintingPolicy

GetCursorPrintingPolicy retrieve the default policy for the cursor.

The policy should be released after use with \c clang_PrintingPolicy_dispose.

func (Cursor) PropertyAttributes

func (c Cursor) PropertyAttributes(reserved uint32) uint32

PropertyAttributes given a cursor that represents a property declaration, return the associated property attributes. The bits are formed from CXObjCPropertyAttrKind.

Parameter reserved Reserved for future use, pass 0.

func (Cursor) PropertyGetterName added in v0.8.0

func (c Cursor) PropertyGetterName() string

PropertyGetterName given a cursor that represents a property declaration, return the name of the method that implements the getter.

func (Cursor) PropertySetterName added in v0.8.0

func (c Cursor) PropertySetterName() string

PropertySetterName given a cursor that represents a property declaration, return the name of the method that implements the setter, if any.

func (Cursor) RawCommentText

func (c Cursor) RawCommentText() string

RawCommentText given a cursor that represents a declaration, return the associated comment text, including comment markers.

func (Cursor) ReceiverType

func (c Cursor) ReceiverType() Type

ReceiverType given a cursor pointing to an Objective-C message or property reference, or C++ method call, returns the CXType of the receiver.

func (Cursor) ReferenceNameRange

func (c Cursor) ReferenceNameRange(nameFlags uint32, pieceIndex uint32) SourceRange

GetCursorReferenceNameRange given a cursor that references something else, return the source range covering that reference.

Parameter C A cursor pointing to a member reference, a declaration reference, or an operator call. Parameter NameFlags A bitset with three independent flags: CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and CXNameRange_WantSinglePiece. Parameter PieceIndex For contiguous names or when passing the flag CXNameRange_WantSinglePiece, only one piece with index 0 is available. When the CXNameRange_WantSinglePiece flag is not passed for a non-contiguous names, this index can be used to retrieve the individual pieces of the name. See also CXNameRange_WantSinglePiece.

Returns The piece of the name pointed to by the given cursor. If there is no name, or if the PieceIndex is out-of-range, a null-cursor will be returned.

func (Cursor) Referenced

func (c Cursor) Referenced() Cursor

GetCursorReferenced for a cursor that is a reference, retrieve a cursor representing the entity that it references.

Reference cursors refer to other entities in the AST. For example, an Objective-C superclass reference cursor refers to an Objective-C class. This function produces the cursor for the Objective-C class from the cursor for the superclass reference. If the input cursor is a declaration or definition, it returns that declaration or definition unchanged. Otherwise, returns the NULL cursor.

func (Cursor) ResultType

func (c Cursor) ResultType() Type

GetCursorResultType retrieve the return type associated with a given cursor.

This only returns a valid type if the cursor refers to a function or method.

func (Cursor) SelectorIndex

func (c Cursor) SelectorIndex() int32

SelectorIndex if the cursor points to a selector identifier in an Objective-C method or message expression, this returns the selector index.

After getting a cursor with #clang_getCursor, this can be called to determine if the location points to a selector identifier.

Returns The selector index if the cursor is an Objective-C method or message expression and the cursor is pointing to a selector identifier, or -1 otherwise.

func (Cursor) SemanticParent

func (c Cursor) SemanticParent() Cursor

GetCursorSemanticParent determine the semantic parent of the given cursor.

The semantic parent of a cursor is the cursor that semantically contains the given cursor. For many declarations, the lexical and semantic parents are equivalent (the lexical parent is returned by clang_getCursorLexicalParent()). They diverge when declarations or definitions are provided out-of-line. For example:

class C {
void f();
};

void C::f() { }

In the out-of-line definition of C::f, the semantic parent is the class C, of which this function is a member. The lexical parent is the place where the declaration actually occurs in the source code; in this case, the definition occurs in the translation unit. In general, the lexical parent for a given entity can change without affecting the semantics of the program, and the lexical parent of different declarations of the same entity may be different. Changing the semantic parent of a declaration, on the other hand, can have a major impact on semantics, and redeclarations of a particular entity should all have the same semantic context.

In the example above, both declarations of C::f have C as their semantic context, while the lexical context of the first C::f is C and the lexical context of the second C::f is the translation unit.

For global declarations, the semantic parent is the translation unit.

func (Cursor) SpecializedCursorTemplate

func (c Cursor) SpecializedCursorTemplate() Cursor

GetSpecializedCursorTemplate given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated.

This routine determines the template involved both for explicit specializations of templates and for implicit instantiations of the template, both of which are referred to as "specializations". For a class template specialization (e.g., std::vector<bool>), this routine will return either the primary template (std::vector) or, if the specialization was instantiated from a class template partial specialization, the class template partial specialization. For a class template partial specialization and a function template specialization (including instantiations), this this routine will return the specialized template.

For members of a class template (e.g., member functions, member classes, or static data members), returns the specialized or instantiated member. Although not strictly "templates" in the C++ language, members of class templates have the same notions of specializations and instantiations that templates do, so this routine treats them similarly.

Parameter C A cursor that may be a specialization of a template or a member of a template.

Returns If the given cursor is a specialization or instantiation of a template or a member thereof, the template or member that it specializes or from which it was instantiated. Otherwise, returns a NULL cursor.

func (Cursor) Spelling

func (c Cursor) Spelling() string

GetCursorSpelling retrieve a name for the entity referenced by this cursor.

func (Cursor) SpellingNameRange

func (c Cursor) SpellingNameRange(pieceIndex uint32, options uint32) SourceRange

SpellingNameRange retrieve a range for a piece that forms the cursors spelling name. Most of the times there is only one range for the complete spelling but for Objective-C methods and Objective-C message expressions, there are multiple pieces for each selector identifier.

Parameter pieceIndex the index of the spelling name piece. If this is greater than the actual number of pieces, it will return a NULL (invalid) range.

Parameter options Reserved.

func (Cursor) StorageClass

func (c Cursor) StorageClass() StorageClass

StorageClass returns the storage class for a function or variable declaration.

If the passed in Cursor is not a function or variable declaration, CX_SC_Invalid is returned else the storage class.

func (Cursor) TLSKind added in v0.6.0

func (c Cursor) TLSKind() TLSKind

GetCursorTLSKind determine the "thread-local storage (TLS) kind" of the declaration referred to by a cursor.

func (Cursor) TemplateArgumentKind

func (c Cursor) TemplateArgumentKind(i uint32) TemplateArgumentKind

TemplateArgumentKind retrieve the kind of the I'th template argument of the CXCursor C.

If the argument CXCursor does not represent a FunctionDecl, an invalid template argument kind is returned.

For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }

template <> void foo<float, -7, true>();

For I = 0, 1, and 2, Type, Integral, and Integral will be returned, respectively.

func (Cursor) TemplateArgumentType

func (c Cursor) TemplateArgumentType(i uint32) Type

TemplateArgumentType retrieve a CXType representing the type of a TemplateArgument of a function decl representing a template specialization.

If the argument CXCursor does not represent a FunctionDecl whose I'th template argument has a kind of CXTemplateArgKind_Integral, an invalid type is returned.

For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }

template <> void foo<float, -7, true>();

If called with I = 0, "float", will be returned. Invalid types will be returned for I == 1 or 2.

func (Cursor) TemplateArgumentUnsignedValue

func (c Cursor) TemplateArgumentUnsignedValue(i uint32) uint64

TemplateArgumentUnsignedValue retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as an unsigned long long.

It is undefined to call this function on a CXCursor that does not represent a FunctionDecl or whose I'th template argument is not an integral value.

For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }

template <> void foo<float, 2147483649, true>();

If called with I = 1 or 2, 2147483649 or true will be returned, respectively. For I == 0, this function's behavior is undefined.

func (Cursor) TemplateArgumentValue

func (c Cursor) TemplateArgumentValue(i uint32) int64

TemplateArgumentValue retrieve the value of an Integral TemplateArgument (of a function decl representing a template specialization) as a signed long long.

It is undefined to call this function on a CXCursor that does not represent a FunctionDecl or whose I'th template argument is not an integral value.

For example, for the following declaration and specialization: template <typename T, int kInt, bool kBool> void foo() { ... }

template <> void foo<float, -7, true>();

If called with I = 1 or 2, -7 or true will be returned, respectively. For I == 0, this function's behavior is undefined.

func (Cursor) TemplateCursorKind

func (c Cursor) TemplateCursorKind() CursorKind

GetTemplateCursorKind given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template.

This routine can be used to determine what flavor of function template, class template, or class template partial specialization is stored in the cursor. For example, it can describe whether a class template cursor is declared with "struct", "class" or "union".

Parameter C The cursor to query. This cursor should represent a template declaration.

Returns The cursor kind of the specializations that would be generated by instantiating the template C. If C is not a template, returns CXCursor_NoDeclFound.

func (Cursor) TranslationUnit

func (c Cursor) TranslationUnit() TranslationUnit

TranslationUnit returns the translation unit that a cursor originated from.

func (Cursor) Type

func (c Cursor) Type() Type

GetCursorType retrieve the type of a CXCursor (if any).

func (Cursor) TypedefDeclUnderlyingType

func (c Cursor) TypedefDeclUnderlyingType() Type

GetTypedefDeclUnderlyingType retrieve the underlying type of a typedef declaration.

If the cursor does not reference a typedef declaration, an invalid type is returned.

func (Cursor) USR

func (c Cursor) USR() string

GetCursorUSR retrieve a Unified Symbol Resolution (USR) for the entity referenced by the given cursor.

A Unified Symbol Resolution (USR) is a string that identifies a particular entity (function, class, variable, etc.) within a program. USRs can be compared across translation units to determine, e.g., when references in one translation refer to an entity defined in another translation unit.

func (Cursor) VarDeclInitializer added in v0.12.0

func (c Cursor) VarDeclInitializer() Cursor

VarDeclInitializer if cursor refers to a variable declaration and it has initializer returns cursor referring to the initializer otherwise return null cursor.

func (Cursor) Visibility

func (c Cursor) Visibility() VisibilityKind

GetCursorVisibility describe the visibility of the entity referred to by a cursor.

This returns the default visibility if not explicitly specified by a visibility attribute. The default visibility may be changed by commandline arguments.

Parameter cursor The cursor to query.

Returns The visibility of the cursor.

func (Cursor) Visit

func (c Cursor) Visit(visitor CursorVisitor) bool

Visit the children of a particular cursor.

This function visits all the direct children of the given cursor, invoking the given visitor function with the cursors of each visited child. The traversal may be recursive, if the visitor returns ChildVisit_Recurse. The traversal may also be ended prematurely, if the visitor returns ChildVisit_Break.

parent the cursor whose child may be visited. All kinds of cursors can be visited, including invalid cursors (which, by definition, have no children).

visitor the visitor function that will be invoked for each child of parent.

clientData pointer data supplied by the client, which will be passed to the visitor each time it is invoked.

Returns a non-zero value if the traversal was terminated.

func (Cursor) Xdata

func (c Cursor) Xdata() int32

type CursorAndRangeVisitor

type CursorAndRangeVisitor struct {
	// contains filtered or unexported fields
}

type CursorKind

type CursorKind uint32

CursorKind describes the kind of entity that a cursor refers to.

func (CursorKind) IsAttribute

func (ck CursorKind) IsAttribute() bool

IsAttribute determine whether the given cursor kind represents an attribute.

func (CursorKind) IsDeclaration

func (ck CursorKind) IsDeclaration() bool

IsDeclaration determine whether the given cursor kind represents a declaration.

func (CursorKind) IsExpression

func (ck CursorKind) IsExpression() bool

IsExpression determine whether the given cursor kind represents an expression.

func (CursorKind) IsInvalid

func (ck CursorKind) IsInvalid() bool

IsInvalid determine whether the given cursor kind represents an invalid cursor.

func (CursorKind) IsPreprocessing

func (ck CursorKind) IsPreprocessing() bool

IsPreprocessing * Determine whether the given cursor represents a preprocessing element, such as a preprocessor directive or macro instantiation.

func (CursorKind) IsReference

func (ck CursorKind) IsReference() bool

IsReference determine whether the given cursor kind represents a simple reference.

Note that other kinds of cursors (such as expressions) can also refer to other cursors. Use clang_getCursorReferenced() to determine whether a particular cursor refers to another entity.

func (CursorKind) IsStatement

func (ck CursorKind) IsStatement() bool

IsStatement determine whether the given cursor kind represents a statement.

func (CursorKind) IsTranslationUnit

func (ck CursorKind) IsTranslationUnit() bool

IsTranslationUnit determine whether the given cursor kind represents a translation unit.

func (CursorKind) IsUnexposed

func (ck CursorKind) IsUnexposed() bool

IsUnexposed * Determine whether the given cursor represents a currently unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).

func (CursorKind) Spelling

func (ck CursorKind) Spelling() string

func (CursorKind) String

func (ck CursorKind) String() string

type CursorSet

type CursorSet struct {
	// contains filtered or unexported fields
}

CursorSet a fast container representing a set of CXCursors.

func NewCursorSet

func NewCursorSet() CursorSet

CreateCXCursorSet creates an empty CXCursorSet.

func (CursorSet) Contains

func (cs CursorSet) Contains(cursor Cursor) uint32

Contains queries a CXCursorSet to see if it contains a specific CXCursor.

Returns non-zero if the set contains the specified cursor.

func (CursorSet) Dispose

func (cs CursorSet) Dispose()

DisposeCXCursorSet disposes a CXCursorSet and releases its associated memory.

func (CursorSet) Insert

func (cs CursorSet) Insert(cursor Cursor) uint32

Insert inserts a CXCursor into a CXCursorSet.

Returns zero if the CXCursor was already in the set, and non-zero otherwise.

type CursorVisitor

type CursorVisitor func(cursor, parent Cursor) (status ChildVisitResult)

CursorVisitor invoked for each cursor found by a traversal.

This visitor function will be invoked for each cursor found by clang_visitCursorChildren(). Its first argument is the cursor being visited, its second argument is the parent visitor for that cursor, and its third argument is the client data provided to clang_visitCursorChildren().

The visitor should return one of the ChildVisitResult values to direct clang_visitCursorChildren().

type Cursor_ExceptionSpecificationKind added in v0.5.0

type Cursor_ExceptionSpecificationKind uint32

Cursor_ExceptionSpecificationKind describes the exception specification of a cursor.

A negative value indicates that the cursor is not a function declaration.

func (Cursor_ExceptionSpecificationKind) Spelling added in v0.5.0

func (cesk Cursor_ExceptionSpecificationKind) Spelling() string

func (Cursor_ExceptionSpecificationKind) String added in v0.5.0

type DeclQualifierKind

type DeclQualifierKind uint32

DeclQualifierKind 'Qualifiers' written next to the return and parameter types in Objective-C method declarations.

func (DeclQualifierKind) Spelling

func (dqk DeclQualifierKind) Spelling() string

func (DeclQualifierKind) String

func (dqk DeclQualifierKind) String() string

type Diagnostic

type Diagnostic struct {
	// contains filtered or unexported fields
}

Diagnostic a single diagnostic, containing the diagnostic's severity, location, text, source ranges, and fix-it hints.

func (Diagnostic) Category

func (d Diagnostic) Category() uint32

GetDiagnosticCategory retrieve the category number for this diagnostic.

Diagnostics can be categorized into groups along with other, related diagnostics (e.g., diagnostics under the same warning flag). This routine retrieves the category number for the given diagnostic.

Returns The number of the category that contains this diagnostic, or zero if this diagnostic is uncategorized.

func (Diagnostic) CategoryText

func (d Diagnostic) CategoryText() string

GetDiagnosticCategoryText retrieve the diagnostic category text for a given diagnostic.

Returns The text of the given diagnostic category.

func (Diagnostic) ChildDiagnostics

func (d Diagnostic) ChildDiagnostics() DiagnosticSet

GetChildDiagnostics retrieve the child diagnostics of a CXDiagnostic.

This CXDiagnosticSet does not need to be released by clang_disposeDiagnosticSet.

func (Diagnostic) Dispose

func (d Diagnostic) Dispose()

DisposeDiagnostic destroy a diagnostic.

func (Diagnostic) FixIt

func (d Diagnostic) FixIt(fixIt uint32) (SourceRange, string)

GetDiagnosticFixIt retrieve the replacement information for a given fix-it.

Fix-its are described in terms of a source range whose contents should be replaced by a string. This approach generalizes over three kinds of operations: removal of source code (the range covers the code to be removed and the replacement string is empty), replacement of source code (the range covers the code to be replaced and the replacement string provides the new code), and insertion (both the start and end of the range point at the insertion location, and the replacement string provides the text to insert).

Parameter Diagnostic The diagnostic whose fix-its are being queried.

Parameter FixIt The zero-based index of the fix-it.

Parameter ReplacementRange The source range whose contents will be replaced with the returned replacement string. Note that source ranges are half-open ranges [a, b), so the source code should be replaced from a and up to (but not including) b.

Returns A string containing text that should be replace the source code indicated by the ReplacementRange.

func (Diagnostic) FormatDiagnostic

func (d Diagnostic) FormatDiagnostic(options uint32) string

FormatDiagnostic format the given diagnostic in a manner that is suitable for display.

This routine will format the given diagnostic to a string, rendering the diagnostic according to the various options given. The clang_defaultDiagnosticDisplayOptions() function returns the set of options that most closely mimics the behavior of the clang compiler.

Parameter Diagnostic The diagnostic to print.

Parameter Options A set of options that control the diagnostic display, created by combining CXDiagnosticDisplayOptions values.

Returns A new string containing for formatted diagnostic.

func (Diagnostic) Location

func (d Diagnostic) Location() SourceLocation

GetDiagnosticLocation retrieve the source location of the given diagnostic.

This location is where Clang would print the caret ('^') when displaying the diagnostic on the command line.

func (Diagnostic) NumFixIts

func (d Diagnostic) NumFixIts() uint32

GetDiagnosticNumFixIts determine the number of fix-it hints associated with the given diagnostic.

func (Diagnostic) NumRanges

func (d Diagnostic) NumRanges() uint32

GetDiagnosticNumRanges determine the number of source ranges associated with the given diagnostic.

func (Diagnostic) Option

func (d Diagnostic) Option() (string, string)

GetDiagnosticOption retrieve the name of the command-line option that enabled this diagnostic.

Parameter Diag The diagnostic to be queried.

Parameter Disable If non-NULL, will be set to the option that disables this diagnostic (if any).

Returns A string that contains the command-line option used to enable this warning, such as "-Wconversion" or "-pedantic".

func (Diagnostic) Range

func (d Diagnostic) Range(r uint32) SourceRange

GetDiagnosticRange retrieve a source range associated with the diagnostic.

A diagnostic's source ranges highlight important elements in the source code. On the command line, Clang displays source ranges by underlining them with '~' characters.

Parameter Diagnostic the diagnostic whose range is being extracted.

Parameter Range the zero-based index specifying which range to

Returns the requested source range.

func (Diagnostic) Severity

func (d Diagnostic) Severity() DiagnosticSeverity

GetDiagnosticSeverity determine the severity of the given diagnostic.

func (Diagnostic) Spelling

func (d Diagnostic) Spelling() string

GetDiagnosticSpelling retrieve the text of the given diagnostic.

type DiagnosticDisplayOptions

type DiagnosticDisplayOptions uint32

DiagnosticDisplayOptions options to control the display of diagnostics.

The values in this enum are meant to be combined to customize the behavior of clang_formatDiagnostic().

func (DiagnosticDisplayOptions) Spelling

func (ddo DiagnosticDisplayOptions) Spelling() string

func (DiagnosticDisplayOptions) String

func (ddo DiagnosticDisplayOptions) String() string

type DiagnosticSet

type DiagnosticSet struct {
	// contains filtered or unexported fields
}

DiagnosticSet a group of CXDiagnostics.

func (DiagnosticSet) DiagnosticInSet

func (ds DiagnosticSet) DiagnosticInSet(index uint32) Diagnostic

GetDiagnosticInSet retrieve a diagnostic associated with the given CXDiagnosticSet.

Parameter Diags the CXDiagnosticSet to query. Parameter Index the zero-based diagnostic number to retrieve.

Returns the requested diagnostic. This diagnostic must be freed via a call to clang_disposeDiagnostic().

func (DiagnosticSet) Dispose

func (ds DiagnosticSet) Dispose()

DisposeDiagnosticSet release a CXDiagnosticSet and all of its contained diagnostics.

func (DiagnosticSet) NumDiagnosticsInSet

func (ds DiagnosticSet) NumDiagnosticsInSet() uint32

GetNumDiagnosticsInSet determine the number of diagnostics in a CXDiagnosticSet.

type DiagnosticSeverity

type DiagnosticSeverity uint32

DiagnosticSeverity describes the severity of a particular diagnostic.

func (DiagnosticSeverity) Spelling

func (ds DiagnosticSeverity) Spelling() string

func (DiagnosticSeverity) String

func (ds DiagnosticSeverity) String() string

type ErrorCode

type ErrorCode uint32

ErrorCode error codes returned by libclang routines.

Zero (CXError_Success) is the only error code indicating success. Other error codes, including not yet assigned non-zero values, indicate errors.

func (ErrorCode) Spelling

func (ec ErrorCode) Spelling() string

func (ErrorCode) String

func (ec ErrorCode) String() string

type EvalResult

type EvalResult struct {
	// contains filtered or unexported fields
}

EvalResult evaluation result of a cursor

func (EvalResult) AsDouble

func (er EvalResult) AsDouble() float64

AsDouble returns the evaluation result as double if the kind is double.

func (EvalResult) AsInt

func (er EvalResult) AsInt() int32

AsInt returns the evaluation result as integer if the kind is Int.

func (EvalResult) AsLongLong added in v0.4.0

func (er EvalResult) AsLongLong() int64

AsLongLong returns the evaluation result as a long long integer if the kind is Int. This prevents overflows that may happen if the result is returned with clang_EvalResult_getAsInt.

func (EvalResult) AsStr

func (er EvalResult) AsStr() string

AsStr returns the evaluation result as a constant string if the kind is other than Int or float. User must not free this pointer, instead call clang_EvalResult_dispose on the CXEvalResult returned by clang_Cursor_Evaluate.

func (EvalResult) AsUnsigned added in v0.4.0

func (er EvalResult) AsUnsigned() uint64

AsUnsigned returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero.

func (EvalResult) Dispose

func (er EvalResult) Dispose()

Dispose disposes the created Eval memory.

func (EvalResult) IsUnsignedInt added in v0.4.0

func (er EvalResult) IsUnsignedInt() bool

IsUnsignedInt returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer.

func (EvalResult) Kind

func (er EvalResult) Kind() EvalResultKind

Kind returns the kind of the evaluated result.

type EvalResultKind

type EvalResultKind uint32

func (EvalResultKind) Spelling

func (erk EvalResultKind) Spelling() string

func (EvalResultKind) String

func (erk EvalResultKind) String() string

type File

type File struct {
	// contains filtered or unexported fields
}

File a particular source file that is part of a translation unit.

func (File) IsEqual

func (f File) IsEqual(file2 File) bool

IsEqual returns non-zero if the file1 and file2 point to the same file, or they are both NULL.

func (File) Name

func (f File) Name() string

GetFileName retrieve the complete file and path name of the given file.

func (File) Time

func (f File) Time() time.Time

GetFileTime retrieve the last modification time of the given file.

func (File) TryGetRealPathName added in v0.7.0

func (f File) TryGetRealPathName() string

TryGetRealPathName returns the real path name of file.

An empty string may be returned. Use clang_getFileName() in that case.

func (File) UniqueID

func (f File) UniqueID() (FileUniqueID, int32)

GetFileUniqueID retrieve the unique ID for the given file.

Parameter file the file to get the ID for. Parameter outID stores the returned CXFileUniqueID. Returns If there was a failure getting the unique ID, returns non-zero, otherwise returns 0.

type FileUniqueID

type FileUniqueID struct {
	// contains filtered or unexported fields
}

FileUniqueID uniquely identifies a CXFile, that refers to the same underlying file, across an indexing session.

type GlobalOptFlags

type GlobalOptFlags uint32

func (GlobalOptFlags) Spelling

func (gof GlobalOptFlags) Spelling() string

func (GlobalOptFlags) String

func (gof GlobalOptFlags) String() string

type IdxAttrInfo

type IdxAttrInfo struct {
	// contains filtered or unexported fields
}

func (IdxAttrInfo) Cursor

func (iai IdxAttrInfo) Cursor() Cursor

func (*IdxAttrInfo) IBOutletCollectionAttrInfo

func (iai *IdxAttrInfo) IBOutletCollectionAttrInfo() *IdxIBOutletCollectionAttrInfo

func (IdxAttrInfo) Kind

func (iai IdxAttrInfo) Kind() IdxAttrKind

func (IdxAttrInfo) Loc

func (iai IdxAttrInfo) Loc() IdxLoc

type IdxAttrKind

type IdxAttrKind uint32

func (IdxAttrKind) Spelling

func (iak IdxAttrKind) Spelling() string

func (IdxAttrKind) String

func (iak IdxAttrKind) String() string

type IdxBaseClassInfo

type IdxBaseClassInfo struct {
	// contains filtered or unexported fields
}

func (IdxBaseClassInfo) Base

func (ibci IdxBaseClassInfo) Base() *IdxEntityInfo

func (IdxBaseClassInfo) Cursor

func (ibci IdxBaseClassInfo) Cursor() Cursor

func (IdxBaseClassInfo) Loc

func (ibci IdxBaseClassInfo) Loc() IdxLoc

type IdxCXXClassDeclInfo

type IdxCXXClassDeclInfo struct {
	// contains filtered or unexported fields
}

func (IdxCXXClassDeclInfo) Bases

func (icxxcdi IdxCXXClassDeclInfo) Bases() []*IdxBaseClassInfo

func (IdxCXXClassDeclInfo) DeclInfo

func (icxxcdi IdxCXXClassDeclInfo) DeclInfo() *IdxDeclInfo

func (IdxCXXClassDeclInfo) NumBases

func (icxxcdi IdxCXXClassDeclInfo) NumBases() uint32

type IdxClientASTFile

type IdxClientASTFile struct {
	// contains filtered or unexported fields
}

IdxClientASTFile the client's data object that is associated with an AST file (PCH or module).

type IdxClientContainer

type IdxClientContainer struct {
	// contains filtered or unexported fields
}

IdxClientContainer the client's data object that is associated with a semantic container of entities.

type IdxClientEntity

type IdxClientEntity struct {
	// contains filtered or unexported fields
}

IdxClientEntity the client's data object that is associated with a semantic entity.

type IdxClientFile

type IdxClientFile struct {
	// contains filtered or unexported fields
}

IdxClientFile the client's data object that is associated with a CXFile.

type IdxContainerInfo

type IdxContainerInfo struct {
	// contains filtered or unexported fields
}

func (*IdxContainerInfo) ClientContainer

func (ici *IdxContainerInfo) ClientContainer() IdxClientContainer

Index_getClientContainer for retrieving a custom CXIdxClientContainer attached to a container.

func (IdxContainerInfo) Cursor

func (ici IdxContainerInfo) Cursor() Cursor

func (*IdxContainerInfo) SetClientContainer

func (ici *IdxContainerInfo) SetClientContainer(icc IdxClientContainer)

Index_setClientContainer for setting a custom CXIdxClientContainer attached to a container.

type IdxDeclInfo

type IdxDeclInfo struct {
	// contains filtered or unexported fields
}

func (IdxDeclInfo) Attributes

func (idi IdxDeclInfo) Attributes() []*IdxAttrInfo

func (*IdxDeclInfo) CategoryDeclInfo

func (idi *IdxDeclInfo) CategoryDeclInfo() *IdxObjCCategoryDeclInfo

func (*IdxDeclInfo) ClassDeclInfo

func (idi *IdxDeclInfo) ClassDeclInfo() *IdxCXXClassDeclInfo

func (*IdxDeclInfo) ContainerDeclInfo

func (idi *IdxDeclInfo) ContainerDeclInfo() *IdxObjCContainerDeclInfo

func (IdxDeclInfo) Cursor

func (idi IdxDeclInfo) Cursor() Cursor

func (IdxDeclInfo) DeclAsContainer

func (idi IdxDeclInfo) DeclAsContainer() *IdxContainerInfo

func (IdxDeclInfo) EntityInfo

func (idi IdxDeclInfo) EntityInfo() *IdxEntityInfo

func (IdxDeclInfo) Flags

func (idi IdxDeclInfo) Flags() uint32

func (*IdxDeclInfo) InterfaceDeclInfo

func (idi *IdxDeclInfo) InterfaceDeclInfo() *IdxObjCInterfaceDeclInfo

func (IdxDeclInfo) IsContainer

func (idi IdxDeclInfo) IsContainer() bool

func (IdxDeclInfo) IsDefinition

func (idi IdxDeclInfo) IsDefinition() bool

func (IdxDeclInfo) IsImplicit

func (idi IdxDeclInfo) IsImplicit() bool

isImplicit whether the declaration exists in code or was created implicitly by the compiler, e.g. implicit Objective-C methods for properties.

func (IdxDeclInfo) IsRedeclaration

func (idi IdxDeclInfo) IsRedeclaration() bool

func (IdxDeclInfo) LexicalContainer

func (idi IdxDeclInfo) LexicalContainer() *IdxContainerInfo

lexicalContainer generally same as #semanticContainer but can be different in cases like out-of-line C++ member functions.

func (IdxDeclInfo) Loc

func (idi IdxDeclInfo) Loc() IdxLoc

func (IdxDeclInfo) NumAttributes

func (idi IdxDeclInfo) NumAttributes() uint32

func (*IdxDeclInfo) PropertyDeclInfo

func (idi *IdxDeclInfo) PropertyDeclInfo() *IdxObjCPropertyDeclInfo

func (*IdxDeclInfo) ProtocolRefListInfo

func (idi *IdxDeclInfo) ProtocolRefListInfo() *IdxObjCProtocolRefListInfo

func (IdxDeclInfo) SemanticContainer

func (idi IdxDeclInfo) SemanticContainer() *IdxContainerInfo

type IdxDeclInfoFlags

type IdxDeclInfoFlags uint32
const (
	IdxDeclFlag_Skipped IdxDeclInfoFlags = C.CXIdxDeclFlag_Skipped
)

func (IdxDeclInfoFlags) Spelling

func (idif IdxDeclInfoFlags) Spelling() string

func (IdxDeclInfoFlags) String

func (idif IdxDeclInfoFlags) String() string

type IdxEntityCXXTemplateKind

type IdxEntityCXXTemplateKind uint32

IdxEntityCXXTemplateKind extra C++ template information for an entity. This can apply to: CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias

func (IdxEntityCXXTemplateKind) Spelling

func (iecxxtk IdxEntityCXXTemplateKind) Spelling() string

func (IdxEntityCXXTemplateKind) String

func (iecxxtk IdxEntityCXXTemplateKind) String() string

type IdxEntityInfo

type IdxEntityInfo struct {
	// contains filtered or unexported fields
}

func (IdxEntityInfo) Attributes

func (iei IdxEntityInfo) Attributes() []*IdxAttrInfo

func (*IdxEntityInfo) ClientEntity

func (iei *IdxEntityInfo) ClientEntity() IdxClientEntity

Index_getClientEntity for retrieving a custom CXIdxClientEntity attached to an entity.

func (IdxEntityInfo) Cursor

func (iei IdxEntityInfo) Cursor() Cursor

func (IdxEntityInfo) Kind

func (iei IdxEntityInfo) Kind() IdxEntityKind

func (IdxEntityInfo) Lang

func (iei IdxEntityInfo) Lang() IdxEntityLanguage

func (IdxEntityInfo) Name

func (iei IdxEntityInfo) Name() string

func (IdxEntityInfo) NumAttributes

func (iei IdxEntityInfo) NumAttributes() uint32

func (*IdxEntityInfo) SetClientEntity

func (iei *IdxEntityInfo) SetClientEntity(ice IdxClientEntity)

Index_setClientEntity for setting a custom CXIdxClientEntity attached to an entity.

func (IdxEntityInfo) TemplateKind

func (iei IdxEntityInfo) TemplateKind() IdxEntityCXXTemplateKind

func (IdxEntityInfo) USR

func (iei IdxEntityInfo) USR() string

type IdxEntityKind

type IdxEntityKind uint32

func (IdxEntityKind) IsEntityObjCContainerKind

func (iek IdxEntityKind) IsEntityObjCContainerKind() bool

func (IdxEntityKind) Spelling

func (iek IdxEntityKind) Spelling() string

func (IdxEntityKind) String

func (iek IdxEntityKind) String() string

type IdxEntityLanguage

type IdxEntityLanguage uint32

func (IdxEntityLanguage) Spelling

func (iel IdxEntityLanguage) Spelling() string

func (IdxEntityLanguage) String

func (iel IdxEntityLanguage) String() string

type IdxEntityRefInfo

type IdxEntityRefInfo struct {
	// contains filtered or unexported fields
}

IdxEntityRefInfo data for IndexerCallbacks#indexEntityReference.

func (IdxEntityRefInfo) Container

func (ieri IdxEntityRefInfo) Container() *IdxContainerInfo

container lexical container context of the reference.

func (IdxEntityRefInfo) Cursor

func (ieri IdxEntityRefInfo) Cursor() Cursor

cursor reference cursor.

func (IdxEntityRefInfo) Kind

func (ieri IdxEntityRefInfo) Kind() IdxEntityRefKind

func (IdxEntityRefInfo) Loc

func (ieri IdxEntityRefInfo) Loc() IdxLoc

func (IdxEntityRefInfo) ParentEntity

func (ieri IdxEntityRefInfo) ParentEntity() *IdxEntityInfo

parentEntity immediate "parent" of the reference. For example:

Foo *var;

The parent of reference of type 'Foo' is the variable 'var'. For references inside statement bodies of functions/methods, the parentEntity will be the function/method.

func (IdxEntityRefInfo) ReferencedEntity

func (ieri IdxEntityRefInfo) ReferencedEntity() *IdxEntityInfo

referencedEntity the entity that gets referenced.

func (IdxEntityRefInfo) Role added in v0.7.0

func (ieri IdxEntityRefInfo) Role() SymbolRole

role sets of symbol roles of the reference.

type IdxEntityRefKind

type IdxEntityRefKind uint32

IdxEntityRefKind data for IndexerCallbacks#indexEntityReference.

This may be deprecated in a future version as this duplicates the CXSymbolRole_Implicit bit in CXSymbolRole.

const (
	// IdxEntityRef_Direct the entity is referenced directly in user's code.
	IdxEntityRef_Direct IdxEntityRefKind = C.CXIdxEntityRef_Direct
	// IdxEntityRef_Implicit an implicit reference, e.g. a reference of an Objective-C method via the dot syntax.
	IdxEntityRef_Implicit = C.CXIdxEntityRef_Implicit
)

func (IdxEntityRefKind) Spelling

func (ierk IdxEntityRefKind) Spelling() string

func (IdxEntityRefKind) String

func (ierk IdxEntityRefKind) String() string

type IdxIBOutletCollectionAttrInfo

type IdxIBOutletCollectionAttrInfo struct {
	// contains filtered or unexported fields
}

func (IdxIBOutletCollectionAttrInfo) AttrInfo

func (iibocai IdxIBOutletCollectionAttrInfo) AttrInfo() *IdxAttrInfo

func (IdxIBOutletCollectionAttrInfo) ClassCursor

func (iibocai IdxIBOutletCollectionAttrInfo) ClassCursor() Cursor

func (IdxIBOutletCollectionAttrInfo) ClassLoc

func (iibocai IdxIBOutletCollectionAttrInfo) ClassLoc() IdxLoc

func (IdxIBOutletCollectionAttrInfo) ObjcClass

func (iibocai IdxIBOutletCollectionAttrInfo) ObjcClass() *IdxEntityInfo

type IdxImportedASTFileInfo

type IdxImportedASTFileInfo struct {
	// contains filtered or unexported fields
}

IdxImportedASTFileInfo data for IndexerCallbacks#importedASTFile.

func (IdxImportedASTFileInfo) File

func (iiastfi IdxImportedASTFileInfo) File() File

file top level AST file containing the imported PCH, module or submodule.

func (IdxImportedASTFileInfo) IsImplicit

func (iiastfi IdxImportedASTFileInfo) IsImplicit() bool

isImplicit non-zero if an inclusion directive was automatically turned into a module import. Applicable only for modules.

func (IdxImportedASTFileInfo) Loc

func (iiastfi IdxImportedASTFileInfo) Loc() IdxLoc

loc location where the file is imported. Applicable only for modules.

func (IdxImportedASTFileInfo) Module

func (iiastfi IdxImportedASTFileInfo) Module() Module

module the imported module or NULL if the AST file is a PCH.

type IdxIncludedFileInfo

type IdxIncludedFileInfo struct {
	// contains filtered or unexported fields
}

IdxIncludedFileInfo data for ppIncludedFile callback.

func (IdxIncludedFileInfo) File

func (iifi IdxIncludedFileInfo) File() File

file the actual file that the \#include/\#import directive resolved to.

func (IdxIncludedFileInfo) Filename

func (iifi IdxIncludedFileInfo) Filename() string

filename filename as written in the \#include/\#import directive.

func (IdxIncludedFileInfo) HashLoc

func (iifi IdxIncludedFileInfo) HashLoc() IdxLoc

hashLoc location of '#' in the \#include/\#import directive.

func (IdxIncludedFileInfo) IsAngled

func (iifi IdxIncludedFileInfo) IsAngled() bool

func (IdxIncludedFileInfo) IsImport

func (iifi IdxIncludedFileInfo) IsImport() bool

func (IdxIncludedFileInfo) IsModuleImport

func (iifi IdxIncludedFileInfo) IsModuleImport() bool

isModuleImport non-zero if the directive was automatically turned into a module import.

type IdxLoc

type IdxLoc struct {
	// contains filtered or unexported fields
}

IdxLoc source location passed to index callbacks.

func (IdxLoc) FileLocation

func (il IdxLoc) FileLocation() (IdxClientFile, File, uint32, uint32, uint32)

IndexLoc_getFileLocation retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.

If the location refers into a macro expansion, retrieves the location of the macro expansion and if it refers into a macro argument retrieves the location of the argument.

func (IdxLoc) SourceLocation

func (il IdxLoc) SourceLocation() SourceLocation

IndexLoc_getCXSourceLocation retrieve the CXSourceLocation represented by the given CXIdxLoc.

type IdxObjCCategoryDeclInfo

type IdxObjCCategoryDeclInfo struct {
	// contains filtered or unexported fields
}

func (IdxObjCCategoryDeclInfo) ClassCursor

func (ioccdi IdxObjCCategoryDeclInfo) ClassCursor() Cursor

func (IdxObjCCategoryDeclInfo) ClassLoc

func (ioccdi IdxObjCCategoryDeclInfo) ClassLoc() IdxLoc

func (IdxObjCCategoryDeclInfo) ContainerInfo

func (ioccdi IdxObjCCategoryDeclInfo) ContainerInfo() *IdxObjCContainerDeclInfo

func (IdxObjCCategoryDeclInfo) ObjcClass

func (ioccdi IdxObjCCategoryDeclInfo) ObjcClass() *IdxEntityInfo

func (IdxObjCCategoryDeclInfo) Protocols

type IdxObjCContainerDeclInfo

type IdxObjCContainerDeclInfo struct {
	// contains filtered or unexported fields
}

func (IdxObjCContainerDeclInfo) DeclInfo

func (ioccdi IdxObjCContainerDeclInfo) DeclInfo() *IdxDeclInfo

func (IdxObjCContainerDeclInfo) Kind

type IdxObjCContainerKind

type IdxObjCContainerKind uint32

func (IdxObjCContainerKind) Spelling

func (iocck IdxObjCContainerKind) Spelling() string

func (IdxObjCContainerKind) String

func (iocck IdxObjCContainerKind) String() string

type IdxObjCInterfaceDeclInfo

type IdxObjCInterfaceDeclInfo struct {
	// contains filtered or unexported fields
}

func (IdxObjCInterfaceDeclInfo) ContainerInfo

func (iocidi IdxObjCInterfaceDeclInfo) ContainerInfo() *IdxObjCContainerDeclInfo

func (IdxObjCInterfaceDeclInfo) Protocols

func (IdxObjCInterfaceDeclInfo) SuperInfo

func (iocidi IdxObjCInterfaceDeclInfo) SuperInfo() *IdxBaseClassInfo

type IdxObjCPropertyDeclInfo

type IdxObjCPropertyDeclInfo struct {
	// contains filtered or unexported fields
}

func (IdxObjCPropertyDeclInfo) DeclInfo

func (iocpdi IdxObjCPropertyDeclInfo) DeclInfo() *IdxDeclInfo

func (IdxObjCPropertyDeclInfo) Getter

func (iocpdi IdxObjCPropertyDeclInfo) Getter() *IdxEntityInfo

func (IdxObjCPropertyDeclInfo) Setter

func (iocpdi IdxObjCPropertyDeclInfo) Setter() *IdxEntityInfo

type IdxObjCProtocolRefInfo

type IdxObjCProtocolRefInfo struct {
	// contains filtered or unexported fields
}

func (IdxObjCProtocolRefInfo) Cursor

func (iocpri IdxObjCProtocolRefInfo) Cursor() Cursor

func (IdxObjCProtocolRefInfo) Loc

func (iocpri IdxObjCProtocolRefInfo) Loc() IdxLoc

func (IdxObjCProtocolRefInfo) Protocol

func (iocpri IdxObjCProtocolRefInfo) Protocol() *IdxEntityInfo

type IdxObjCProtocolRefListInfo

type IdxObjCProtocolRefListInfo struct {
	// contains filtered or unexported fields
}

func (IdxObjCProtocolRefListInfo) NumProtocols

func (iocprli IdxObjCProtocolRefListInfo) NumProtocols() uint32

func (IdxObjCProtocolRefListInfo) Protocols

func (iocprli IdxObjCProtocolRefListInfo) Protocols() []*IdxObjCProtocolRefInfo

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index an "index" that consists of a set of translation units that would typically be linked together into an executable or library.

func NewIndex

func NewIndex(excludeDeclarationsFromPCH int32, displayDiagnostics int32) Index

CreateIndex provides a shared context for creating translation units.

It provides two options:

- excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" declarations (when loading any new translation units). A "local" declaration is one that belongs in the translation unit itself and not in a precompiled header that was used by the translation unit. If zero, all declarations will be enumerated.

Here is an example:

// excludeDeclsFromPCH = 1, displayDiagnostics=1
Idx = CreateIndex(1, 1);

// IndexTest.pch was produced with the following command:
// "clang -x c IndexTest.h -emit-ast -o IndexTest.pch"
TU = clang_createTranslationUnit(Idx, "IndexTest.pch");

// This will load all the symbols from 'IndexTest.pch'
clang_visitChildren(clang_getTranslationUnitCursor(TU),
TranslationUnitVisitor, 0);
clang_disposeTranslationUnit(TU);

// This will load all the symbols from 'IndexTest.c', excluding symbols
// from 'IndexTest.pch'.
char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" };
TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args,
0, 0);
clang_visitChildren(clang_getTranslationUnitCursor(TU),
TranslationUnitVisitor, 0);
clang_disposeTranslationUnit(TU);

This process of creating the 'pch', loading it separately, and using it (via -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks (which gives the indexer the same performance benefit as the compiler).

func (Index) Action_create

func (i Index) Action_create() IndexAction

Action_create an indexing action/session, to be applied to one or multiple translation units.

Parameter CIdx The index object with which the index action will be associated.

func (Index) Dispose

func (i Index) Dispose()

DisposeIndex destroy the given index.

The index must not be destroyed until all of the translation units created within that index have been destroyed.

func (Index) GlobalOptions

func (i Index) GlobalOptions() uint32

GlobalOptions gets the general options associated with a CXIndex.

Returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that are associated with the given CXIndex object.

func (Index) ParseTranslationUnit

func (i Index) ParseTranslationUnit(sourceFilename string, commandLineArgs []string, unsavedFiles []UnsavedFile, options uint32) TranslationUnit

ParseTranslationUnit same as ParseTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes.

func (Index) ParseTranslationUnit2

func (i Index) ParseTranslationUnit2(sourceFilename string, commandLineArgs []string, unsavedFiles []UnsavedFile, options uint32, outTU *TranslationUnit) ErrorCode

ParseTranslationUnit2 parse the given source file and the translation unit corresponding to that file.

This routine is the main entry point for the Clang C API, providing the ability to parse a source file into a translation unit that can then be queried by other functions in the API. This routine accepts a set of command-line arguments so that the compilation can be configured in the same way that the compiler is configured on the command line.

Parameter CIdx The index object with which the translation unit will be associated.

Parameter source_filename The name of the source file to load, or NULL if the source file is included in command_line_args.

Parameter command_line_args The command-line arguments that would be passed to the clang executable if it were being invoked out-of-process. These command-line options will be parsed and will affect how the translation unit is parsed. Note that the following options are ignored: '-c', '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'.

Parameter num_command_line_args The number of command-line arguments in command_line_args.

Parameter unsaved_files the files that have not yet been saved to disk but may be required for parsing, including the contents of those files. The contents and name of these files (as specified by CXUnsavedFile) are copied when necessary, so the client only needs to guarantee their validity until the call to this function returns.

Parameter num_unsaved_files the number of unsaved file entries in \p unsaved_files.

Parameter options A bitmask of options that affects how the translation unit is managed but not its compilation. This should be a bitwise OR of the CXTranslationUnit_XXX flags.

\param[out] out_TU A non-NULL pointer to store the created CXTranslationUnit, describing the parsed code and containing any diagnostics produced by the compiler.

Returns Zero on success, otherwise returns an error code.

func (Index) ParseTranslationUnit2FullArgv

func (i Index) ParseTranslationUnit2FullArgv(sourceFilename string, commandLineArgs []string, unsavedFiles []UnsavedFile, options uint32, outTU *TranslationUnit) ErrorCode

ParseTranslationUnit2FullArgv same as clang_parseTranslationUnit2 but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary.

func (Index) SetGlobalOptions

func (i Index) SetGlobalOptions(options uint32)

SetGlobalOptions sets general options associated with a CXIndex.

For example:

CXIndex idx = ...;
SetGlobalOptions(idx,
clang_CXIndex_getGlobalOptions(idx) |
CXGlobalOpt_ThreadBackgroundPriorityForIndexing);

Parameter options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags.

func (Index) SetInvocationEmissionPathOption added in v0.6.0

func (i Index) SetInvocationEmissionPathOption(path string)

SetInvocationEmissionPathOption sets the invocation emission path option in a CXIndex.

The invocation emission path specifies a path which will contain log files for certain libclang invocations. A null value (default) implies that libclang invocations are not logged..

func (Index) TranslationUnit

func (i Index) TranslationUnit(astFilename string) TranslationUnit

CreateTranslationUnit same as CreateTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes.

func (Index) TranslationUnit2

func (i Index) TranslationUnit2(astFilename string, outTU *TranslationUnit) ErrorCode

CreateTranslationUnit2 create a translation unit from an AST file (-emit-ast).

\param[out] out_TU A non-NULL pointer to store the created CXTranslationUnit.

Returns Zero on success, otherwise returns an error code.

func (Index) TranslationUnitFromSourceFile

func (i Index) TranslationUnitFromSourceFile(sourceFilename string, clangCommandLineArgs []string, unsavedFiles []UnsavedFile) TranslationUnit

CreateTranslationUnitFromSourceFile return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler.

Note: The 'source_filename' argument is optional. If the caller provides a NULL pointer, the name of the source file is expected to reside in the specified command line arguments.

Note: When encountered in 'clang_command_line_args', the following options are ignored:

'-c' '-emit-ast' '-fsyntax-only' '-o \<output file>' (both '-o' and '\<output file>' are ignored)

Parameter CIdx The index object with which the translation unit will be associated.

Parameter source_filename The name of the source file to load, or NULL if the source file is included in clang_command_line_args.

Parameter num_clang_command_line_args The number of command-line arguments in clang_command_line_args.

Parameter clang_command_line_args The command-line arguments that would be passed to the clang executable if it were being invoked out-of-process. These command-line options will be parsed and will affect how the translation unit is parsed. Note that the following options are ignored: '-c', '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'.

Parameter num_unsaved_files the number of unsaved file entries in \p unsaved_files.

Parameter unsaved_files the files that have not yet been saved to disk but may be required for code completion, including the contents of those files. The contents and name of these files (as specified by CXUnsavedFile) are copied when necessary, so the client only needs to guarantee their validity until the call to this function returns.

type IndexAction

type IndexAction struct {
	// contains filtered or unexported fields
}

IndexAction an indexing action/session, to be applied to one or multiple translation units.

func (IndexAction) Dispose

func (ia IndexAction) Dispose()

Dispose destroy the given index action.

The index action must not be destroyed until all of the translation units created within that index action have been destroyed.

func (IndexAction) IndexSourceFile

func (ia IndexAction) IndexSourceFile(clientData ClientData, indexCallbacks *IndexerCallbacks, indexCallbacksSize uint32, indexOptions uint32, sourceFilename string, commandLineArgs []string, unsavedFiles []UnsavedFile, outTU *TranslationUnit, tUOptions uint32) int32

IndexSourceFile index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks.

Parameter client_data pointer data supplied by the client, which will be passed to the invoked callbacks.

Parameter index_callbacks Pointer to indexing callbacks that the client implements.

Parameter index_callbacks_size Size of #IndexerCallbacks structure that gets passed in index_callbacks.

Parameter index_options A bitmask of options that affects how indexing is performed. This should be a bitwise OR of the CXIndexOpt_XXX flags.

\param[out] out_TU pointer to store a CXTranslationUnit that can be reused after indexing is finished. Set to NULL if you do not require it.

Returns 0 on success or if there were errors from which the compiler could recover. If there is a failure from which there is no recovery, returns a non-zero CXErrorCode.

The rest of the parameters are the same as #clang_parseTranslationUnit.

func (IndexAction) IndexSourceFileFullArgv

func (ia IndexAction) IndexSourceFileFullArgv(clientData ClientData, indexCallbacks *IndexerCallbacks, indexCallbacksSize uint32, indexOptions uint32, sourceFilename string, commandLineArgs []string, unsavedFiles []UnsavedFile, outTU *TranslationUnit, tUOptions uint32) int32

IndexSourceFileFullArgv same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0]. This is useful if the standard library paths are relative to the binary.

func (IndexAction) IndexTranslationUnit

func (ia IndexAction) IndexTranslationUnit(clientData ClientData, indexCallbacks *IndexerCallbacks, indexCallbacksSize uint32, indexOptions uint32, tu TranslationUnit) int32

IndexTranslationUnit index the given translation unit via callbacks implemented through #IndexerCallbacks.

The order of callback invocations is not guaranteed to be the same as when indexing a source file. The high level order will be:

-Preprocessor callbacks invocations -Declaration/reference callbacks invocations -Diagnostic callback invocations

The parameters are the same as #clang_indexSourceFile.

Returns If there is a failure from which there is no recovery, returns non-zero, otherwise returns 0.

type IndexOptFlags

type IndexOptFlags uint32

func (IndexOptFlags) Spelling

func (iof IndexOptFlags) Spelling() string

func (IndexOptFlags) String

func (iof IndexOptFlags) String() string

type IndexerCallbacks

type IndexerCallbacks struct {
	// contains filtered or unexported fields
}

IndexerCallbacks a group of callbacks used by #clang_indexSourceFile and #clang_indexTranslationUnit.

type LanguageKind

type LanguageKind uint32

LanguageKind describe the "language" of the entity referred to by a cursor.

func (LanguageKind) Spelling

func (lk LanguageKind) Spelling() string

func (LanguageKind) String

func (lk LanguageKind) String() string

type LinkageKind

type LinkageKind uint32

LinkageKind describe the linkage of the entity referred to by a cursor.

func (LinkageKind) Spelling

func (lk LinkageKind) Spelling() string

func (LinkageKind) String

func (lk LinkageKind) String() string

type LoadDiag_Error

type LoadDiag_Error int32

LoadDiag_Error describes the kind of error that occurred (if any) in a call to clang_loadDiagnostics.

func (LoadDiag_Error) Error

func (lde LoadDiag_Error) Error() string

func (LoadDiag_Error) Spelling

func (lde LoadDiag_Error) Spelling() string

func (LoadDiag_Error) String

func (lde LoadDiag_Error) String() string

type Module

type Module struct {
	// contains filtered or unexported fields
}

func (Module) ASTFile

func (m Module) ASTFile() File

ASTFile parameter Module a module object.

Returns the module file where the provided module object came from.

func (Module) FullName

func (m Module) FullName() string

FullName parameter Module a module object.

Returns the full name of the module, e.g. "std.vector".

func (Module) IsSystem

func (m Module) IsSystem() bool

IsSystem parameter Module a module object.

Returns non-zero if the module is a system one.

func (Module) Name

func (m Module) Name() string

Name parameter Module a module object.

Returns the name of the module, e.g. for the 'std.vector' sub-module it will return "vector".

func (Module) Parent

func (m Module) Parent() Module

Parent parameter Module a module object.

Returns the parent of a sub-module or NULL if the given module is top-level, e.g. for 'std.vector' it will return the 'std' module.

type ModuleMapDescriptor

type ModuleMapDescriptor struct {
	// contains filtered or unexported fields
}

ModuleMapDescriptor object encapsulating information about a module.map file.

func NewModuleMapDescriptor

func NewModuleMapDescriptor(options uint32) ModuleMapDescriptor

NewModuleMapDescriptor create a CXModuleMapDescriptor object. Must be disposed with clang_ModuleMapDescriptor_dispose().

Parameter options is reserved, always pass 0.

func (ModuleMapDescriptor) Dispose

func (mmd ModuleMapDescriptor) Dispose()

Dispose dispose a CXModuleMapDescriptor object.

func (ModuleMapDescriptor) SetFrameworkModuleName

func (mmd ModuleMapDescriptor) SetFrameworkModuleName(name string) ErrorCode

SetFrameworkModuleName sets the framework module name that the module.map describes. Returns 0 for success, non-zero to indicate an error.

func (ModuleMapDescriptor) SetUmbrellaHeader

func (mmd ModuleMapDescriptor) SetUmbrellaHeader(name string) ErrorCode

SetUmbrellaHeader sets the umbrella header name that the module.map describes. Returns 0 for success, non-zero to indicate an error.

func (ModuleMapDescriptor) WriteToBuffer

func (mmd ModuleMapDescriptor) WriteToBuffer(options uint32) (string, uint32, ErrorCode)

WriteToBuffer write out the CXModuleMapDescriptor object to a char buffer.

Parameter options is reserved, always pass 0. Parameter out_buffer_ptr pointer to receive the buffer pointer, which should be disposed using clang_free(). Parameter out_buffer_size pointer to receive the buffer size. Returns 0 for success, non-zero to indicate an error.

type NameRefFlags

type NameRefFlags uint32

func (NameRefFlags) Spelling

func (nrf NameRefFlags) Spelling() string

func (NameRefFlags) String

func (nrf NameRefFlags) String() string

type PlatformAvailability

type PlatformAvailability struct {
	// contains filtered or unexported fields
}

PlatformAvailability describes the availability of a given entity on a particular platform, e.g., a particular class might only be available on Mac OS 10.7 or newer.

func (PlatformAvailability) Deprecated

func (pa PlatformAvailability) Deprecated() Version

Deprecated the version number in which this entity was deprecated (but is still available).

func (PlatformAvailability) Dispose

func (pa PlatformAvailability) Dispose()

DisposeCXPlatformAvailability free the memory associated with a CXPlatformAvailability structure.

func (PlatformAvailability) Introduced

func (pa PlatformAvailability) Introduced() Version

Introduced the version number in which this entity was introduced.

func (PlatformAvailability) Message

func (pa PlatformAvailability) Message() string

Message an optional message to provide to a user of this API, e.g., to suggest replacement APIs.

func (PlatformAvailability) Obsoleted

func (pa PlatformAvailability) Obsoleted() Version

Obsoleted the version number in which this entity was obsoleted, and therefore is no longer available.

func (PlatformAvailability) Platform

func (pa PlatformAvailability) Platform() string

Platform a string that describes the platform for which this structure provides availability information.

Possible values are "ios" or "macos".

func (PlatformAvailability) Unavailable

func (pa PlatformAvailability) Unavailable() int32

Unavailable whether the entity is unconditionally unavailable on this platform.

type PrintingPolicy added in v0.7.0

type PrintingPolicy struct {
	// contains filtered or unexported fields
}

PrintingPolicy opaque pointer representing a policy that controls pretty printing for clang_getCursorPrettyPrinted.

func (PrintingPolicy) Dispose added in v0.7.0

func (pp PrintingPolicy) Dispose()

Dispose release a printing policy.

func (PrintingPolicy) Property added in v0.7.0

func (pp PrintingPolicy) Property(property PrintingPolicyProperty) uint32

Property get a property value for the given printing policy.

func (PrintingPolicy) SetProperty added in v0.7.0

func (pp PrintingPolicy) SetProperty(property PrintingPolicyProperty, value uint32)

SetProperty set a property value for the given printing policy.

type PrintingPolicyProperty added in v0.7.0

type PrintingPolicyProperty uint32

PrintingPolicyProperty properties for the printing policy.

See clang::PrintingPolicy for more information.

func (PrintingPolicyProperty) Spelling added in v0.7.0

func (ppp PrintingPolicyProperty) Spelling() string

func (PrintingPolicyProperty) String added in v0.7.0

func (ppp PrintingPolicyProperty) String() string

type PropertyAttrKind

type PropertyAttrKind uint32

PropertyAttrKind property attributes for a CXCursor_ObjCPropertyDecl.

func (PropertyAttrKind) Spelling

func (pak PropertyAttrKind) Spelling() string

func (PropertyAttrKind) String

func (pak PropertyAttrKind) String() string

type RefQualifierKind

type RefQualifierKind uint32

func (RefQualifierKind) Spelling

func (rqk RefQualifierKind) Spelling() string

func (RefQualifierKind) String

func (rqk RefQualifierKind) String() string

type Remapping

type Remapping struct {
	// contains filtered or unexported fields
}

Remapping a remapping of original source files and their translated files.

func NewRemappings

func NewRemappings(path string) Remapping

GetRemappings retrieve a remapping.

Parameter path the path that contains metadata about remappings.

Returns the requested remapping. This remapping must be freed via a call to clang_remap_dispose(). Can return NULL if an error occurred.

func NewRemappingsFromFileList

func NewRemappingsFromFileList(filePaths []string) Remapping

GetRemappingsFromFileList retrieve a remapping.

Parameter filePaths pointer to an array of file paths containing remapping info.

Parameter numFiles number of file paths.

Returns the requested remapping. This remapping must be freed via a call to clang_remap_dispose(). Can return NULL if an error occurred.

func (Remapping) Dispose

func (r Remapping) Dispose()

Remap_dispose dispose the remapping.

func (Remapping) Filenames

func (r Remapping) Filenames(index uint32) (string, string)

Remap_getFilenames get the original and the associated filename from the remapping.

Parameter original If non-NULL, will be set to the original filename.

Parameter transformed If non-NULL, will be set to the filename that the original is associated with.

func (Remapping) NumFiles

func (r Remapping) NumFiles() uint32

Remap_getNumFiles determine the number of remappings.

type Reparse_Flags

type Reparse_Flags uint32

Reparse_Flags flags that control the reparsing of translation units.

The enumerators in this enumeration type are meant to be bitwise ORed together to specify which options should be used when reparsing the translation unit.

const (
	// Reparse_None used to indicate that no special reparsing options are needed.
	Reparse_None Reparse_Flags = C.CXReparse_None
)

func (Reparse_Flags) Spelling

func (rf Reparse_Flags) Spelling() string

func (Reparse_Flags) String

func (rf Reparse_Flags) String() string

type Result

type Result uint32

func (Result) Spelling

func (r Result) Spelling() string

func (Result) String

func (r Result) String() string

type Rewriter added in v0.12.0

type Rewriter struct {
	// contains filtered or unexported fields
}

func (Rewriter) CXRewriter_Dispose added in v0.12.0

func (r Rewriter) CXRewriter_Dispose()

CXRewriter_Dispose free the given CXRewriter.

func (Rewriter) InsertTextBefore added in v0.12.0

func (r Rewriter) InsertTextBefore(loc SourceLocation, insert string)

InsertTextBefore insert the specified string at the specified location in the original buffer.

func (Rewriter) OverwriteChangedFiles added in v0.12.0

func (r Rewriter) OverwriteChangedFiles() int32

OverwriteChangedFiles save all changed files to disk. Returns 1 if any files were not saved successfully, returns 0 otherwise.

func (Rewriter) RemoveText added in v0.12.0

func (r Rewriter) RemoveText(toBeRemoved SourceRange)

RemoveText remove the specified range.

func (Rewriter) ReplaceText added in v0.12.0

func (r Rewriter) ReplaceText(toBeReplaced SourceRange, replacement string)

ReplaceText replace the specified range of characters in the input with the specified replacement.

func (Rewriter) WriteMainFileToStdOut added in v0.12.0

func (r Rewriter) WriteMainFileToStdOut()

WriteMainFileToStdOut write out rewritten version of the main file to stdout.

type SaveError

type SaveError int32

SaveError describes the kind of error that occurred (if any) in a call to clang_saveTranslationUnit().

func (SaveError) Error

func (se SaveError) Error() string

func (SaveError) Spelling

func (se SaveError) Spelling() string

func (SaveError) String

func (se SaveError) String() string

type SaveTranslationUnit_Flags

type SaveTranslationUnit_Flags uint32

SaveTranslationUnit_Flags flags that control how translation units are saved.

The enumerators in this enumeration type are meant to be bitwise ORed together to specify which options should be used when saving the translation unit.

const (
	// SaveTranslationUnit_None used to indicate that no special saving options are needed.
	SaveTranslationUnit_None SaveTranslationUnit_Flags = C.CXSaveTranslationUnit_None
)

func (SaveTranslationUnit_Flags) Spelling

func (stuf SaveTranslationUnit_Flags) Spelling() string

func (SaveTranslationUnit_Flags) String

func (stuf SaveTranslationUnit_Flags) String() string

type SourceLocation

type SourceLocation struct {
	// contains filtered or unexported fields
}

SourceLocation identifies a specific source location within a translation unit.

Use clang_getExpansionLocation() or clang_getSpellingLocation() to map a source location to a particular file, line, and column.

func NewNullLocation

func NewNullLocation() SourceLocation

GetNullLocation retrieve a NULL (invalid) source location.

func (SourceLocation) Equal

func (sl SourceLocation) Equal(sl2 SourceLocation) bool

EqualLocations determine whether two source locations, which must refer into the same translation unit, refer to exactly the same point in the source code.

Returns non-zero if the source locations refer to the same location, zero if they refer to different locations.

func (SourceLocation) ExpansionLocation

func (sl SourceLocation) ExpansionLocation() (File, uint32, uint32, uint32)

GetExpansionLocation retrieve the file, line, column, and offset represented by the given source location.

If the location refers into a macro expansion, retrieves the location of the macro expansion.

Parameter location the location within a source file that will be decomposed into its parts.

Parameter file [out] if non-NULL, will be set to the file to which the given source location points.

Parameter line [out] if non-NULL, will be set to the line to which the given source location points.

Parameter column [out] if non-NULL, will be set to the column to which the given source location points.

Parameter offset [out] if non-NULL, will be set to the offset into the buffer to which the given source location points.

func (SourceLocation) FileLocation

func (sl SourceLocation) FileLocation() (File, uint32, uint32, uint32)

GetFileLocation retrieve the file, line, column, and offset represented by the given source location.

If the location refers into a macro expansion, return where the macro was expanded or where the macro argument was written, if the location points at a macro argument.

Parameter location the location within a source file that will be decomposed into its parts.

Parameter file [out] if non-NULL, will be set to the file to which the given source location points.

Parameter line [out] if non-NULL, will be set to the line to which the given source location points.

Parameter column [out] if non-NULL, will be set to the column to which the given source location points.

Parameter offset [out] if non-NULL, will be set to the offset into the buffer to which the given source location points.

func (SourceLocation) InstantiationLocation

func (sl SourceLocation) InstantiationLocation() (File, uint32, uint32, uint32)

GetInstantiationLocation legacy API to retrieve the file, line, column, and offset represented by the given source location.

This interface has been replaced by the newer interface #clang_getExpansionLocation(). See that interface's documentation for details.

func (SourceLocation) IsFromMainFile

func (sl SourceLocation) IsFromMainFile() bool

IsFromMainFile returns non-zero if the given source location is in the main file of the corresponding translation unit.

func (SourceLocation) IsInSystemHeader

func (sl SourceLocation) IsInSystemHeader() bool

IsInSystemHeader returns non-zero if the given source location is in a system header.

func (SourceLocation) PresumedLocation

func (sl SourceLocation) PresumedLocation() (string, uint32, uint32)

GetPresumedLocation retrieve the file, line and column represented by the given source location, as specified in a # line directive.

Example: given the following source code in a file somefile.c

#123 "dummy.c" 1

static int func(void)
{
return 0;
}

the location information returned by this function would be

File: dummy.c Line: 124 Column: 12

whereas clang_getExpansionLocation would have returned

File: somefile.c Line: 3 Column: 12

Parameter location the location within a source file that will be decomposed into its parts.

Parameter filename [out] if non-NULL, will be set to the filename of the source location. Note that filenames returned will be for "virtual" files, which don't necessarily exist on the machine running clang - e.g. when parsing preprocessed output obtained from a different environment. If a non-NULL value is passed in, remember to dispose of the returned value using clang_disposeString() once you've finished with it. For an invalid source location, an empty string is returned.

Parameter line [out] if non-NULL, will be set to the line number of the source location. For an invalid source location, zero is returned.

Parameter column [out] if non-NULL, will be set to the column number of the source location. For an invalid source location, zero is returned.

func (SourceLocation) Range

GetRange retrieve a source range given the beginning and ending source locations.

func (SourceLocation) SpellingLocation

func (sl SourceLocation) SpellingLocation() (File, uint32, uint32, uint32)

GetSpellingLocation retrieve the file, line, column, and offset represented by the given source location.

If the location refers into a macro instantiation, return where the location was originally spelled in the source file.

Parameter location the location within a source file that will be decomposed into its parts.

Parameter file [out] if non-NULL, will be set to the file to which the given source location points.

Parameter line [out] if non-NULL, will be set to the line to which the given source location points.

Parameter column [out] if non-NULL, will be set to the column to which the given source location points.

Parameter offset [out] if non-NULL, will be set to the offset into the buffer to which the given source location points.

type SourceRange

type SourceRange struct {
	// contains filtered or unexported fields
}

SourceRange identifies a half-open character range in the source code.

Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the starting and end locations from a source range, respectively.

func NewNullRange

func NewNullRange() SourceRange

GetNullRange retrieve a NULL (invalid) source range.

func (SourceRange) End

func (sr SourceRange) End() SourceLocation

GetRangeEnd retrieve a source location representing the last character within a source range.

func (SourceRange) Equal

func (sr SourceRange) Equal(sr2 SourceRange) bool

EqualRanges determine whether two ranges are equivalent.

Returns non-zero if the ranges are the same, zero if they differ.

func (SourceRange) IsNull

func (sr SourceRange) IsNull() bool

IsNull returns non-zero if range is null.

func (SourceRange) Start

func (sr SourceRange) Start() SourceLocation

GetRangeStart retrieve a source location representing the first character within a source range.

type SourceRangeList

type SourceRangeList struct {
	// contains filtered or unexported fields
}

SourceRangeList identifies an array of ranges.

func (SourceRangeList) Count

func (srl SourceRangeList) Count() uint32

count the number of ranges in the ranges array.

func (SourceRangeList) Ranges

func (srl SourceRangeList) Ranges() []SourceRange

ranges an array of CXSourceRanges.

type StorageClass

type StorageClass uint32

StorageClass represents the storage classes as declared in the source. CX_SC_Invalid was added for the case that the passed cursor in not a declaration.

func (StorageClass) Spelling

func (sc StorageClass) Spelling() string

func (StorageClass) String

func (sc StorageClass) String() string

type String

type String struct {
	// contains filtered or unexported fields
}

String a character string.

The CXString type is used to return strings from the interface when the ownership of that string might differ from one call to the next. Use clang_getCString() to retrieve the string data and, once finished with the string data, call clang_disposeString() to free the string.

func (String) Private_flags

func (s String) Private_flags() uint32

type StringSet

type StringSet struct {
	// contains filtered or unexported fields
}

func (StringSet) Count

func (ss StringSet) Count() uint32

func (StringSet) Strings

func (ss StringSet) Strings() []cxstring

type SymbolRole added in v0.7.0

type SymbolRole uint32

SymbolRole roles that are attributed to symbol occurrences.

Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with higher bits zeroed. These high bits may be exposed in the future.

func (SymbolRole) Spelling added in v0.7.0

func (sr SymbolRole) Spelling() string

func (SymbolRole) String added in v0.7.0

func (sr SymbolRole) String() string

type TLSKind added in v0.6.0

type TLSKind uint32

TLSKind describe the "thread-local storage (TLS) kind" of the declaration referred to by a cursor.

func (TLSKind) Spelling added in v0.6.0

func (tlsk TLSKind) Spelling() string

func (TLSKind) String added in v0.6.0

func (tlsk TLSKind) String() string

type TUResourceUsage

type TUResourceUsage struct {
	// contains filtered or unexported fields
}

TUResourceUsage the memory usage of a CXTranslationUnit, broken into categories.

func (TUResourceUsage) Dispose

func (turu TUResourceUsage) Dispose()

func (TUResourceUsage) Entries

func (turu TUResourceUsage) Entries() []TUResourceUsageEntry

func (TUResourceUsage) NumEntries

func (turu TUResourceUsage) NumEntries() uint32

type TUResourceUsageEntry

type TUResourceUsageEntry struct {
	// contains filtered or unexported fields
}

func (TUResourceUsageEntry) Amount

func (turue TUResourceUsageEntry) Amount() uint64

func (TUResourceUsageEntry) Kind

type TUResourceUsageKind

type TUResourceUsageKind uint32

TUResourceUsageKind categorizes how memory is being used by a translation unit.

func (TUResourceUsageKind) Name

func (turuk TUResourceUsageKind) Name() string

GetTUResourceUsageName returns the human-readable null-terminated C string that represents the name of the memory category. This string should never be freed.

func (TUResourceUsageKind) Spelling

func (turuk TUResourceUsageKind) Spelling() string

func (TUResourceUsageKind) String

func (turuk TUResourceUsageKind) String() string

type TargetInfo added in v0.5.0

type TargetInfo struct {
	// contains filtered or unexported fields
}

TargetInfo an opaque type representing target information for a given translation unit.

func (TargetInfo) Dispose added in v0.5.0

func (ti TargetInfo) Dispose()

Dispose destroy the CXTargetInfo object.

func (TargetInfo) PointerWidth added in v0.5.0

func (ti TargetInfo) PointerWidth() int32

PointerWidth get the pointer width of the target in bits.

Returns -1 in case of error.

func (TargetInfo) Triple added in v0.5.0

func (ti TargetInfo) Triple() string

Triple get the normalized target triple as a string.

Returns the empty string in case of any error.

type TemplateArgumentKind

type TemplateArgumentKind uint32

TemplateArgumentKind describes the kind of a template argument.

See the definition of llvm::clang::TemplateArgument::ArgKind for full element descriptions.

func (TemplateArgumentKind) Spelling

func (tak TemplateArgumentKind) Spelling() string

func (TemplateArgumentKind) String

func (tak TemplateArgumentKind) String() string

type Token

type Token struct {
	// contains filtered or unexported fields
}

Token describes a single preprocessing token.

func (Token) Kind

func (t Token) Kind() TokenKind

GetTokenKind determine the kind of the given token.

type TokenKind

type TokenKind uint32

TokenKind describes a kind of token.

func (TokenKind) Spelling

func (tk TokenKind) Spelling() string

func (TokenKind) String

func (tk TokenKind) String() string

type TranslationUnit

type TranslationUnit struct {
	// contains filtered or unexported fields
}

TranslationUnit a single translation unit, which resides in an index.

func (TranslationUnit) AllSkippedRanges added in v0.4.0

func (tu TranslationUnit) AllSkippedRanges() *SourceRangeList

GetAllSkippedRanges retrieve all ranges from all files that were skipped by the preprocessor.

The preprocessor will skip lines when they are surrounded by an if/ifdef/ifndef directive whose condition does not evaluate to true.

func (TranslationUnit) AnnotateTokens

func (tu TranslationUnit) AnnotateTokens(Tokens []Token) []Cursor

AnnotateTokens is the annotate the given set of tokens by providing cursors for each token that can be mapped to a specific entity within the abstract syntax tree.

This token-annotation routine is equivalent to invoking Cursor() for the source locations of each of the tokens. The cursors provided are filtered, so that only those cursors that have a direct correspondence to the token are accepted. For example, given a function call \c f(x), Cursor() would provide the following cursors:

  • when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'.
  • when the cursor is over the '(' or the ')', a CallExpr referring to 'f'.
  • when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'.

Only the first and last of these cursors will occur within the annotate, since the tokens "f" and "x' directly refer to a function and a variable, respectively, but the parentheses are just a small part of the full syntax of the function call expression, which is not provided as an annotation.

Tokens is the set of tokens to annotate.

Returns Cursors an array of NumTokens cursors, whose contents will be replaced with the cursors corresponding to each token.

func (TranslationUnit) CodeCompleteAt

func (tu TranslationUnit) CodeCompleteAt(completeFilename string, completeLine uint32, completeColumn uint32, unsavedFiles []UnsavedFile, options uint32) *CodeCompleteResults

CodeCompleteAt perform code completion at a given location in a translation unit.

This function performs code completion at a particular file, line, and column within source code, providing results that suggest potential code snippets based on the context of the completion. The basic model for code completion is that Clang will parse a complete source file, performing syntax checking up to the location where code-completion has been requested. At that point, a special code-completion token is passed to the parser, which recognizes this token and determines, based on the current location in the C/Objective-C/C++ grammar and the state of semantic analysis, what completions to provide. These completions are returned via a new CXCodeCompleteResults structure.

Code completion itself is meant to be triggered by the client when the user types punctuation characters or whitespace, at which point the code-completion location will coincide with the cursor. For example, if p is a pointer, code-completion might be triggered after the "-" and then after the ">" in p->. When the code-completion location is after the ">", the completion results will provide, e.g., the members of the struct that "p" points to. The client is responsible for placing the cursor at the beginning of the token currently being typed, then filtering the results based on the contents of the token. For example, when code-completing for the expression p->get, the client should provide the location just after the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the client can filter the results based on the current token text ("get"), only showing those results that start with "get". The intent of this interface is to separate the relatively high-latency acquisition of code-completion results from the filtering of results on a per-character basis, which must have a lower latency.

Parameter TU The translation unit in which code-completion should occur. The source files for this translation unit need not be completely up-to-date (and the contents of those source files may be overridden via unsaved_files). Cursors referring into the translation unit may be invalidated by this invocation.

Parameter complete_filename The name of the source file where code completion should be performed. This filename may be any file included in the translation unit.

Parameter complete_line The line at which code-completion should occur.

Parameter complete_column The column at which code-completion should occur. Note that the column should point just after the syntactic construct that initiated code completion, and not in the middle of a lexical token.

Parameter unsaved_files the Files that have not yet been saved to disk but may be required for parsing or code completion, including the contents of those files. The contents and name of these files (as specified by CXUnsavedFile) are copied when necessary, so the client only needs to guarantee their validity until the call to this function returns.

Parameter num_unsaved_files The number of unsaved file entries in \p unsaved_files.

Parameter options Extra options that control the behavior of code completion, expressed as a bitwise OR of the enumerators of the CXCodeComplete_Flags enumeration. The clang_defaultCodeCompleteOptions() function returns a default set of code-completion options.

Returns If successful, a new CXCodeCompleteResults structure containing code-completion results, which should eventually be freed with clang_disposeCodeCompleteResults(). If code completion fails, returns NULL.

func (TranslationUnit) Create added in v0.12.0

func (tu TranslationUnit) Create() Rewriter

Create create CXRewriter.

func (TranslationUnit) Cursor

func (tu TranslationUnit) Cursor(sl SourceLocation) Cursor

GetCursor map a source location to the cursor that describes the entity at that location in the source code.

GetCursor() maps an arbitrary source location within a translation unit down to the most specific cursor that describes the entity at that location. For example, given an expression x + y, invoking GetCursor() with a source location pointing to "x" will return the cursor for "x"; similarly for "y". If the cursor points anywhere between "x" or "y" (e.g., on the + or the whitespace around it), GetCursor() will return a cursor referring to the "+" expression.

Returns a cursor representing the entity at the given source location, or a NULL cursor if no such entity can be found.

func (TranslationUnit) DefaultReparseOptions

func (tu TranslationUnit) DefaultReparseOptions() uint32

DefaultReparseOptions returns the set of flags that is suitable for reparsing a translation unit.

The set of flags returned provide options for clang_reparseTranslationUnit() by default. The returned flag set contains an unspecified set of optimizations geared toward common uses of reparsing. The set of optimizations enabled may change from one version to the next.

func (TranslationUnit) DefaultSaveOptions

func (tu TranslationUnit) DefaultSaveOptions() uint32

DefaultSaveOptions returns the set of flags that is suitable for saving a translation unit.

The set of flags returned provide options for clang_saveTranslationUnit() by default. The returned flag set contains an unspecified set of options that save translation units with the most commonly-requested data.

func (TranslationUnit) Diagnostic

func (tu TranslationUnit) Diagnostic(index uint32) Diagnostic

GetDiagnostic retrieve a diagnostic associated with the given translation unit.

Parameter Unit the translation unit to query. Parameter Index the zero-based diagnostic number to retrieve.

Returns the requested diagnostic. This diagnostic must be freed via a call to clang_disposeDiagnostic().

func (TranslationUnit) DiagnosticSetFromTU

func (tu TranslationUnit) DiagnosticSetFromTU() DiagnosticSet

GetDiagnosticSetFromTU retrieve the complete set of diagnostics associated with a translation unit.

Parameter Unit the translation unit to query.

func (TranslationUnit) Diagnostics

func (tu TranslationUnit) Diagnostics() []Diagnostic

Diagnostics determine the number of diagnostics produced prior to the location where code completion was performed.

func (TranslationUnit) Dispose

func (tu TranslationUnit) Dispose()

DisposeTranslationUnit destroy the specified CXTranslationUnit object.

func (TranslationUnit) DisposeTokens

func (tu TranslationUnit) DisposeTokens(tokens []Token)

DisposeTokens free the given set of tokens.

func (TranslationUnit) File

func (tu TranslationUnit) File(fileName string) File

GetFile retrieve a file handle within the given translation unit.

Parameter tu the translation unit

Parameter file_name the name of the file.

Returns the file handle for the named file in the translation unit tu, or a NULL file handle if the file was not a part of this translation unit.

func (TranslationUnit) FindIncludesInFile

func (tu TranslationUnit) FindIncludesInFile(file File, visitor CursorAndRangeVisitor) Result

FindIncludesInFile find #import/#include directives in a specific file.

Parameter TU translation unit containing the file to query.

Parameter file to search for #import/#include directives.

Parameter visitor callback that will receive pairs of CXCursor/CXSourceRange for each directive found.

Returns one of the CXResult enumerators.

func (TranslationUnit) IsFileMultipleIncludeGuarded

func (tu TranslationUnit) IsFileMultipleIncludeGuarded(file File) bool

IsFileMultipleIncludeGuarded determine whether the given header is guarded against multiple inclusions, either with the conventional \#ifndef/\#define/\#endif macro guards or with \#pragma once.

func (TranslationUnit) IsValid

func (tu TranslationUnit) IsValid() bool

IsValid reports whether the tu is valid.

func (TranslationUnit) Location

func (tu TranslationUnit) Location(file File, line uint32, column uint32) SourceLocation

GetLocation retrieves the source location associated with a given file/line/column in a particular translation unit.

func (TranslationUnit) LocationForOffset

func (tu TranslationUnit) LocationForOffset(file File, offset uint32) SourceLocation

GetLocationForOffset retrieves the source location associated with a given character offset in a particular translation unit.

func (TranslationUnit) ModuleForFile

func (tu TranslationUnit) ModuleForFile(f File) Module

GetModuleForFile given a CXFile header file, return the module that contains it, if one exists.

func (TranslationUnit) Module_getNumTopLevelHeaders

func (tu TranslationUnit) Module_getNumTopLevelHeaders(module Module) uint32

Module_getNumTopLevelHeaders parameter Module a module object.

Returns the number of top level headers associated with this module.

func (TranslationUnit) Module_getTopLevelHeader

func (tu TranslationUnit) Module_getTopLevelHeader(module Module, index uint32) File

Module_getTopLevelHeader parameter Module a module object.

Parameter Index top level header index (zero-based).

Returns the specified top level header associated with the module.

func (TranslationUnit) NumDiagnostics

func (tu TranslationUnit) NumDiagnostics() uint32

GetNumDiagnostics determine the number of diagnostics produced for the given translation unit.

func (TranslationUnit) ReparseTranslationUnit

func (tu TranslationUnit) ReparseTranslationUnit(unsavedFiles []UnsavedFile, options uint32) int32

ReparseTranslationUnit reparse the source files that produced this translation unit.

This routine can be used to re-parse the source files that originally created the given translation unit, for example because those source files have changed (either on disk or as passed via unsaved_files). The source code will be reparsed with the same command-line options as it was originally parsed.

Reparsing a translation unit invalidates all cursors and source locations that refer into that translation unit. This makes reparsing a translation unit semantically equivalent to destroying the translation unit and then creating a new translation unit with the same command-line arguments. However, it may be more efficient to reparse a translation unit using this routine.

Parameter TU The translation unit whose contents will be re-parsed. The translation unit must originally have been built with clang_createTranslationUnitFromSourceFile().

Parameter num_unsaved_files The number of unsaved file entries in \p unsaved_files.

Parameter unsaved_files The files that have not yet been saved to disk but may be required for parsing, including the contents of those files. The contents and name of these files (as specified by CXUnsavedFile) are copied when necessary, so the client only needs to guarantee their validity until the call to this function returns.

Parameter options A bitset of options composed of the flags in CXReparse_Flags. The function clang_defaultReparseOptions() produces a default set of options recommended for most uses, based on the translation unit.

Returns 0 if the sources could be reparsed. A non-zero error code will be returned if reparsing was impossible, such that the translation unit is invalid. In such cases, the only valid call for TU is clang_disposeTranslationUnit(TU). The error codes returned by this routine are described by the CXErrorCode enum.

func (TranslationUnit) SaveTranslationUnit

func (tu TranslationUnit) SaveTranslationUnit(fileName string, options uint32) int32

SaveTranslationUnit saves a translation unit into a serialized representation of that translation unit on disk.

Any translation unit that was parsed without error can be saved into a file. The translation unit can then be deserialized into a new CXTranslationUnit with clang_createTranslationUnit() or, if it is an incomplete translation unit that corresponds to a header, used as a precompiled header when parsing other translation units.

Parameter TU The translation unit to save.

Parameter FileName The file to which the translation unit will be saved.

Parameter options A bitmask of options that affects how the translation unit is saved. This should be a bitwise OR of the CXSaveTranslationUnit_XXX flags.

Returns A value that will match one of the enumerators of the CXSaveError enumeration. Zero (CXSaveError_None) indicates that the translation unit was saved successfully, while a non-zero value indicates that a problem occurred.

func (TranslationUnit) SkippedRanges

func (tu TranslationUnit) SkippedRanges(file File) *SourceRangeList

GetSkippedRanges retrieve all ranges that were skipped by the preprocessor.

The preprocessor will skip lines when they are surrounded by an if/ifdef/ifndef directive whose condition does not evaluate to true.

func (TranslationUnit) Spelling

func (tu TranslationUnit) Spelling() string

GetTranslationUnitSpelling get the original translation unit source file name.

func (TranslationUnit) SuspendTranslationUnit added in v0.5.0

func (tu TranslationUnit) SuspendTranslationUnit() uint32

SuspendTranslationUnit suspend a translation unit in order to free memory associated with it.

A suspended translation unit uses significantly less memory but on the other side does not support any other calls than clang_reparseTranslationUnit to resume it or clang_disposeTranslationUnit to dispose it completely.

func (TranslationUnit) TUResourceUsage

func (tu TranslationUnit) TUResourceUsage() TUResourceUsage

GetCXTUResourceUsage return the memory usage of a translation unit. This object should be released with clang_disposeCXTUResourceUsage().

func (TranslationUnit) TargetInfo added in v0.5.0

func (tu TranslationUnit) TargetInfo() TargetInfo

GetTranslationUnitTargetInfo get target information for this translation unit.

The CXTargetInfo object cannot outlive the CXTranslationUnit object.

func (TranslationUnit) Token added in v0.7.0

func (tu TranslationUnit) Token(location SourceLocation) *Token

GetToken get the raw lexical token starting with the given location.

Parameter TU the translation unit whose text is being tokenized.

Parameter Location the source location with which the token starts.

Returns The token starting with the given location or NULL if no such token exist. The returned pointer must be freed with clang_disposeTokens before the translation unit is destroyed.

func (TranslationUnit) TokenExtent

func (tu TranslationUnit) TokenExtent(t Token) SourceRange

GetTokenExtent retrieve a source range that covers the given token.

func (TranslationUnit) TokenLocation

func (tu TranslationUnit) TokenLocation(t Token) SourceLocation

GetTokenLocation retrieve the source location of the given token.

func (TranslationUnit) TokenSpelling

func (tu TranslationUnit) TokenSpelling(t Token) string

GetTokenSpelling determine the spelling of the given token.

The spelling of a token is the textual representation of that token, e.g., the text of an identifier or keyword.

func (TranslationUnit) Tokenize

func (tu TranslationUnit) Tokenize(r SourceRange) []Token

Tokenize Tokenize the source code described by the given range into raw lexical tokens.

Parameter TU the translation unit whose text is being Tokenized.

Parameter Range the source range in which text should be Tokenized. All of the tokens produced by tokenization will fall within this source range,

Parameter Tokens this pointer will be set to point to the array of tokens that occur within the given source range. The returned pointer must be freed with clang_disposeTokens() before the translation unit is destroyed.

Parameter NumTokens will be set to the number of tokens in the *Tokens array.

func (TranslationUnit) TranslationUnitCursor

func (tu TranslationUnit) TranslationUnitCursor() Cursor

GetTranslationUnitCursor retrieve the cursor that represents the given translation unit.

The translation unit cursor can be used to start traversing the various declarations within the given translation unit.

type TranslationUnit_Flags

type TranslationUnit_Flags uint32

TranslationUnit_Flags flags that control the creation of translation units.

The enumerators in this enumeration type are meant to be bitwise ORed together to specify which options should be used when constructing the translation unit.

func (TranslationUnit_Flags) Spelling

func (tuf TranslationUnit_Flags) Spelling() string

func (TranslationUnit_Flags) String

func (tuf TranslationUnit_Flags) String() string

type Type

type Type struct {
	// contains filtered or unexported fields
}

Type the type of an element in the abstract syntax tree.

func (Type) AddressSpace added in v0.5.0

func (t Type) AddressSpace() uint32

GetAddressSpace returns the address space of the given type.

func (Type) AlignOf

func (t Type) AlignOf() int64

AlignOf return the alignment of a type in bytes as per C++[expr.alignof] standard.

If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the type declaration is a dependent type, CXTypeLayoutError_Dependent is returned. If the type declaration is not a constant size type, CXTypeLayoutError_NotConstantSize is returned.

func (Type) ArgType

func (t Type) ArgType(i uint32) Type

GetArgType retrieve the type of a parameter of a function type.

If a non-function type is passed in or the function does not have enough parameters, an invalid type is returned.

func (Type) ArrayElementType

func (t Type) ArrayElementType() Type

GetArrayElementType return the element type of an array type.

If a non-array type is passed in, an invalid type is returned.

func (Type) ArraySize

func (t Type) ArraySize() int64

GetArraySize return the array size of a constant array.

If a non-array type is passed in, -1 is returned.

func (Type) CanonicalType

func (t Type) CanonicalType() Type

GetCanonicalType return the canonical type for a CXType.

Clang's type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the "sugar" removed. For example, if 'T' is a typedef for 'int', the canonical type for 'T' would be 'int'.

func (Type) ClassType

func (t Type) ClassType() Type

ClassType return the class type of an member pointer type.

If a non-member-pointer type is passed in, an invalid type is returned.

func (Type) Declaration

func (t Type) Declaration() Cursor

GetTypeDeclaration return the cursor for the declaration of the given type.

func (Type) DefName added in v0.5.0

func (t Type) DefName() string

GetTypedefName returns the typedef name of the given type.

func (Type) ElementType

func (t Type) ElementType() Type

GetElementType return the element type of an array, complex, or vector type.

If a type is passed in that is not an array, complex, or vector type, an invalid type is returned.

func (Type) Encoding

func (t Type) Encoding() string

Encoding returns the Objective-C type encoding for the specified CXType.

func (Type) Equal

func (t Type) Equal(t2 Type) bool

EqualTypes determine whether two CXTypes represent the same type.

Returns non-zero if the CXTypes represent the same type and zero otherwise.

func (Type) ExceptionSpecificationType added in v0.5.0

func (t Type) ExceptionSpecificationType() int32

GetExceptionSpecificationType retrieve the exception specification type associated with a function type. This is a value of type CXCursor_ExceptionSpecificationKind.

If a non-function type is passed in, an error code of -1 is returned.

func (Type) FunctionTypeCallingConv

func (t Type) FunctionTypeCallingConv() CallingConv

GetFunctionTypeCallingConv retrieve the calling convention associated with a function type.

If a non-function type is passed in, CXCallingConv_Invalid is returned.

func (Type) IsConstQualifiedType

func (t Type) IsConstQualifiedType() bool

IsConstQualifiedType determine whether a CXType has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.

func (Type) IsFunctionTypeVariadic

func (t Type) IsFunctionTypeVariadic() bool

IsFunctionTypeVariadic return 1 if the CXType is a variadic function type, and 0 otherwise.

func (Type) IsPODType

func (t Type) IsPODType() bool

IsPODType return 1 if the CXType is a POD (plain old data) type, and 0 otherwise.

func (Type) IsRestrictQualifiedType

func (t Type) IsRestrictQualifiedType() bool

IsRestrictQualifiedType determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.

func (Type) IsTransparentTagTypedef added in v0.5.0

func (t Type) IsTransparentTagTypedef() bool

IsTransparentTagTypedef determine if a typedef is 'transparent' tag.

A typedef is considered 'transparent' if it shares a name and spelling location with its underlying tag type, as is the case with the NS_ENUM macro.

Returns non-zero if transparent and zero otherwise.

func (Type) IsVolatileQualifiedType

func (t Type) IsVolatileQualifiedType() bool

IsVolatileQualifiedType determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.

func (Type) Kind

func (t Type) Kind() TypeKind

func (Type) ModifiedType added in v0.8.0

func (t Type) ModifiedType() Type

ModifiedType return the type that was modified by this attributed type.

If the type is not an attributed type, an invalid type is returned.

func (Type) NamedType

func (t Type) NamedType() Type

NamedType retrieve the type named by the qualified-id.

If a non-elaborated type is passed in, an invalid type is returned.

func (Type) Nullability added in v0.8.0

func (t Type) Nullability() TypeNullabilityKind

Nullability retrieve the nullability kind of a pointer type.

func (Type) NumArgTypes

func (t Type) NumArgTypes() int32

GetNumArgTypes retrieve the number of non-variadic parameters associated with a function type.

If a non-function type is passed in, -1 is returned.

func (Type) NumElements

func (t Type) NumElements() int64

GetNumElements return the number of elements of an array or vector type.

If a type is passed in that is not an array or vector type, -1 is returned.

func (Type) NumObjCProtocolRefs added in v0.8.0

func (t Type) NumObjCProtocolRefs() uint32

NumObjCProtocolRefs retrieve the number of protocol references associated with an ObjC object/id.

If the type is not an ObjC object, 0 is returned.

func (Type) NumObjCTypeArgs added in v0.8.0

func (t Type) NumObjCTypeArgs() uint32

NumObjCTypeArgs retrieve the number of type arguments associated with an ObjC object.

If the type is not an ObjC object, 0 is returned.

func (Type) NumTemplateArguments

func (t Type) NumTemplateArguments() int32

NumTemplateArguments returns the number of template arguments for given template specialization, or -1 if type T is not a template specialization.

func (Type) ObjectBaseType added in v0.8.0

func (t Type) ObjectBaseType() Type

ObjectBaseType retrieves the base type of the ObjCObjectType.

If the type is not an ObjC object, an invalid type is returned.

func (Type) OffsetOf

func (t Type) OffsetOf(s string) int64

OffsetOf return the offset of a field named S in a record of type T in bits as it would be returned by __offsetof__ as per C++11[18.2p4]

If the cursor is not a record field declaration, CXTypeLayoutError_Invalid is returned. If the field's type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the field's type declaration is a dependent type, CXTypeLayoutError_Dependent is returned. If the field's name S is not found, CXTypeLayoutError_InvalidFieldName is returned.

func (Type) PointeeType

func (t Type) PointeeType() Type

GetPointeeType for pointer types, returns the type of the pointee.

func (Type) ProtocolDecl added in v0.8.0

func (t Type) ProtocolDecl(i uint32) Cursor

ProtocolDecl retrieve the decl for a protocol reference for an ObjC object/id.

If the type is not an ObjC object or there are not enough protocol references, an invalid cursor is returned.

func (Type) RefQualifier

func (t Type) RefQualifier() RefQualifierKind

RefQualifier retrieve the ref-qualifier kind of a function or method.

The ref-qualifier is returned for C++ functions or methods. For other types or non-C++ declarations, CXRefQualifier_None is returned.

func (Type) ResultType

func (t Type) ResultType() Type

GetResultType retrieve the return type associated with a function type.

If a non-function type is passed in, an invalid type is returned.

func (Type) SizeOf

func (t Type) SizeOf() int64

SizeOf return the size of a type in bytes as per C++[expr.sizeof] standard.

If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete is returned. If the type declaration is a dependent type, CXTypeLayoutError_Dependent is returned.

func (Type) Spelling

func (t Type) Spelling() string

GetTypeSpelling pretty-print the underlying type using the rules of the language of the translation unit from which it came.

If the type is invalid, an empty string is returned.

func (Type) TemplateArgumentAsType

func (t Type) TemplateArgumentAsType(i uint32) Type

TemplateArgumentAsType returns the type template argument of a template class specialization at given index.

This function only returns template type arguments and does not handle template template arguments or variadic packs.

func (Type) TypeArg added in v0.8.0

func (t Type) TypeArg(i uint32) Type

TypeArg retrieve a type argument associated with an ObjC object.

If the type is not an ObjC or the index is not valid, an invalid type is returned.

func (Type) ValueType added in v0.11.0

func (t Type) ValueType() Type

ValueType gets the type contained by this atomic type.

If a non-atomic type is passed in, an invalid type is returned.

type TypeKind

type TypeKind uint32

TypeKind describes the kind of type

func (TypeKind) Spelling

func (tk TypeKind) Spelling() string

GetTypeKindSpelling retrieve the spelling of a given CXTypeKind.

func (TypeKind) String

func (tk TypeKind) String() string

type TypeLayoutError

type TypeLayoutError int32

TypeLayoutError list the possible error codes for clang_Type_getSizeOf, clang_Type_getAlignOf, clang_Type_getOffsetOf and clang_Cursor_getOffsetOf.

A value of this enumeration type can be returned if the target type is not a valid argument to sizeof, alignof or offsetof.

func (TypeLayoutError) Error

func (tle TypeLayoutError) Error() string

func (TypeLayoutError) Spelling

func (tle TypeLayoutError) Spelling() string

func (TypeLayoutError) String

func (tle TypeLayoutError) String() string

type TypeNullabilityKind added in v0.8.0

type TypeNullabilityKind uint32

func (TypeNullabilityKind) Spelling added in v0.8.0

func (tnk TypeNullabilityKind) Spelling() string

func (TypeNullabilityKind) String added in v0.8.0

func (tnk TypeNullabilityKind) String() string

type UnsavedFile

type UnsavedFile struct {
	// contains filtered or unexported fields
}

UnsavedFile provides the contents of a file that has not yet been saved to disk.

Each CXUnsavedFile instance provides the name of a file on the system along with the current contents of that file that have not yet been saved to disk.

func NewUnsavedFile

func NewUnsavedFile(filename, contents string) UnsavedFile

NewUnsavedFile returns the new UnsavedFile from filename and contents.

func (UnsavedFile) Contents

func (uf UnsavedFile) Contents() string

Contents a buffer containing the unsaved contents of this file.

func (UnsavedFile) Filename

func (uf UnsavedFile) Filename() string

Filename the file whose contents have not yet been saved.

This file must already exist in the file system.

func (UnsavedFile) Length

func (uf UnsavedFile) Length() uint64

Length the length of the unsaved contents of this buffer.

type Version

type Version struct {
	// contains filtered or unexported fields
}

Version describes a version number of the form major.minor.subminor.

func (Version) Major

func (v Version) Major() int32

Major the major version number, e.g., the '10' in '10.7.3'. A negative value indicates that there is no version number at all.

func (Version) Minor

func (v Version) Minor() int32

Minor the minor version number, e.g., the '7' in '10.7.3'. This value will be negative if no minor version number was provided, e.g., for version '10'.

func (Version) Subminor

func (v Version) Subminor() int32

Subminor the subminor version number, e.g., the '3' in '10.7.3'. This value will be negative if no minor or subminor version number was provided, e.g., in version '10' or '10.7'.

type VirtualFileOverlay

type VirtualFileOverlay struct {
	// contains filtered or unexported fields
}

VirtualFileOverlay object encapsulating information about overlaying virtual file/directories over the real file system.

func NewVirtualFileOverlay

func NewVirtualFileOverlay(options uint32) VirtualFileOverlay

NewVirtualFileOverlay create a CXVirtualFileOverlay object. Must be disposed with clang_VirtualFileOverlay_dispose().

Parameter options is reserved, always pass 0.

func (VirtualFileOverlay) AddFileMapping

func (vfo VirtualFileOverlay) AddFileMapping(virtualPath string, realPath string) ErrorCode

AddFileMapping map an absolute virtual file path to an absolute real one. The virtual path must be canonicalized (not contain "."/".."). Returns 0 for success, non-zero to indicate an error.

func (VirtualFileOverlay) Dispose

func (vfo VirtualFileOverlay) Dispose()

Dispose dispose a CXVirtualFileOverlay object.

func (VirtualFileOverlay) SetCaseSensitivity

func (vfo VirtualFileOverlay) SetCaseSensitivity(caseSensitive int32) ErrorCode

SetCaseSensitivity set the case sensitivity for the CXVirtualFileOverlay object. The CXVirtualFileOverlay object is case-sensitive by default, this option can be used to override the default. Returns 0 for success, non-zero to indicate an error.

func (VirtualFileOverlay) WriteToBuffer

func (vfo VirtualFileOverlay) WriteToBuffer(options uint32) (string, uint32, ErrorCode)

WriteToBuffer write out the CXVirtualFileOverlay object to a char buffer.

Parameter options is reserved, always pass 0. Parameter out_buffer_ptr pointer to receive the buffer pointer, which should be disposed using clang_free(). Parameter out_buffer_size pointer to receive the buffer size. Returns 0 for success, non-zero to indicate an error.

type VisibilityKind

type VisibilityKind uint32

func (VisibilityKind) Spelling

func (vk VisibilityKind) Spelling() string

func (VisibilityKind) String

func (vk VisibilityKind) String() string

type VisitorResult

type VisitorResult uint32
const (
	Visit_Break    VisitorResult = C.CXVisit_Break
	Visit_Continue               = C.CXVisit_Continue
)

func (VisitorResult) Spelling

func (vr VisitorResult) Spelling() string

func (VisitorResult) String

func (vr VisitorResult) String() string

Source Files

Directories

Path Synopsis
Package clang_c holds clang binding C header files.
Package clang_c holds clang binding C header files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL