When promoting an alloca to registers discard any lifetime intrinsics.
[llvm/stm8.git] / lib / Analysis / Analysis.cpp
blobe57ba783329500aa86abe4e2649a915f1f101443
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 initializeBranchProbabilityInfoPass(Registry);
27 initializeCFGViewerPass(Registry);
28 initializeCFGPrinterPass(Registry);
29 initializeCFGOnlyViewerPass(Registry);
30 initializeCFGOnlyPrinterPass(Registry);
31 initializePrintDbgInfoPass(Registry);
32 initializeDominanceFrontierPass(Registry);
33 initializeDomViewerPass(Registry);
34 initializeDomPrinterPass(Registry);
35 initializeDomOnlyViewerPass(Registry);
36 initializePostDomViewerPass(Registry);
37 initializeDomOnlyPrinterPass(Registry);
38 initializePostDomPrinterPass(Registry);
39 initializePostDomOnlyViewerPass(Registry);
40 initializePostDomOnlyPrinterPass(Registry);
41 initializeIVUsersPass(Registry);
42 initializeInstCountPass(Registry);
43 initializeIntervalPartitionPass(Registry);
44 initializeLazyValueInfoPass(Registry);
45 initializeLibCallAliasAnalysisPass(Registry);
46 initializeLintPass(Registry);
47 initializeLoopDependenceAnalysisPass(Registry);
48 initializeLoopInfoPass(Registry);
49 initializeMemDepPrinterPass(Registry);
50 initializeMemoryDependenceAnalysisPass(Registry);
51 initializeModuleDebugInfoPrinterPass(Registry);
52 initializePostDominatorTreePass(Registry);
53 initializeProfileEstimatorPassPass(Registry);
54 initializeNoProfileInfoPass(Registry);
55 initializeNoPathProfileInfoPass(Registry);
56 initializeProfileInfoAnalysisGroup(Registry);
57 initializePathProfileInfoAnalysisGroup(Registry);
58 initializeLoaderPassPass(Registry);
59 initializePathProfileLoaderPassPass(Registry);
60 initializeProfileVerifierPassPass(Registry);
61 initializePathProfileVerifierPass(Registry);
62 initializeRegionInfoPass(Registry);
63 initializeRegionViewerPass(Registry);
64 initializeRegionPrinterPass(Registry);
65 initializeRegionOnlyViewerPass(Registry);
66 initializeRegionOnlyPrinterPass(Registry);
67 initializeScalarEvolutionPass(Registry);
68 initializeScalarEvolutionAliasAnalysisPass(Registry);
69 initializeTypeBasedAliasAnalysisPass(Registry);
72 void LLVMInitializeAnalysis(LLVMPassRegistryRef R) {
73 initializeAnalysis(*unwrap(R));
76 LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
77 char **OutMessages) {
78 std::string Messages;
80 LLVMBool Result = verifyModule(*unwrap(M),
81 static_cast<VerifierFailureAction>(Action),
82 OutMessages? &Messages : 0);
84 if (OutMessages)
85 *OutMessages = strdup(Messages.c_str());
87 return Result;
90 LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action) {
91 return verifyFunction(*unwrap<Function>(Fn),
92 static_cast<VerifierFailureAction>(Action));
95 void LLVMViewFunctionCFG(LLVMValueRef Fn) {
96 Function *F = unwrap<Function>(Fn);
97 F->viewCFG();
100 void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
101 Function *F = unwrap<Function>(Fn);
102 F->viewCFGOnly();