1 /*===-- llvm-c/Analysis.h - Analysis Library C Interface --------*- C++ -*-===*\
2 |*                                                                            *|
3 |*                     The LLVM Compiler Infrastructure                       *|
4 |*                                                                            *|
5 |* This file is distributed under the University of Illinois Open Source      *|
6 |* License. See LICENSE.TXT for details.                                      *|
7 |*                                                                            *|
8 |*===----------------------------------------------------------------------===*|
9 |*                                                                            *|
10 |* This header declares the C interface to libLLVMAnalysis.a, which           *|
11 |* implements various analyses of the LLVM IR.                                *|
12 |*                                                                            *|
13 |* Many exotic languages can interoperate with C code but have a harder time  *|
14 |* with C++ due to name mangling. So in addition to C, this interface enables *|
15 |* tools written in such languages.                                           *|
16 |*                                                                            *|
17 \*===----------------------------------------------------------------------===*/
18 
19 module deimos.llvm.c.analysis;
20 
21 import deimos.llvm.c.core;
22 
23 extern(C) nothrow:
24 
25 /**
26  * @defgroup LLVMCAnalysis Analysis
27  * @ingroup LLVMC
28  *
29  * @{
30  */
31 
32 alias int LLVMVerifierFailureAction;
33 enum : LLVMVerifierFailureAction {
34   LLVMAbortProcessAction, /* verifier will print to stderr and abort() */
35   LLVMPrintMessageAction, /* verifier will print to stderr and return 1 */
36   LLVMReturnStatusAction  /* verifier will just return 1 */
37 }
38 
39 
40 /* Verifies that a module is valid, taking the specified action if not.
41    Optionally returns a human-readable description of any invalid constructs.
42    OutMessage must be disposed with LLVMDisposeMessage. */
43 LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
44                           char **OutMessage);
45 
46 /* Verifies that a single function is valid, taking the specified action. Useful
47    for debugging. */
48 LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
49 
50 /* Open up a ghostview window that displays the CFG of the current function.
51    Useful for debugging. */
52 void LLVMViewFunctionCFG(LLVMValueRef Fn);
53 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
54 
55 /**
56  * @}
57  */