clang API Documentation
|
Classes | |
| struct | CXType |
| The type of an element in the abstract syntax tree. More... | |
Enumerations | |
| enum | CXTypeKind { CXType_Invalid = 0, CXType_Unexposed = 1, CXType_Void = 2, CXType_Bool = 3, CXType_Char_U = 4, CXType_UChar = 5, CXType_Char16 = 6, CXType_Char32 = 7, CXType_UShort = 8, CXType_UInt = 9, CXType_ULong = 10, CXType_ULongLong = 11, CXType_UInt128 = 12, CXType_Char_S = 13, CXType_SChar = 14, CXType_WChar = 15, CXType_Short = 16, CXType_Int = 17, CXType_Long = 18, CXType_LongLong = 19, CXType_Int128 = 20, CXType_Float = 21, CXType_Double = 22, CXType_LongDouble = 23, CXType_NullPtr = 24, CXType_Overload = 25, CXType_Dependent = 26, CXType_ObjCId = 27, CXType_ObjCClass = 28, CXType_ObjCSel = 29, CXType_FirstBuiltin = CXType_Void, CXType_LastBuiltin = CXType_ObjCSel, CXType_Complex = 100, CXType_Pointer = 101, CXType_BlockPointer = 102, CXType_LValueReference = 103, CXType_RValueReference = 104, CXType_Record = 105, CXType_Enum = 106, CXType_Typedef = 107, CXType_ObjCInterface = 108, CXType_ObjCObjectPointer = 109, CXType_FunctionNoProto = 110, CXType_FunctionProto = 111, CXType_ConstantArray = 112, CXType_Vector = 113 } |
| Describes the kind of type. More... | |
| enum | CXCallingConv { CXCallingConv_Default = 0, CXCallingConv_C = 1, CXCallingConv_X86StdCall = 2, CXCallingConv_X86FastCall = 3, CXCallingConv_X86ThisCall = 4, CXCallingConv_X86Pascal = 5, CXCallingConv_AAPCS = 6, CXCallingConv_AAPCS_VFP = 7, CXCallingConv_PnaclCall = 8, CXCallingConv_IntelOclBicc = 9, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 } |
| Describes the calling convention of a function type. More... | |
| enum | CXTypeLayoutError { CXTypeLayoutError_Invalid = -1, CXTypeLayoutError_Incomplete = -2, CXTypeLayoutError_Dependent = -3, CXTypeLayoutError_NotConstantSize = -4, CXTypeLayoutError_InvalidFieldName = -5 } |
List the possible error codes for clang_Type_getSizeOf, clang_Type_getAlignOf, clang_Type_getOffsetOf and clang_Cursor_getOffsetOf. More... | |
| enum | CX_CXXAccessSpecifier { CX_CXXInvalidAccessSpecifier, CX_CXXPublic, CX_CXXProtected, CX_CXXPrivate } |
| Represents the C++ access control level to a base class for a cursor with kind CX_CXXBaseSpecifier. More... | |
Functions | |
| CINDEX_LINKAGE CXType | clang_getCursorType (CXCursor C) |
| Retrieve the type of a CXCursor (if any). | |
| CINDEX_LINKAGE CXString | clang_getTypeSpelling (CXType CT) |
| Pretty-print the underlying type using the rules of the language of the translation unit from which it came. | |
| CINDEX_LINKAGE CXType | clang_getTypedefDeclUnderlyingType (CXCursor C) |
| Retrieve the underlying type of a typedef declaration. | |
| CINDEX_LINKAGE CXType | clang_getEnumDeclIntegerType (CXCursor C) |
| Retrieve the integer type of an enum declaration. | |
| CINDEX_LINKAGE long long | clang_getEnumConstantDeclValue (CXCursor C) |
| Retrieve the integer value of an enum constant declaration as a signed long long. | |
| CINDEX_LINKAGE unsigned long long | clang_getEnumConstantDeclUnsignedValue (CXCursor C) |
| Retrieve the integer value of an enum constant declaration as an unsigned long long. | |
| CINDEX_LINKAGE int | clang_getFieldDeclBitWidth (CXCursor C) |
| Retrieve the bit width of a bit field declaration as an integer. | |
| CINDEX_LINKAGE int | clang_Cursor_getNumArguments (CXCursor C) |
| Retrieve the number of non-variadic arguments associated with a given cursor. | |
| CINDEX_LINKAGE CXCursor | clang_Cursor_getArgument (CXCursor C, unsigned i) |
| Retrieve the argument cursor of a function or method. | |
| CINDEX_LINKAGE unsigned | clang_equalTypes (CXType A, CXType B) |
| Determine whether two CXTypes represent the same type. | |
| CINDEX_LINKAGE CXType | clang_getCanonicalType (CXType T) |
| Return the canonical type for a CXType. | |
| CINDEX_LINKAGE unsigned | clang_isConstQualifiedType (CXType T) |
| Determine whether a CXType has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level. | |
| CINDEX_LINKAGE unsigned | clang_isVolatileQualifiedType (CXType T) |
| Determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level. | |
| CINDEX_LINKAGE unsigned | clang_isRestrictQualifiedType (CXType T) |
| Determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level. | |
| CINDEX_LINKAGE CXType | clang_getPointeeType (CXType T) |
| For pointer types, returns the type of the pointee. | |
| CINDEX_LINKAGE CXCursor | clang_getTypeDeclaration (CXType T) |
| Return the cursor for the declaration of the given type. | |
| CINDEX_LINKAGE CXString | clang_getDeclObjCTypeEncoding (CXCursor C) |
| CINDEX_LINKAGE CXString | clang_getTypeKindSpelling (enum CXTypeKind K) |
| Retrieve the spelling of a given CXTypeKind. | |
| CINDEX_LINKAGE enum CXCallingConv | clang_getFunctionTypeCallingConv (CXType T) |
| Retrieve the calling convention associated with a function type. | |
| CINDEX_LINKAGE CXType | clang_getResultType (CXType T) |
| Retrieve the result type associated with a function type. | |
| CINDEX_LINKAGE int | clang_getNumArgTypes (CXType T) |
| Retrieve the number of non-variadic arguments associated with a function type. | |
| CINDEX_LINKAGE CXType | clang_getArgType (CXType T, unsigned i) |
| Retrieve the type of an argument of a function type. | |
| CINDEX_LINKAGE unsigned | clang_isFunctionTypeVariadic (CXType T) |
| Return 1 if the CXType is a variadic function type, and 0 otherwise. | |
| CINDEX_LINKAGE CXType | clang_getCursorResultType (CXCursor C) |
| Retrieve the result type associated with a given cursor. | |
| CINDEX_LINKAGE unsigned | clang_isPODType (CXType T) |
| Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. | |
| CINDEX_LINKAGE CXType | clang_getElementType (CXType T) |
| Return the element type of an array, complex, or vector type. | |
| CINDEX_LINKAGE long long | clang_getNumElements (CXType T) |
| Return the number of elements of an array or vector type. | |
| CINDEX_LINKAGE CXType | clang_getArrayElementType (CXType T) |
| Return the element type of an array type. | |
| CINDEX_LINKAGE long long | clang_getArraySize (CXType T) |
| Return the array size of a constant array. | |
| CINDEX_LINKAGE long long | clang_Type_getAlignOf (CXType T) |
| Return the alignment of a type in bytes as per C++[expr.alignof] standard. | |
| CINDEX_LINKAGE long long | clang_Type_getSizeOf (CXType T) |
| Return the size of a type in bytes as per C++[expr.sizeof] standard. | |
| CINDEX_LINKAGE long long | clang_Type_getOffsetOf (CXType T, const char *S) |
| 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]. | |
| CINDEX_LINKAGE unsigned | clang_Cursor_isBitField (CXCursor C) |
| Returns non-zero if the cursor specifies a Record member that is a bitfield. | |
| CINDEX_LINKAGE unsigned | clang_isVirtualBase (CXCursor) |
| Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual. | |
| CINDEX_LINKAGE enum CX_CXXAccessSpecifier | clang_getCXXAccessSpecifier (CXCursor) |
| Returns the access control level for the referenced object. | |
| CINDEX_LINKAGE unsigned | clang_getNumOverloadedDecls (CXCursor cursor) |
Determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor. | |
| CINDEX_LINKAGE CXCursor | clang_getOverloadedDecl (CXCursor cursor, unsigned index) |
Retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor. | |
| enum CXCallingConv |
Describes the calling convention of a function type.
| enum CXTypeKind |
Describes the kind of type.
| enum CXTypeLayoutError |
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.
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.
| CINDEX_LINKAGE int clang_Cursor_getNumArguments | ( | CXCursor | C | ) |
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.
| CINDEX_LINKAGE unsigned clang_Cursor_isBitField | ( | CXCursor | C | ) |
Returns non-zero if the cursor specifies a Record member that is a bitfield.
Determine whether two CXTypes represent the same type.
Retrieve the type of an argument 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.
Return the element type of an array type.
If a non-array type is passed in, an invalid type is returned.
| CINDEX_LINKAGE long long clang_getArraySize | ( | CXType | T | ) |
Return the array size of a constant array.
If a non-array type is passed in, -1 is returned.
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'.
Retrieve the result type associated with a given cursor.
This only returns a valid type if the cursor refers to a function or method.
| CINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier | ( | CXCursor | ) |
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.
Returns the Objective-C type encoding for the specified declaration.
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.
| CINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue | ( | CXCursor | C | ) |
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.
| CINDEX_LINKAGE long long clang_getEnumConstantDeclValue | ( | CXCursor | C | ) |
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.
Retrieve the integer type of an enum declaration.
If the cursor does not reference an enum declaration, an invalid type is returned.
| CINDEX_LINKAGE int clang_getFieldDeclBitWidth | ( | CXCursor | C | ) |
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.
| CINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv | ( | CXType | T | ) |
Retrieve the calling convention associated with a function type.
If a non-function type is passed in, CXCallingConv_Invalid is returned.
| CINDEX_LINKAGE int clang_getNumArgTypes | ( | CXType | T | ) |
Retrieve the number of non-variadic arguments associated with a function type.
If a non-function type is passed in, -1 is returned.
| CINDEX_LINKAGE long long clang_getNumElements | ( | CXType | T | ) |
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.
| CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls | ( | CXCursor | cursor | ) |
Determine the number of overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.
| cursor | The cursor whose overloaded declarations are being queried. |
cursor. If it is not a CXCursor_OverloadedDeclRef cursor, returns 0. Retrieve a cursor for one of the overloaded declarations referenced by a CXCursor_OverloadedDeclRef cursor.
| cursor | The cursor whose overloaded declarations are being queried. |
| index | The zero-based index into the set of overloaded declarations in the cursor. |
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(); For pointer types, returns the type of the pointee.
Retrieve the result type associated with a function type.
If a non-function type is passed in, an invalid type is returned.
Return the cursor for the declaration of the given type.
Retrieve the underlying type of a typedef declaration.
If the cursor does not reference a typedef declaration, an invalid type is returned.
| CINDEX_LINKAGE CXString clang_getTypeKindSpelling | ( | enum CXTypeKind | K | ) |
Retrieve the spelling of a given CXTypeKind.
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.
| CINDEX_LINKAGE unsigned clang_isConstQualifiedType | ( | CXType | T | ) |
Determine whether a CXType has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.
| CINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic | ( | CXType | T | ) |
Return 1 if the CXType is a variadic function type, and 0 otherwise.
| CINDEX_LINKAGE unsigned clang_isPODType | ( | CXType | T | ) |
Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise.
| CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType | ( | CXType | T | ) |
Determine whether a CXType has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.
| CINDEX_LINKAGE unsigned clang_isVirtualBase | ( | CXCursor | ) |
Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual.
| CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType | ( | CXType | T | ) |
Determine whether a CXType has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.
| CINDEX_LINKAGE long long clang_Type_getAlignOf | ( | CXType | T | ) |
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.
| CINDEX_LINKAGE long long clang_Type_getOffsetOf | ( | CXType | T, |
| const char * | S | ||
| ) |
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.
| CINDEX_LINKAGE long long clang_Type_getSizeOf | ( | CXType | T | ) |
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.