Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/Analysis.h
35233 views
/*===-- llvm-c/Analysis.h - Analysis Library C Interface --------*- C++ -*-===*\1|* *|2|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|3|* Exceptions. *|4|* See https://llvm.org/LICENSE.txt for license information. *|5|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|6|* *|7|*===----------------------------------------------------------------------===*|8|* *|9|* This header declares the C interface to libLLVMAnalysis.a, which *|10|* implements various analyses of the LLVM IR. *|11|* *|12|* Many exotic languages can interoperate with C code but have a harder time *|13|* with C++ due to name mangling. So in addition to C, this interface enables *|14|* tools written in such languages. *|15|* *|16\*===----------------------------------------------------------------------===*/1718#ifndef LLVM_C_ANALYSIS_H19#define LLVM_C_ANALYSIS_H2021#include "llvm-c/ExternC.h"22#include "llvm-c/Types.h"2324LLVM_C_EXTERN_C_BEGIN2526/**27* @defgroup LLVMCAnalysis Analysis28* @ingroup LLVMC29*30* @{31*/3233typedef enum {34LLVMAbortProcessAction, /* verifier will print to stderr and abort() */35LLVMPrintMessageAction, /* verifier will print to stderr and return 1 */36LLVMReturnStatusAction /* verifier will just return 1 */37} LLVMVerifierFailureAction;383940/* Verifies that a module is valid, taking the specified action if not.41Optionally returns a human-readable description of any invalid constructs.42OutMessage must be disposed with LLVMDisposeMessage. */43LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,44char **OutMessage);4546/* Verifies that a single function is valid, taking the specified action. Useful47for debugging. */48LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);4950/* Open up a ghostview window that displays the CFG of the current function.51Useful for debugging. */52void LLVMViewFunctionCFG(LLVMValueRef Fn);53void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);5455/**56* @}57*/5859LLVM_C_EXTERN_C_END6061#endif626364