LLVM API Documentation

Analysis.cpp

Go to the documentation of this file.
00001 //===-- Analysis.cpp ------------------------------------------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #include "llvm-c/Analysis.h"
00011 #include "llvm/Analysis/Verifier.h"
00012 #include <fstream>
00013 #include <cstring>
00014 
00015 using namespace llvm;
00016 
00017 int LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
00018                      char **OutMessages) {
00019   std::string Messages;
00020   
00021   int Result = verifyModule(*unwrap(M),
00022                             static_cast<VerifierFailureAction>(Action),
00023                             OutMessages? &Messages : 0);
00024   
00025   if (OutMessages)
00026     *OutMessages = strdup(Messages.c_str());
00027   
00028   return Result;
00029 }
00030 
00031 int LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action) {
00032   return verifyFunction(*unwrap<Function>(Fn),
00033                         static_cast<VerifierFailureAction>(Action));
00034 }
00035 
00036 void LLVMViewFunctionCFG(LLVMValueRef Fn) {
00037   Function *F = unwrap<Function>(Fn);
00038   F->viewCFG();
00039 }
00040 
00041 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
00042   Function *F = unwrap<Function>(Fn);
00043   F->viewCFGOnly();
00044 }



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.