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 llvm.c.analysis;
20 
21 public import llvm.c.types;
22 
23 extern(C) nothrow:
24 
25 /**
26  * @defgroup LLVMCAnalysis Analysis
27  * @ingroup LLVMC
28  *
29  * @{
30  */
31 
32 enum LLVMVerifierFailureAction {
33   AbortProcess, /* verifier will print to stderr and abort() */
34   PrintMessage, /* verifier will print to stderr and return 1 */
35   ReturnStatus  /* verifier will just return 1 */
36 }
37 
38 
39 /* Verifies that a module is valid, taking the specified action if not.
40    Optionally returns a human-readable description of any invalid constructs.
41    OutMessage must be disposed with LLVMDisposeMessage. */
42 LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
43                           char **OutMessage);
44 
45 /* Verifies that a single function is valid, taking the specified action. Useful
46    for debugging. */
47 LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
48 
49 /* Open up a ghostview window that displays the CFG of the current function.
50    Useful for debugging. */
51 void LLVMViewFunctionCFG(LLVMValueRef Fn);
52 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
53 
54 /**
55  * @}
56  */