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"
17 int LLVMVerifyModule(LLVMModuleRef M
, LLVMVerifierFailureAction Action
,
21 int Result
= verifyModule(*unwrap(M
),
22 static_cast<VerifierFailureAction
>(Action
),
23 OutMessages
? &Messages
: 0);
26 *OutMessages
= strdup(Messages
.c_str());
31 int LLVMVerifyFunction(LLVMValueRef Fn
, LLVMVerifierFailureAction Action
) {
32 return verifyFunction(*unwrap
<Function
>(Fn
),
33 static_cast<VerifierFailureAction
>(Action
));
36 void LLVMViewFunctionCFG(LLVMValueRef Fn
) {
37 Function
*F
= unwrap
<Function
>(Fn
);
41 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn
) {
42 Function
*F
= unwrap
<Function
>(Fn
);