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/InitializePasses.h"
12 #include "llvm/Analysis/Verifier.h"
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 initializeBlockFrequencyPass(Registry
);
27 initializeBranchProbabilityInfoPass(Registry
);
28 initializeCFGViewerPass(Registry
);
29 initializeCFGPrinterPass(Registry
);
30 initializeCFGOnlyViewerPass(Registry
);
31 initializeCFGOnlyPrinterPass(Registry
);
32 initializePrintDbgInfoPass(Registry
);
33 initializeDominanceFrontierPass(Registry
);
34 initializeDomViewerPass(Registry
);
35 initializeDomPrinterPass(Registry
);
36 initializeDomOnlyViewerPass(Registry
);
37 initializePostDomViewerPass(Registry
);
38 initializeDomOnlyPrinterPass(Registry
);
39 initializePostDomPrinterPass(Registry
);
40 initializePostDomOnlyViewerPass(Registry
);
41 initializePostDomOnlyPrinterPass(Registry
);
42 initializeIVUsersPass(Registry
);
43 initializeInstCountPass(Registry
);
44 initializeIntervalPartitionPass(Registry
);
45 initializeLazyValueInfoPass(Registry
);
46 initializeLibCallAliasAnalysisPass(Registry
);
47 initializeLintPass(Registry
);
48 initializeLoopDependenceAnalysisPass(Registry
);
49 initializeLoopInfoPass(Registry
);
50 initializeMemDepPrinterPass(Registry
);
51 initializeMemoryDependenceAnalysisPass(Registry
);
52 initializeModuleDebugInfoPrinterPass(Registry
);
53 initializePostDominatorTreePass(Registry
);
54 initializeProfileEstimatorPassPass(Registry
);
55 initializeNoProfileInfoPass(Registry
);
56 initializeNoPathProfileInfoPass(Registry
);
57 initializeProfileInfoAnalysisGroup(Registry
);
58 initializePathProfileInfoAnalysisGroup(Registry
);
59 initializeLoaderPassPass(Registry
);
60 initializePathProfileLoaderPassPass(Registry
);
61 initializeProfileVerifierPassPass(Registry
);
62 initializePathProfileVerifierPass(Registry
);
63 initializeRegionInfoPass(Registry
);
64 initializeRegionViewerPass(Registry
);
65 initializeRegionPrinterPass(Registry
);
66 initializeRegionOnlyViewerPass(Registry
);
67 initializeRegionOnlyPrinterPass(Registry
);
68 initializeScalarEvolutionPass(Registry
);
69 initializeScalarEvolutionAliasAnalysisPass(Registry
);
70 initializeTypeBasedAliasAnalysisPass(Registry
);
73 void LLVMInitializeAnalysis(LLVMPassRegistryRef R
) {
74 initializeAnalysis(*unwrap(R
));
77 LLVMBool
LLVMVerifyModule(LLVMModuleRef M
, LLVMVerifierFailureAction Action
,
81 LLVMBool Result
= verifyModule(*unwrap(M
),
82 static_cast<VerifierFailureAction
>(Action
),
83 OutMessages
? &Messages
: 0);
86 *OutMessages
= strdup(Messages
.c_str());
91 LLVMBool
LLVMVerifyFunction(LLVMValueRef Fn
, LLVMVerifierFailureAction Action
) {
92 return verifyFunction(*unwrap
<Function
>(Fn
),
93 static_cast<VerifierFailureAction
>(Action
));
96 void LLVMViewFunctionCFG(LLVMValueRef Fn
) {
97 Function
*F
= unwrap
<Function
>(Fn
);
101 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn
) {
102 Function
*F
= unwrap
<Function
>(Fn
);