LLVM API Documentation

LinkAllAnalyses.h

Go to the documentation of this file.
00001 //===- LinkAllAnalyses.h - Reference All Analysis Passes --------*- C++ -*-===//
00002 //
00003 //                      The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by Chris Lattner and is distributed under the
00006 // University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This header file pulls in all analysis passes for tools like analyze and
00011 // bugpoint that need this functionality.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_ANALYSIS_LINKALLANALYSES_H
00016 #define LLVM_ANALYSIS_LINKALLANALYSES_H
00017 
00018 #include "llvm/Analysis/AliasSetTracker.h"
00019 #include "llvm/Analysis/FindUsedTypes.h"
00020 #include "llvm/Analysis/IntervalPartition.h"
00021 #include "llvm/Analysis/PostDominators.h"
00022 #include "llvm/Analysis/Passes.h"
00023 #include "llvm/Analysis/ScalarEvolution.h"
00024 #include "llvm/Analysis/DataStructure/DataStructure.h"
00025 #include "llvm/Analysis/DataStructure/CallTargets.h"
00026 #include "llvm/Function.h"
00027 #include <cstdlib>
00028 
00029 namespace {
00030   struct ForceAnalysisPassLinking {
00031     ForceAnalysisPassLinking() {
00032       // We must reference the passes in such a way that compilers will not
00033       // delete it all as dead code, even with whole program optimization,
00034       // yet is effectively a NO-OP. As the compiler isn't smart enough
00035       // to know that getenv() never returns -1, this will do the job.
00036       if (std::getenv("bar") != (char*) -1)
00037         return;
00038 
00039       (void)new llvm::LocalDataStructures();
00040       (void)new llvm::BUDataStructures();
00041       (void)new llvm::TDDataStructures();
00042       (void)new llvm::CompleteBUDataStructures();
00043       (void)new llvm::EquivClassGraphs();
00044       (void)llvm::createDataStructureStatsPass();
00045       (void)llvm::createDataStructureGraphCheckerPass();
00046       (void)llvm::createProfileLoaderPass();
00047       (void)llvm::createNoProfileInfoPass();
00048       (void)llvm::createInstCountPass();
00049       (void)new llvm::IntervalPartition();
00050       (void)new llvm::ImmediateDominators();
00051       (void)new llvm::PostDominatorSet();
00052       (void)new llvm::FindUsedTypes();
00053       (void)new llvm::ScalarEvolution();
00054       (void)new llvm::CallTargetFinder();
00055       ((llvm::Function*)0)->viewCFGOnly();
00056       llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0);
00057       X.add((llvm::Value*)0, 0);  // for -print-alias-sets
00058     }
00059   } ForceAnalysisPassLinking;
00060 }
00061 
00062 #endif