Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | /*===-- clang-c/CXErrorCode.h - C Index Error Codes --------------*- C -*-===*\ |
| 2 | |* *| |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame] | 3 | |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| |
| 4 | |* Exceptions. *| |
| 5 | |* See https://llvm.org/LICENSE.txt for license information. *| |
| 6 | |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 7 | |* *| |
| 8 | |*===----------------------------------------------------------------------===*| |
| 9 | |* *| |
| 10 | |* This header provides the CXErrorCode enumerators. *| |
| 11 | |* *| |
| 12 | \*===----------------------------------------------------------------------===*/ |
| 13 | |
| 14 | #ifndef LLVM_CLANG_C_CXERRORCODE_H |
| 15 | #define LLVM_CLANG_C_CXERRORCODE_H |
| 16 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 17 | #include "clang-c/ExternC.h" |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 18 | #include "clang-c/Platform.h" |
| 19 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 20 | LLVM_CLANG_C_EXTERN_C_BEGIN |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 21 | |
| 22 | /** |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 23 | * Error codes returned by libclang routines. |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 24 | * |
| 25 | * Zero (\c CXError_Success) is the only error code indicating success. Other |
| 26 | * error codes, including not yet assigned non-zero values, indicate errors. |
| 27 | */ |
| 28 | enum CXErrorCode { |
| 29 | /** |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 30 | * No error. |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 31 | */ |
| 32 | CXError_Success = 0, |
| 33 | |
| 34 | /** |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 35 | * A generic error code, no further details are available. |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 36 | * |
| 37 | * Errors of this kind can get their own specific error codes in future |
| 38 | * libclang versions. |
| 39 | */ |
| 40 | CXError_Failure = 1, |
| 41 | |
| 42 | /** |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 43 | * libclang crashed while performing the requested operation. |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 44 | */ |
| 45 | CXError_Crashed = 2, |
| 46 | |
| 47 | /** |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 48 | * The function detected that the arguments violate the function |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 49 | * contract. |
| 50 | */ |
| 51 | CXError_InvalidArguments = 3, |
| 52 | |
| 53 | /** |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 54 | * An AST deserialization error has occurred. |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 55 | */ |
| 56 | CXError_ASTReadError = 4 |
| 57 | }; |
| 58 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 59 | LLVM_CLANG_C_EXTERN_C_END |
| 60 | |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 61 | #endif |
| 62 | |