diff options
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r-- | clang/include/clang-c/BuildSystem.h | 11 | ||||
-rw-r--r-- | clang/include/clang-c/CXCompilationDatabase.h | 12 | ||||
-rw-r--r-- | clang/include/clang-c/CXErrorCode.h | 10 | ||||
-rw-r--r-- | clang/include/clang-c/CXString.h | 10 | ||||
-rw-r--r-- | clang/include/clang-c/Documentation.h | 17 | ||||
-rw-r--r-- | clang/include/clang-c/ExternC.h | 39 | ||||
-rw-r--r-- | clang/include/clang-c/FatalErrorHandler.h | 11 | ||||
-rw-r--r-- | clang/include/clang-c/Index.h | 23 | ||||
-rw-r--r-- | clang/include/clang-c/Platform.h | 11 |
9 files changed, 89 insertions, 55 deletions
diff --git a/clang/include/clang-c/BuildSystem.h b/clang/include/clang-c/BuildSystem.h index 8f26a8611719..4e9f6dee0279 100644 --- a/clang/include/clang-c/BuildSystem.h +++ b/clang/include/clang-c/BuildSystem.h @@ -14,13 +14,12 @@ #ifndef LLVM_CLANG_C_BUILDSYSTEM_H #define LLVM_CLANG_C_BUILDSYSTEM_H -#include "clang-c/Platform.h" #include "clang-c/CXErrorCode.h" #include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * \defgroup BUILD_SYSTEM Build system utilities @@ -148,9 +147,7 @@ CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor); * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END #endif /* CLANG_C_BUILD_SYSTEM_H */ diff --git a/clang/include/clang-c/CXCompilationDatabase.h b/clang/include/clang-c/CXCompilationDatabase.h index 2669c1a792c1..2b336e5464a2 100644 --- a/clang/include/clang-c/CXCompilationDatabase.h +++ b/clang/include/clang-c/CXCompilationDatabase.h @@ -15,12 +15,11 @@ #ifndef LLVM_CLANG_C_CXCOMPILATIONDATABASE_H #define LLVM_CLANG_C_CXCOMPILATIONDATABASE_H -#include "clang-c/Platform.h" #include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** \defgroup COMPILATIONDB CompilationDatabase functions * \ingroup CINDEX @@ -169,8 +168,7 @@ clang_CompileCommand_getMappedSourceContent(CXCompileCommand, unsigned I); * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/CXErrorCode.h b/clang/include/clang-c/CXErrorCode.h index fed195ec1f33..b3a0b9d66d5f 100644 --- a/clang/include/clang-c/CXErrorCode.h +++ b/clang/include/clang-c/CXErrorCode.h @@ -14,11 +14,10 @@ #ifndef LLVM_CLANG_C_CXERRORCODE_H #define LLVM_CLANG_C_CXERRORCODE_H +#include "clang-c/ExternC.h" #include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * Error codes returned by libclang routines. @@ -57,8 +56,7 @@ enum CXErrorCode { CXError_ASTReadError = 4 }; -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/CXString.h b/clang/include/clang-c/CXString.h index 1eb3442ccb24..f117010c71a4 100644 --- a/clang/include/clang-c/CXString.h +++ b/clang/include/clang-c/CXString.h @@ -14,11 +14,10 @@ #ifndef LLVM_CLANG_C_CXSTRING_H #define LLVM_CLANG_C_CXSTRING_H +#include "clang-c/ExternC.h" #include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * \defgroup CINDEX_STRING String manipulation routines @@ -64,8 +63,7 @@ CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set); * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/Documentation.h b/clang/include/clang-c/Documentation.h index 4af8c93a367e..5bece2cb6758 100644 --- a/clang/include/clang-c/Documentation.h +++ b/clang/include/clang-c/Documentation.h @@ -15,11 +15,10 @@ #ifndef LLVM_CLANG_C_DOCUMENTATION_H #define LLVM_CLANG_C_DOCUMENTATION_H +#include "clang-c/ExternC.h" #include "clang-c/Index.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * \defgroup CINDEX_COMMENT Comment introspection @@ -182,7 +181,12 @@ enum CXCommentInlineCommandRenderKind { * Command argument should be rendered emphasized (typically italic * font). */ - CXCommentInlineCommandRenderKind_Emphasized + CXCommentInlineCommandRenderKind_Emphasized, + + /** + * Command argument should not be rendered (since it only defines an anchor). + */ + CXCommentInlineCommandRenderKind_Anchor }; /** @@ -545,10 +549,7 @@ CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); * @} */ - -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END #endif /* CLANG_C_DOCUMENTATION_H */ diff --git a/clang/include/clang-c/ExternC.h b/clang/include/clang-c/ExternC.h new file mode 100644 index 000000000000..384f24d47b0b --- /dev/null +++ b/clang/include/clang-c/ExternC.h @@ -0,0 +1,39 @@ +/*===- clang-c/ExternC.h - Wrapper for 'extern "C"' ---------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines an 'extern "C"' wrapper. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_EXTERN_C_H +#define LLVM_CLANG_C_EXTERN_C_H + +#ifdef __clang__ +#define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic error \"-Wstrict-prototypes\"") +#define LLVM_CLANG_C_STRICT_PROTOTYPES_END _Pragma("clang diagnostic pop") +#else +#define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_STRICT_PROTOTYPES_END +#endif + +#ifdef __cplusplus +#define LLVM_CLANG_C_EXTERN_C_BEGIN \ + extern "C" { \ + LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_EXTERN_C_END \ + LLVM_CLANG_C_STRICT_PROTOTYPES_END \ + } +#else +#define LLVM_CLANG_C_EXTERN_C_BEGIN LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_EXTERN_C_END LLVM_CLANG_C_STRICT_PROTOTYPES_END +#endif + +#endif diff --git a/clang/include/clang-c/FatalErrorHandler.h b/clang/include/clang-c/FatalErrorHandler.h index ce8ff2cae735..22f34fa815cc 100644 --- a/clang/include/clang-c/FatalErrorHandler.h +++ b/clang/include/clang-c/FatalErrorHandler.h @@ -10,9 +10,9 @@ #ifndef LLVM_CLANG_C_FATAL_ERROR_HANDLER_H #define LLVM_CLANG_C_FATAL_ERROR_HANDLER_H -#ifdef __cplusplus -extern "C" { -#endif +#include "clang-c/ExternC.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN /** * Installs error handler that prints error message to stderr and calls abort(). @@ -27,7 +27,6 @@ void clang_install_aborting_llvm_fatal_error_handler(void); */ void clang_uninstall_llvm_fatal_error_handler(void); -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 226893505437..b653995ebbd0 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -18,10 +18,11 @@ #include <time.h> -#include "clang-c/Platform.h" +#include "clang-c/BuildSystem.h" #include "clang-c/CXErrorCode.h" #include "clang-c/CXString.h" -#include "clang-c/BuildSystem.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" /** * The version constants for the libclang API. @@ -51,9 +52,7 @@ CINDEX_VERSION_MAJOR, \ CINDEX_VERSION_MINOR) -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** \defgroup CINDEX libclang: C Interface to Clang * @@ -2567,8 +2566,15 @@ enum CXCursorKind { */ CXCursor_OMPMasterTaskLoopSimdDirective = 283, + /** OpenMP parallel master taskloop simd directive. + */ + CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284, + + /** OpenMP parallel master directive. + */ + CXCursor_OMPParallelMasterDirective = 285, - CXCursor_LastStmt = CXCursor_OMPMasterTaskLoopSimdDirective, + CXCursor_LastStmt = CXCursor_OMPParallelMasterDirective, /** * Cursor that represents the translation unit itself. @@ -6771,7 +6777,6 @@ CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/Platform.h b/clang/include/clang-c/Platform.h index 5284b533253d..3bb66bb0df48 100644 --- a/clang/include/clang-c/Platform.h +++ b/clang/include/clang-c/Platform.h @@ -14,9 +14,9 @@ #ifndef LLVM_CLANG_C_PLATFORM_H #define LLVM_CLANG_C_PLATFORM_H -#ifdef __cplusplus -extern "C" { -#endif +#include "clang-c/ExternC.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN /* MSVC DLL import/export. */ #ifdef _MSC_VER @@ -39,7 +39,6 @@ extern "C" { #endif #endif -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif |