summaryrefslogtreecommitdiff
path: root/include/clang-c/Index.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang-c/Index.h')
-rw-r--r--include/clang-c/Index.h210
1 files changed, 195 insertions, 15 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 09e216082630c..13db2085ba69b 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -32,7 +32,7 @@
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 32
+#define CINDEX_VERSION_MINOR 35
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -326,7 +326,7 @@ clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file);
*
* \param tu the translation unit
*
- * \param file_name the name of the file.
+* \param file_name the name of the file.
*
* \returns the file handle for the named file in the translation unit \p tu,
* or a NULL file handle if the file was not a part of this translation unit.
@@ -1208,7 +1208,18 @@ enum CXTranslationUnit_Flags {
* trades runtime on the first parse (serializing the preamble takes time) for
* reduced runtime on the second parse (can now reuse the preamble).
*/
- CXTranslationUnit_CreatePreambleOnFirstParse = 0x100
+ CXTranslationUnit_CreatePreambleOnFirstParse = 0x100,
+
+ /**
+ * \brief 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.
+ */
+ CXTranslationUnit_KeepGoing = 0x200
};
/**
@@ -1921,7 +1932,7 @@ enum CXCursorKind {
*/
CXCursor_CXXDeleteExpr = 135,
- /** \brief A unary expression.
+ /** \brief A unary expression. (noexcept, sizeof, or other traits)
*/
CXCursor_UnaryExpr = 136,
@@ -2003,7 +2014,11 @@ enum CXCursorKind {
*/
CXCursor_OMPArraySectionExpr = 147,
- CXCursor_LastExpr = CXCursor_OMPArraySectionExpr,
+ /** \brief Represents an @available(...) check.
+ */
+ CXCursor_ObjCAvailabilityCheckExpr = 148,
+
+ CXCursor_LastExpr = CXCursor_ObjCAvailabilityCheckExpr,
/* Statements */
CXCursor_FirstStmt = 200,
@@ -2270,11 +2285,47 @@ enum CXCursorKind {
*/
CXCursor_OMPTaskLoopSimdDirective = 259,
- /** \brief OpenMP distribute directive.
+ /** \brief OpenMP distribute directive.
*/
CXCursor_OMPDistributeDirective = 260,
- CXCursor_LastStmt = CXCursor_OMPDistributeDirective,
+ /** \brief OpenMP target enter data directive.
+ */
+ CXCursor_OMPTargetEnterDataDirective = 261,
+
+ /** \brief OpenMP target exit data directive.
+ */
+ CXCursor_OMPTargetExitDataDirective = 262,
+
+ /** \brief OpenMP target parallel directive.
+ */
+ CXCursor_OMPTargetParallelDirective = 263,
+
+ /** \brief OpenMP target parallel for directive.
+ */
+ CXCursor_OMPTargetParallelForDirective = 264,
+
+ /** \brief OpenMP target update directive.
+ */
+ CXCursor_OMPTargetUpdateDirective = 265,
+
+ /** \brief OpenMP distribute parallel for directive.
+ */
+ CXCursor_OMPDistributeParallelForDirective = 266,
+
+ /** \brief OpenMP distribute parallel for simd directive.
+ */
+ CXCursor_OMPDistributeParallelForSimdDirective = 267,
+
+ /** \brief OpenMP distribute simd directive.
+ */
+ CXCursor_OMPDistributeSimdDirective = 268,
+
+ /** \brief OpenMP target parallel for simd directive.
+ */
+ CXCursor_OMPTargetParallelForSimdDirective = 269,
+
+ CXCursor_LastStmt = CXCursor_OMPTargetParallelForSimdDirective,
/**
* \brief Cursor that represents the translation unit itself.
@@ -2328,8 +2379,12 @@ enum CXCursorKind {
*/
CXCursor_ModuleImportDecl = 600,
CXCursor_TypeAliasTemplateDecl = 601,
+ /**
+ * \brief A static_assert or _Static_assert node
+ */
+ CXCursor_StaticAssert = 602,
CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl,
- CXCursor_LastExtraDecl = CXCursor_TypeAliasTemplateDecl,
+ CXCursor_LastExtraDecl = CXCursor_StaticAssert,
/**
* \brief A code completion overload candidate.
@@ -2431,6 +2486,11 @@ CINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind);
CINDEX_LINKAGE unsigned clang_isAttribute(enum CXCursorKind);
/**
+ * \brief Determine whether the given cursor has any attributes.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_hasAttrs(CXCursor C);
+
+/**
* \brief Determine whether the given cursor kind represents an invalid
* cursor.
*/
@@ -2526,7 +2586,7 @@ typedef struct CXPlatformAvailability {
* \brief A string that describes the platform for which this structure
* provides availability information.
*
- * Possible values are "ios" or "macosx".
+ * Possible values are "ios" or "macos".
*/
CXString Platform;
/**
@@ -2897,6 +2957,7 @@ enum CXTypeKind {
CXType_ObjCId = 27,
CXType_ObjCClass = 28,
CXType_ObjCSel = 29,
+ CXType_Float128 = 30,
CXType_FirstBuiltin = CXType_Void,
CXType_LastBuiltin = CXType_ObjCSel,
@@ -2918,7 +2979,14 @@ enum CXTypeKind {
CXType_VariableArray = 115,
CXType_DependentSizedArray = 116,
CXType_MemberPointer = 117,
- CXType_Auto = 118
+ CXType_Auto = 118,
+
+ /**
+ * \brief 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.
+ */
+ CXType_Elaborated = 119
};
/**
@@ -2938,6 +3006,9 @@ enum CXCallingConv {
CXCallingConv_X86_64Win64 = 10,
CXCallingConv_X86_64SysV = 11,
CXCallingConv_X86VectorCall = 12,
+ CXCallingConv_Swift = 13,
+ CXCallingConv_PreserveMost = 14,
+ CXCallingConv_PreserveAll = 15,
CXCallingConv_Invalid = 100,
CXCallingConv_Unexposed = 200
@@ -3170,6 +3241,24 @@ CINDEX_LINKAGE CXType clang_getCanonicalType(CXType T);
CINDEX_LINKAGE unsigned clang_isConstQualifiedType(CXType T);
/**
+ * \brief Determine whether a CXCursor that is a macro, is
+ * function like.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isMacroFunctionLike(CXCursor C);
+
+/**
+ * \brief Determine whether a CXCursor that is a macro, is a
+ * builtin one.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin(CXCursor C);
+
+/**
+ * \brief Determine whether a CXCursor that is a function declaration, is an
+ * inline declaration.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined(CXCursor C);
+
+/**
* \brief Determine whether a CXType has the "volatile" qualifier set,
* without looking through typedefs that may have added "volatile" at
* a different level.
@@ -3199,6 +3288,11 @@ CINDEX_LINKAGE CXCursor clang_getTypeDeclaration(CXType T);
CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C);
/**
+ * Returns the Objective-C type encoding for the specified CXType.
+ */
+CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type);
+
+/**
* \brief Retrieve the spelling of a given CXTypeKind.
*/
CINDEX_LINKAGE CXString clang_getTypeKindSpelling(enum CXTypeKind K);
@@ -3282,6 +3376,13 @@ CINDEX_LINKAGE CXType clang_getArrayElementType(CXType T);
CINDEX_LINKAGE long long clang_getArraySize(CXType T);
/**
+ * \brief Retrieve the type named by the qualified-id.
+ *
+ * If a non-elaborated type is passed in, an invalid type is returned.
+ */
+CINDEX_LINKAGE CXType clang_Type_getNamedType(CXType T);
+
+/**
* \brief List the possible error codes for \c clang_Type_getSizeOf,
* \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and
* \c clang_Cursor_getOffsetOf.
@@ -3612,8 +3713,8 @@ typedef enum CXChildVisitResult
* Visits the children of a cursor using the specified block. Behaves
* identically to clang_visitChildren() in all other respects.
*/
-unsigned clang_visitChildrenWithBlock(CXCursor parent,
- CXCursorVisitorBlock block);
+CINDEX_LINKAGE unsigned clang_visitChildrenWithBlock(CXCursor parent,
+ CXCursorVisitorBlock block);
# endif
#endif
@@ -3834,7 +3935,8 @@ typedef enum {
CXObjCPropertyAttr_atomic = 0x100,
CXObjCPropertyAttr_weak = 0x200,
CXObjCPropertyAttr_strong = 0x400,
- CXObjCPropertyAttr_unsafe_unretained = 0x800
+ CXObjCPropertyAttr_unsafe_unretained = 0x800,
+ CXObjCPropertyAttr_class = 0x1000
} CXObjCPropertyAttrKind;
/**
@@ -4016,11 +4118,36 @@ CXFile clang_Module_getTopLevelHeader(CXTranslationUnit,
*/
/**
+ * \brief Determine if a C++ constructor is a converting constructor.
+ */
+CINDEX_LINKAGE unsigned clang_CXXConstructor_isConvertingConstructor(CXCursor C);
+
+/**
+ * \brief Determine if a C++ constructor is a copy constructor.
+ */
+CINDEX_LINKAGE unsigned clang_CXXConstructor_isCopyConstructor(CXCursor C);
+
+/**
+ * \brief Determine if a C++ constructor is the default constructor.
+ */
+CINDEX_LINKAGE unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C);
+
+/**
+ * \brief Determine if a C++ constructor is a move constructor.
+ */
+CINDEX_LINKAGE unsigned clang_CXXConstructor_isMoveConstructor(CXCursor C);
+
+/**
* \brief Determine if a C++ field is declared 'mutable'.
*/
CINDEX_LINKAGE unsigned clang_CXXField_isMutable(CXCursor C);
/**
+ * \brief Determine if a C++ method is declared '= default'.
+ */
+CINDEX_LINKAGE unsigned clang_CXXMethod_isDefaulted(CXCursor C);
+
+/**
* \brief Determine if a C++ member function or member function template is
* pure virtual.
*/
@@ -4900,7 +5027,7 @@ CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void);
* Note that the column should point just after the syntactic construct that
* initiated code completion, and not in the middle of a lexical token.
*
- * \param unsaved_files the Tiles that have not yet been saved to disk
+ * \param 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
@@ -5077,6 +5204,59 @@ CINDEX_LINKAGE void clang_getInclusions(CXTranslationUnit tu,
CXInclusionVisitor visitor,
CXClientData client_data);
+typedef enum {
+ CXEval_Int = 1 ,
+ CXEval_Float = 2,
+ CXEval_ObjCStrLiteral = 3,
+ CXEval_StrLiteral = 4,
+ CXEval_CFStr = 5,
+ CXEval_Other = 6,
+
+ CXEval_UnExposed = 0
+
+} CXEvalResultKind ;
+
+/**
+ * \brief Evaluation result of a cursor
+ */
+typedef void * CXEvalResult;
+
+/**
+ * \brief If cursor is a statement declaration tries to evaluate the
+ * statement and if its variable, tries to evaluate its initializer,
+ * into its corresponding type.
+ */
+CINDEX_LINKAGE CXEvalResult clang_Cursor_Evaluate(CXCursor C);
+
+/**
+ * \brief Returns the kind of the evaluated result.
+ */
+CINDEX_LINKAGE CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E);
+
+/**
+ * \brief Returns the evaluation result as integer if the
+ * kind is Int.
+ */
+CINDEX_LINKAGE int clang_EvalResult_getAsInt(CXEvalResult E);
+
+/**
+ * \brief Returns the evaluation result as double if the
+ * kind is double.
+ */
+CINDEX_LINKAGE double clang_EvalResult_getAsDouble(CXEvalResult E);
+
+/**
+ * \brief 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.
+ */
+CINDEX_LINKAGE const char* clang_EvalResult_getAsStr(CXEvalResult E);
+
+/**
+ * \brief Disposes the created Eval memory.
+ */
+CINDEX_LINKAGE void clang_EvalResult_dispose(CXEvalResult E);
/**
* @}
*/
@@ -5150,7 +5330,7 @@ enum CXVisitorResult {
CXVisit_Continue
};
-typedef struct {
+typedef struct CXCursorAndRangeVisitor {
void *context;
enum CXVisitorResult (*visit)(void *context, CXCursor, CXSourceRange);
} CXCursorAndRangeVisitor;