Use static inline to do the right thing when built in C99 mode. Of course,
[llvm/stm8.git] / lib / Analysis / Analysis.cpp
blob6ebe100b1330e27fd49421c0ad9cf9cc439b05d3
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/InitializePasses.h"
12 #include "llvm/Analysis/Verifier.h"
13 #include <cstring>
15 using namespace llvm;
17 /// initializeAnalysis - Initialize all passes linked into the Analysis library.
18 void llvm::initializeAnalysis(PassRegistry &Registry) {
19 initializeAliasAnalysisAnalysisGroup(Registry);
20 initializeAliasAnalysisCounterPass(Registry);
21 initializeAAEvalPass(Registry);
22 initializeAliasDebuggerPass(Registry);
23 initializeAliasSetPrinterPass(Registry);
24 initializeNoAAPass(Registry);
25 initializeBasicAliasAnalysisPass(Registry);
26 initializeCFGViewerPass(Registry);
27 initializeCFGPrinterPass(Registry);
28 initializeCFGOnlyViewerPass(Registry);
29 initializeCFGOnlyPrinterPass(Registry);
30 initializePrintDbgInfoPass(Registry);
31 initializeDominanceFrontierPass(Registry);
32 initializeDomViewerPass(Registry);
33 initializeDomPrinterPass(Registry);
34 initializeDomOnlyViewerPass(Registry);
35 initializePostDomViewerPass(Registry);
36 initializeDomOnlyPrinterPass(Registry);
37 initializePostDomPrinterPass(Registry);
38 initializePostDomOnlyViewerPass(Registry);
39 initializePostDomOnlyPrinterPass(Registry);
40 initializeIVUsersPass(Registry);
41 initializeInstCountPass(Registry);
42 initializeIntervalPartitionPass(Registry);
43 initializeLazyValueInfoPass(Registry);
44 initializeLibCallAliasAnalysisPass(Registry);
45 initializeLintPass(Registry);
46 initializeLoopDependenceAnalysisPass(Registry);
47 initializeLoopInfoPass(Registry);
48 initializeMemDepPrinterPass(Registry);
49 initializeMemoryDependenceAnalysisPass(Registry);
50 initializeModuleDebugInfoPrinterPass(Registry);
51 initializePostDominatorTreePass(Registry);
52 initializeProfileEstimatorPassPass(Registry);
53 initializeNoProfileInfoPass(Registry);
54 initializeNoPathProfileInfoPass(Registry);
55 initializeProfileInfoAnalysisGroup(Registry);
56 initializePathProfileInfoAnalysisGroup(Registry);
57 initializeLoaderPassPass(Registry);
58 initializePathProfileLoaderPassPass(Registry);
59 initializeProfileVerifierPassPass(Registry);
60 initializePathProfileVerifierPass(Registry);
61 initializeRegionInfoPass(Registry);
62 initializeRegionViewerPass(Registry);
63 initializeRegionPrinterPass(Registry);
64 initializeRegionOnlyViewerPass(Registry);
65 initializeRegionOnlyPrinterPass(Registry);
66 initializeScalarEvolutionPass(Registry);
67 initializeScalarEvolutionAliasAnalysisPass(Registry);
68 initializeTypeBasedAliasAnalysisPass(Registry);
71 void LLVMInitializeAnalysis(LLVMPassRegistryRef R) {
72 initializeAnalysis(*unwrap(R));
75 LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
76 char **OutMessages) {
77 std::string Messages;
79 LLVMBool Result = verifyModule(*unwrap(M),
80 static_cast<VerifierFailureAction>(Action),
81 OutMessages? &Messages : 0);
83 if (OutMessages)
84 *OutMessages = strdup(Messages.c_str());
86 return Result;
89 LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action) {
90 return verifyFunction(*unwrap<Function>(Fn),
91 static_cast<VerifierFailureAction>(Action));
94 void LLVMViewFunctionCFG(LLVMValueRef Fn) {
95 Function *F = unwrap<Function>(Fn);
96 F->viewCFG();
99 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
100 Function *F = unwrap<Function>(Fn);
101 F->viewCFGOnly();