Skip to content

Commit

Permalink
clang: update to clang v13.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee committed Mar 22, 2022
1 parent cb31e70 commit b39ca1f
Show file tree
Hide file tree
Showing 92 changed files with 3,144 additions and 3,874 deletions.
2 changes: 1 addition & 1 deletion clang/accessspecifier_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package clang
import "C"
import "fmt"

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

const (
Expand Down
10 changes: 5 additions & 5 deletions clang/availabilitykind_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ package clang
import "C"
import "fmt"

// 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.
// 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.
type AvailabilityKind uint32

const (
// The entity is available.
// Availability_Available the entity is available.
Availability_Available AvailabilityKind = C.CXAvailability_Available
// The entity is available, but has been deprecated (and its use is not recommended).
// Availability_Deprecated the entity is available, but has been deprecated (and its use is not recommended).
Availability_Deprecated = C.CXAvailability_Deprecated
// The entity is not available; any use of it will be an error.
// Availability_NotAvailable the entity is not available; any use of it will be an error.
Availability_NotAvailable = C.CXAvailability_NotAvailable
// The entity is available, but not accessible; any use of it will be an error.
// Availability_NotAccessible the entity is available, but not accessible; any use of it will be an error.
Availability_NotAccessible = C.CXAvailability_NotAccessible
)

Expand Down
2 changes: 1 addition & 1 deletion clang/callingconv_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package clang
import "C"
import "fmt"

// Describes the calling convention of a function type
// CallingConv describes the calling convention of a function type
type CallingConv uint32

const (
Expand Down
18 changes: 8 additions & 10 deletions clang/childvisitresult_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ package clang
import "C"
import "fmt"

/*
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.
*/
// 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.
type ChildVisitResult uint32

const (
// Terminates the cursor traversal.
// ChildVisit_Break terminates the cursor traversal.
ChildVisit_Break ChildVisitResult = C.CXChildVisit_Break
// Continues the cursor traversal with the next sibling of the cursor just visited, without visiting its children.
// ChildVisit_Continue continues the cursor traversal with the next sibling of the cursor just visited, without visiting its children.
ChildVisit_Continue = C.CXChildVisit_Continue
// Recursively traverse the children of this cursor, using the same visitor and client data.
// ChildVisit_Recurse recursively traverse the children of this cursor, using the same visitor and client data.
ChildVisit_Recurse = C.CXChildVisit_Recurse
)

Expand Down
84 changes: 38 additions & 46 deletions clang/clang_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,60 @@ package clang
import "C"
import "unsafe"

// Return the timestamp for use with Clang's -fbuild-session-timestamp= option.
// GetBuildSessionTimestamp return the timestamp for use with Clang's -fbuild-session-timestamp= option.
func GetBuildSessionTimestamp() uint64 {
return uint64(C.clang_getBuildSessionTimestamp())
}

// Installs error handler that prints error message to stderr and calls abort(). Replaces currently installed error handler (if any).
// 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 InstallAbortingFatalErrorHandler() {
C.clang_install_aborting_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).
// 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).
func UninstallFatalErrorHandler() {
C.clang_uninstall_llvm_fatal_error_handler()
}

/*
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().
*/
// 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 DefaultDiagnosticDisplayOptions() uint32 {
return uint32(C.clang_defaultDiagnosticDisplayOptions())
}

/*
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.
*/
// 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 GetDiagnosticCategoryName(category uint32) string {
o := cxstring{C.clang_getDiagnosticCategoryName(C.uint(category))}
defer o.Dispose()

return o.String()
}

/*
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.
*/
// 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 DefaultEditingTranslationUnitOptions() uint32 {
return uint32(C.clang_defaultEditingTranslationUnitOptions())
}

// Construct a USR for a specified Objective-C class.
// ConstructUSR_ObjCClass construct a USR for a specified Objective-C class.
func ConstructUSR_ObjCClass(className string) string {
c_className := C.CString(className)
defer C.free(unsafe.Pointer(c_className))
Expand All @@ -77,7 +71,7 @@ func ConstructUSR_ObjCClass(className string) string {
return o.String()
}

// Construct a USR for a specified Objective-C category.
// ConstructUSR_ObjCCategory construct a USR for a specified Objective-C category.
func ConstructUSR_ObjCCategory(className string, categoryName string) string {
c_className := C.CString(className)
defer C.free(unsafe.Pointer(c_className))
Expand All @@ -90,7 +84,7 @@ func ConstructUSR_ObjCCategory(className string, categoryName string) string {
return o.String()
}

// Construct a USR for a specified Objective-C protocol.
// ConstructUSR_ObjCProtocol construct a USR for a specified Objective-C protocol.
func ConstructUSR_ObjCProtocol(protocolName string) string {
c_protocolName := C.CString(protocolName)
defer C.free(unsafe.Pointer(c_protocolName))
Expand All @@ -101,7 +95,7 @@ func ConstructUSR_ObjCProtocol(protocolName string) string {
return o.String()
}

// Construct a USR for a specified Objective-C instance variable and the USR for its containing class.
// ConstructUSR_ObjCIvar construct a USR for a specified Objective-C instance variable and the USR for its containing class.
func ConstructUSR_ObjCIvar(name string, classUSR cxstring) string {
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
Expand All @@ -112,7 +106,7 @@ func ConstructUSR_ObjCIvar(name string, classUSR cxstring) string {
return o.String()
}

// Construct a USR for a specified Objective-C method and the USR for its containing class.
// ConstructUSR_ObjCMethod construct a USR for a specified Objective-C method and the USR for its containing class.
func ConstructUSR_ObjCMethod(name string, isInstanceMethod uint32, classUSR cxstring) string {
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
Expand All @@ -123,7 +117,7 @@ func ConstructUSR_ObjCMethod(name string, isInstanceMethod uint32, classUSR cxst
return o.String()
}

// Construct a USR for a specified Objective-C property and the USR for its containing class.
// ConstructUSR_ObjCProperty construct a USR for a specified Objective-C property and the USR for its containing class.
func ConstructUSR_ObjCProperty(property string, classUSR cxstring) string {
c_property := C.CString(property)
defer C.free(unsafe.Pointer(c_property))
Expand All @@ -138,25 +132,23 @@ func EnableStackTraces() {
C.clang_enableStackTraces()
}

// Returns a default set of code-completion options that can be passed toclang_codeCompleteAt().
// DefaultCodeCompleteOptions returns a default set of code-completion options that can be passed toclang_codeCompleteAt().
func DefaultCodeCompleteOptions() uint32 {
return uint32(C.clang_defaultCodeCompleteOptions())
}

// Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable).
// 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 GetClangVersion() string {
o := cxstring{C.clang_getClangVersion()}
defer o.Dispose()

return o.String()
}

/*
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.
*/
// 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 ToggleCrashRecovery(isEnabled uint32) {
C.clang_toggleCrashRecovery(C.uint(isEnabled))
}
2 changes: 1 addition & 1 deletion clang/clientdata_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package clang
// #include "go-clang.h"
import "C"

// Opaque pointer representing client data that will be passed through to various callbacks and visitors.
// ClientData opaque pointer representing client data that will be passed through to various callbacks and visitors.
type ClientData struct {
c C.CXClientData
}
22 changes: 10 additions & 12 deletions clang/codecomplete_flags_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ package clang
import "C"
import "fmt"

/*
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().
*/
// 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().
type CodeComplete_Flags uint32

const (
// Whether to include macros within the set of code completions returned.
// CodeComplete_IncludeMacros whether to include macros within the set of code completions returned.
CodeComplete_IncludeMacros CodeComplete_Flags = C.CXCodeComplete_IncludeMacros
// Whether to include code patterns for language constructs within the set of code completions, e.g., for loops.
// 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
// Whether to include brief documentation within the set of code completions returned.
// CodeComplete_IncludeBriefComments whether to include brief documentation within the set of code completions returned.
CodeComplete_IncludeBriefComments = C.CXCodeComplete_IncludeBriefComments
// 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 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
// Whether to include completions with small fix-its, e.g. change '.' to '->' on member access, etc.
// CodeComplete_IncludeCompletionsWithFixIts whether to include completions with small fix-its, e.g. change '.' to '->' on member access, etc.
CodeComplete_IncludeCompletionsWithFixIts = C.CXCodeComplete_IncludeCompletionsWithFixIts
)

Expand Down
Loading

0 comments on commit b39ca1f

Please sign in to comment.