Fix comment for consistency sake.
[llvm/avr.git] / lib / Analysis / Analysis.cpp
blobf8cb32321b00ee148e1c6655ba0839009035a2c6
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 <cstring>
14 using namespace llvm;
16 int LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
17 char **OutMessages) {
18 std::string Messages;
20 int Result = verifyModule(*unwrap(M),
21 static_cast<VerifierFailureAction>(Action),
22 OutMessages? &Messages : 0);
24 if (OutMessages)
25 *OutMessages = strdup(Messages.c_str());
27 return Result;
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);
37 F->viewCFG();
40 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
41 Function *F = unwrap<Function>(Fn);
42 F->viewCFGOnly();