1 //===-- Analysis.cpp ------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm-c/Analysis.h"
11 #include "llvm/Analysis/Verifier.h"
16 int LLVMVerifyModule(LLVMModuleRef M
, LLVMVerifierFailureAction Action
,
20 int Result
= verifyModule(*unwrap(M
),
21 static_cast<VerifierFailureAction
>(Action
),
22 OutMessages
? &Messages
: 0);
25 *OutMessages
= strdup(Messages
.c_str());
30 int LLVMVerifyFunction(LLVMValueRef Fn
, LLVMVerifierFailureAction Action
) {
31 return verifyFunction(*unwrap
<Function
>(Fn
),
32 static_cast<VerifierFailureAction
>(Action
));
35 void LLVMViewFunctionCFG(LLVMValueRef Fn
) {
36 Function
*F
= unwrap
<Function
>(Fn
);
40 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn
) {
41 Function
*F
= unwrap
<Function
>(Fn
);