move header
[oota-llvm.git] / include / llvm / Analysis / LinkAllAnalyses.h
1 //===- LinkAllAnalyses.h - Reference All Analysis Passes --------*- C++ -*-===//
2 //
3 //                      The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Chris Lattner and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header file pulls in all analysis passes for tools like analyze and
11 // bugpoint that need this functionality.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_ANALYSIS_LINKALLANALYSES_H
16 #define LLVM_ANALYSIS_LINKALLANALYSES_H
17
18 #include "llvm/Analysis/AliasSetTracker.h"
19 #include "llvm/Analysis/FindUsedTypes.h"
20 #include "llvm/Analysis/IntervalPartition.h"
21 #include "llvm/Analysis/PostDominators.h"
22 #include "llvm/Analysis/Passes.h"
23 #include "llvm/Analysis/ScalarEvolution.h"
24 #include "llvm/Analysis/DataStructure/DataStructure.h"
25 #include "llvm/Analysis/DataStructure/CallTargets.h"
26 #include "llvm/Function.h"
27 #include <cstdlib>
28
29 namespace {
30   struct ForceAnalysisPassLinking {
31     ForceAnalysisPassLinking() {
32       // We must reference the passes in such a way that compilers will not
33       // delete it all as dead code, even with whole program optimization,
34       // yet is effectively a NO-OP. As the compiler isn't smart enough
35       // to know that getenv() never returns -1, this will do the job.
36       if (std::getenv("bar") != (char*) -1)
37         return;
38
39       (void)new llvm::LocalDataStructures();
40       (void)new llvm::BUDataStructures();
41       (void)new llvm::TDDataStructures();
42       (void)new llvm::CompleteBUDataStructures();
43       (void)new llvm::EquivClassGraphs();
44       (void)llvm::createDataStructureStatsPass();
45       (void)llvm::createDataStructureGraphCheckerPass();
46       (void)llvm::createProfileLoaderPass();
47       (void)llvm::createNoProfileInfoPass();
48       (void)llvm::createInstCountPass();
49       (void)new llvm::IntervalPartition();
50       (void)new llvm::ImmediateDominators();
51       (void)new llvm::PostDominatorSet();
52       (void)new llvm::FindUsedTypes();
53       (void)new llvm::ScalarEvolution();
54       (void)new llvm::CallTargetFinder();
55       ((llvm::Function*)0)->viewCFGOnly();
56       llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0);
57       X.add((llvm::Value*)0, 0);  // for -print-alias-sets
58     }
59   } ForceAnalysisPassLinking;
60 }
61
62 #endif