Skip to content

Commit

Permalink
clang: update to clang v11
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <[email protected]>
  • Loading branch information
zchee committed Nov 20, 2021
1 parent a52155a commit e1e0f98
Show file tree
Hide file tree
Showing 9 changed files with 581 additions and 573 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- "main"

env:
LLVM_VERSION: 10
LLVM_VERSION: 11

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion clang/clang-c/BuildSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
const char *name);

/**
* Sets the umbrealla header name that the module.map describes.
* Sets the umbrella header name that the module.map describes.
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
Expand Down
1,065 changes: 518 additions & 547 deletions clang/clang-c/Index.h

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions clang/clang-c/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@

LLVM_CLANG_C_EXTERN_C_BEGIN

/* MSVC DLL import/export. */
#ifdef _MSC_VER
#ifdef _CINDEX_LIB_
#define CINDEX_LINKAGE __declspec(dllexport)
#else
#define CINDEX_LINKAGE __declspec(dllimport)
/* Windows DLL import/export. */
#ifndef CINDEX_NO_EXPORTS
#define CINDEX_EXPORTS
#endif
#ifdef _WIN32
#ifdef CINDEX_EXPORTS
#ifdef _CINDEX_LIB_
#define CINDEX_LINKAGE __declspec(dllexport)
#else
#define CINDEX_LINKAGE __declspec(dllimport)
#endif
#endif
#else
#elif defined(CINDEX_EXPORTS) && defined(__GNUC__)
#define CINDEX_LINKAGE __attribute__((visibility("default")))
#endif

#ifndef CINDEX_LINKAGE
#define CINDEX_LINKAGE
#endif

Expand Down
23 changes: 12 additions & 11 deletions clang/cursor_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ func (c Cursor) EnumDeclIntegerType() Type {
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.
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 (c Cursor) EnumConstantDeclValue() int64 {
return int64(C.clang_getEnumConstantDeclValue(c.c))
Expand All @@ -349,9 +349,9 @@ func (c Cursor) EnumConstantDeclValue() int64 {
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.
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 (c Cursor) EnumConstantDeclUnsignedValue() uint64 {
return uint64(C.clang_getEnumConstantDeclUnsignedValue(c.c))
Expand Down Expand Up @@ -534,7 +534,8 @@ func (c Cursor) ResultType() Type {
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.
This only returns a valid result if the cursor refers to a function or
method.
*/
func (c Cursor) ExceptionSpecificationType() int32 {
return int32(C.clang_getCursorExceptionSpecificationType(c.c))
Expand Down Expand Up @@ -595,9 +596,9 @@ func (c Cursor) IsVirtualBase() bool {
/*
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.
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 (c Cursor) AccessSpecifier() AccessSpecifier {
return AccessSpecifier(C.clang_getCXXAccessSpecifier(c.c))
Expand Down Expand Up @@ -1168,7 +1169,7 @@ func (c Cursor) CompletionString() CompletionString {
return CompletionString{C.clang_getCursorCompletionString(c.c)}
}

// 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 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 (c Cursor) Evaluate() EvalResult {
return EvalResult{C.clang_Cursor_Evaluate(c.c)}
}
Expand Down
18 changes: 14 additions & 4 deletions clang/cursorkind_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ const (
\endcode
*/
Cursor_CXXFunctionalCastExpr = C.CXCursor_CXXFunctionalCastExpr
// OpenCL's addrspace_cast<> expression.
Cursor_CXXAddrspaceCastExpr = C.CXCursor_CXXAddrspaceCastExpr
// A C++ typeid expression (C++ [expr.typeid]).
Cursor_CXXTypeidExpr = C.CXCursor_CXXTypeidExpr
// [C++ 2.13.5] C++ Boolean Literal.
Expand Down Expand Up @@ -376,15 +378,19 @@ const (
Cursor_ObjCBoolLiteralExpr = C.CXCursor_ObjCBoolLiteralExpr
// Represents the "self" expression in an Objective-C method.
Cursor_ObjCSelfExpr = C.CXCursor_ObjCSelfExpr
// OpenMP 4.0 [2.4, Array Section].
// OpenMP 5.0 [2.1.5, Array Section].
Cursor_OMPArraySectionExpr = C.CXCursor_OMPArraySectionExpr
// Represents an @available(...) check.
Cursor_ObjCAvailabilityCheckExpr = C.CXCursor_ObjCAvailabilityCheckExpr
// Fixed point literal
Cursor_FixedPointLiteral = C.CXCursor_FixedPointLiteral
// Fixed point literal
// OpenMP 5.0 [2.1.4, Array Shaping].
Cursor_OMPArrayShapingExpr = C.CXCursor_OMPArrayShapingExpr
// OpenMP 5.0 [2.1.6 Iterators]
Cursor_OMPIteratorExpr = C.CXCursor_OMPIteratorExpr
// OpenMP 5.0 [2.1.6 Iterators]
Cursor_LastExpr = C.CXCursor_LastExpr
// Fixed point literal
// OpenMP 5.0 [2.1.6 Iterators]
Cursor_FirstStmt = C.CXCursor_FirstStmt
/*
A statement whose specific kind is not exposed via this
Expand Down Expand Up @@ -587,7 +593,11 @@ const (
Cursor_OMPParallelMasterTaskLoopSimdDirective = C.CXCursor_OMPParallelMasterTaskLoopSimdDirective
// OpenMP parallel master directive.
Cursor_OMPParallelMasterDirective = C.CXCursor_OMPParallelMasterDirective
// OpenMP parallel master directive.
// OpenMP depobj directive.
Cursor_OMPDepobjDirective = C.CXCursor_OMPDepobjDirective
// OpenMP scan directive.
Cursor_OMPScanDirective = C.CXCursor_OMPScanDirective
// OpenMP scan directive.
Cursor_LastStmt = C.CXCursor_LastStmt
/*
Cursor that represents the translation unit itself.
Expand Down
2 changes: 1 addition & 1 deletion clang/modulemapdescriptor_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (mmd ModuleMapDescriptor) SetFrameworkModuleName(name string) ErrorCode {
return ErrorCode(C.clang_ModuleMapDescriptor_setFrameworkModuleName(mmd.c, c_name))
}

// Sets the umbrealla header name that the module.map describes. Returns 0 for success, non-zero to indicate an error.
// Sets the umbrella header name that the module.map describes. Returns 0 for success, non-zero to indicate an error.
func (mmd ModuleMapDescriptor) SetUmbrellaHeader(name string) ErrorCode {
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
Expand Down
11 changes: 10 additions & 1 deletion clang/type_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (t Type) ProtocolDecl(i uint32) Cursor {
}

/*
Retreive the number of type arguments associated with an ObjC object.
Retrieve the number of type arguments associated with an ObjC object.
If the type is not an ObjC object, 0 is returned.
*/
Expand Down Expand Up @@ -341,6 +341,15 @@ func (t Type) ModifiedType() Type {
return Type{C.clang_Type_getModifiedType(t.c)}
}

/*
Gets the type contained by this atomic type.
If a non-atomic type is passed in, an invalid type is returned.
*/
func (t Type) ValueType() Type {
return Type{C.clang_Type_getValueType(t.c)}
}

// Returns the number of template arguments for given template specialization, or -1 if type T is not a template specialization.
func (t Type) NumTemplateArguments() int32 {
return int32(C.clang_Type_getNumTemplateArguments(t.c))
Expand Down
8 changes: 8 additions & 0 deletions clang/typekind_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const (
// A type whose specific kind is not exposed via this interface.
Type_ULongAccum = C.CXType_ULongAccum
// A type whose specific kind is not exposed via this interface.
Type_BFloat16 = C.CXType_BFloat16
// A type whose specific kind is not exposed via this interface.
Type_FirstBuiltin = C.CXType_FirstBuiltin
// A type whose specific kind is not exposed via this interface.
Type_LastBuiltin = C.CXType_LastBuiltin
Expand Down Expand Up @@ -476,6 +478,12 @@ const (
E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
*/
Type_ExtVector = C.CXType_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_Atomic = C.CXType_Atomic
)

// Retrieve the spelling of a given CXTypeKind.
Expand Down

0 comments on commit e1e0f98

Please sign in to comment.