Hanle i8 returns
[llvm/msp430.git] / lib / Analysis / Analysis.cpp
blob493c6e88b3f8ed978dab0daab73ec53833bdb54a
1 //===-- Analysis.cpp ------------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
10 #include "llvm-c/Analysis.h"
11 #include "llvm/Analysis/Verifier.h"
12 #include <fstream>
13 #include <cstring>
15 using namespace llvm;
17 int LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
18 char **OutMessages) {
19 std::string Messages;
21 int Result = verifyModule(*unwrap(M),
22 static_cast<VerifierFailureAction>(Action),
23 OutMessages? &Messages : 0);
25 if (OutMessages)
26 *OutMessages = strdup(Messages.c_str());
28 return Result;
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);
38 F->viewCFG();
41 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
42 Function *F = unwrap<Function>(Fn);
43 F->viewCFGOnly();