Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:00

0001 /*===-- llvm-c/Analysis.h - Analysis Library C Interface --------*- C++ -*-===*\
0002 |*                                                                            *|
0003 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
0004 |* Exceptions.                                                                *|
0005 |* See https://llvm.org/LICENSE.txt for license information.                  *|
0006 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
0007 |*                                                                            *|
0008 |*===----------------------------------------------------------------------===*|
0009 |*                                                                            *|
0010 |* This header declares the C interface to libLLVMAnalysis.a, which           *|
0011 |* implements various analyses of the LLVM IR.                                *|
0012 |*                                                                            *|
0013 |* Many exotic languages can interoperate with C code but have a harder time  *|
0014 |* with C++ due to name mangling. So in addition to C, this interface enables *|
0015 |* tools written in such languages.                                           *|
0016 |*                                                                            *|
0017 \*===----------------------------------------------------------------------===*/
0018 
0019 #ifndef LLVM_C_ANALYSIS_H
0020 #define LLVM_C_ANALYSIS_H
0021 
0022 #include "llvm-c/ExternC.h"
0023 #include "llvm-c/Types.h"
0024 
0025 LLVM_C_EXTERN_C_BEGIN
0026 
0027 /**
0028  * @defgroup LLVMCAnalysis Analysis
0029  * @ingroup LLVMC
0030  *
0031  * @{
0032  */
0033 
0034 typedef enum {
0035   LLVMAbortProcessAction, /* verifier will print to stderr and abort() */
0036   LLVMPrintMessageAction, /* verifier will print to stderr and return 1 */
0037   LLVMReturnStatusAction  /* verifier will just return 1 */
0038 } LLVMVerifierFailureAction;
0039 
0040 
0041 /* Verifies that a module is valid, taking the specified action if not.
0042    Optionally returns a human-readable description of any invalid constructs.
0043    OutMessage must be disposed with LLVMDisposeMessage. */
0044 LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
0045                           char **OutMessage);
0046 
0047 /* Verifies that a single function is valid, taking the specified action. Useful
0048    for debugging. */
0049 LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
0050 
0051 /* Open up a ghostview window that displays the CFG of the current function.
0052    Useful for debugging. */
0053 void LLVMViewFunctionCFG(LLVMValueRef Fn);
0054 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
0055 
0056 /**
0057  * @}
0058  */
0059 
0060 LLVM_C_EXTERN_C_END
0061 
0062 #endif