clang 20.0.0git
|
Typedefs | |
typedef void(* | CXInclusionVisitor) (CXFile included_file, CXSourceLocation *inclusion_stack, unsigned include_len, CXClientData client_data) |
Visitor invoked for each file in a translation unit (used with clang_getInclusions()). | |
typedef void * | CXEvalResult |
Evaluation result of a cursor. | |
Enumerations | |
enum | CXEvalResultKind { CXEval_Int = 1 , CXEval_Float = 2 , CXEval_ObjCStrLiteral = 3 , CXEval_StrLiteral = 4 , CXEval_CFStr = 5 , CXEval_Other = 6 , CXEval_UnExposed = 0 } |
Functions | |
CINDEX_LINKAGE CXString | clang_getClangVersion (void) |
Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable). | |
CINDEX_LINKAGE void | clang_toggleCrashRecovery (unsigned isEnabled) |
Enable/disable crash recovery. | |
CINDEX_LINKAGE void | clang_getInclusions (CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data) |
Visit the set of preprocessor inclusions in a translation unit. | |
CINDEX_LINKAGE CXEvalResult | clang_Cursor_Evaluate (CXCursor 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. | |
CINDEX_LINKAGE CXEvalResultKind | clang_EvalResult_getKind (CXEvalResult E) |
Returns the kind of the evaluated result. | |
CINDEX_LINKAGE int | clang_EvalResult_getAsInt (CXEvalResult E) |
Returns the evaluation result as integer if the kind is Int. | |
CINDEX_LINKAGE long long | clang_EvalResult_getAsLongLong (CXEvalResult E) |
Returns the evaluation result as a long long integer if the kind is Int. | |
CINDEX_LINKAGE unsigned | clang_EvalResult_isUnsignedInt (CXEvalResult E) |
Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer. | |
CINDEX_LINKAGE unsigned long long | clang_EvalResult_getAsUnsigned (CXEvalResult E) |
Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. | |
CINDEX_LINKAGE double | clang_EvalResult_getAsDouble (CXEvalResult E) |
Returns the evaluation result as double if the kind is double. | |
CINDEX_LINKAGE const char * | clang_EvalResult_getAsStr (CXEvalResult E) |
Returns the evaluation result as a constant string if the kind is other than Int or float. | |
CINDEX_LINKAGE void | clang_EvalResult_dispose (CXEvalResult E) |
Disposes the created Eval memory. | |
typedef void* CXEvalResult |
typedef void(* CXInclusionVisitor) (CXFile included_file, CXSourceLocation *inclusion_stack, unsigned include_len, CXClientData client_data) |
Visitor invoked for each file in a translation unit (used with clang_getInclusions()).
This visitor function will be invoked by clang_getInclusions() for each file included (either at the top-level or by #include directives) within a translation unit. The first argument is the file being included, and the second and third arguments provide the inclusion stack. The array is sorted in order of immediate inclusion. For example, the first element refers to the location that included 'included_file'.
enum CXEvalResultKind |
CINDEX_LINKAGE CXEvalResult clang_Cursor_Evaluate | ( | CXCursor | 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 it's an expression, tries to evaluate the expression.
CINDEX_LINKAGE void clang_EvalResult_dispose | ( | CXEvalResult | E | ) |
Disposes the created Eval memory.
CINDEX_LINKAGE double clang_EvalResult_getAsDouble | ( | CXEvalResult | E | ) |
Returns the evaluation result as double if the kind is double.
CINDEX_LINKAGE int clang_EvalResult_getAsInt | ( | CXEvalResult | E | ) |
Returns the evaluation result as integer if the kind is Int.
CINDEX_LINKAGE long long clang_EvalResult_getAsLongLong | ( | CXEvalResult | E | ) |
Returns the evaluation result as a long long integer if the kind is Int.
This prevents overflows that may happen if the result is returned with clang_EvalResult_getAsInt.
CINDEX_LINKAGE const char * clang_EvalResult_getAsStr | ( | CXEvalResult | E | ) |
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 unsigned long long clang_EvalResult_getAsUnsigned | ( | CXEvalResult | E | ) |
Returns the evaluation result as an unsigned integer if the kind is Int and clang_EvalResult_isUnsignedInt is non-zero.
CINDEX_LINKAGE CXEvalResultKind clang_EvalResult_getKind | ( | CXEvalResult | E | ) |
Returns the kind of the evaluated result.
CINDEX_LINKAGE unsigned clang_EvalResult_isUnsignedInt | ( | CXEvalResult | E | ) |
Returns a non-zero value if the kind is Int and the evaluation result resulted in an unsigned integer.
CINDEX_LINKAGE CXString clang_getClangVersion | ( | void | ) |
Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable).
CINDEX_LINKAGE void clang_getInclusions | ( | CXTranslationUnit | tu, |
CXInclusionVisitor | visitor, | ||
CXClientData | client_data | ||
) |
Visit the set of preprocessor inclusions in a translation unit.
The visitor function is called with the provided data for every included file. This does not include headers included by the PCH file (unless one is inspecting the inclusions in the PCH file itself).
CINDEX_LINKAGE void clang_toggleCrashRecovery | ( | unsigned | isEnabled | ) |
Enable/disable crash recovery.
isEnabled | Flag to indicate if crash recovery is enabled. A non-zero value enables crash recovery, while 0 disables it. |