LLVM API Documentation

LinkAllPasses.h
Go to the documentation of this file.
00001 //===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
00002 //
00003 //                      The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This header file pulls in all transformation and analysis passes for tools
00011 // like opt and bugpoint that need this functionality.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_LINKALLPASSES_H
00016 #define LLVM_LINKALLPASSES_H
00017 
00018 #include "llvm/Analysis/AliasSetTracker.h"
00019 #include "llvm/Analysis/CallPrinter.h"
00020 #include "llvm/Analysis/DomPrinter.h"
00021 #include "llvm/Analysis/FindUsedTypes.h"
00022 #include "llvm/Analysis/IntervalPartition.h"
00023 #include "llvm/Analysis/Lint.h"
00024 #include "llvm/Analysis/Passes.h"
00025 #include "llvm/Analysis/PostDominators.h"
00026 #include "llvm/Analysis/RegionPass.h"
00027 #include "llvm/Analysis/RegionPrinter.h"
00028 #include "llvm/Analysis/ScalarEvolution.h"
00029 #include "llvm/CodeGen/Passes.h"
00030 #include "llvm/IR/Function.h"
00031 #include "llvm/IR/IRPrintingPasses.h"
00032 #include "llvm/Transforms/IPO.h"
00033 #include "llvm/Transforms/Instrumentation.h"
00034 #include "llvm/Transforms/ObjCARC.h"
00035 #include "llvm/Transforms/Scalar.h"
00036 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
00037 #include "llvm/Transforms/Vectorize.h"
00038 #include <cstdlib>
00039 
00040 namespace {
00041   struct ForcePassLinking {
00042     ForcePassLinking() {
00043       // We must reference the passes in such a way that compilers will not
00044       // delete it all as dead code, even with whole program optimization,
00045       // yet is effectively a NO-OP. As the compiler isn't smart enough
00046       // to know that getenv() never returns -1, this will do the job.
00047       if (std::getenv("bar") != (char*) -1)
00048         return;
00049 
00050       (void) llvm::createAAEvalPass();
00051       (void) llvm::createAggressiveDCEPass();
00052       (void) llvm::createAliasAnalysisCounterPass();
00053       (void) llvm::createAliasDebugger();
00054       (void) llvm::createArgumentPromotionPass();
00055       (void) llvm::createAlignmentFromAssumptionsPass();
00056       (void) llvm::createBasicAliasAnalysisPass();
00057       (void) llvm::createLibCallAliasAnalysisPass(nullptr);
00058       (void) llvm::createScalarEvolutionAliasAnalysisPass();
00059       (void) llvm::createTypeBasedAliasAnalysisPass();
00060       (void) llvm::createScopedNoAliasAAPass();
00061       (void) llvm::createBoundsCheckingPass();
00062       (void) llvm::createBreakCriticalEdgesPass();
00063       (void) llvm::createCallGraphPrinterPass();
00064       (void) llvm::createCallGraphViewerPass();
00065       (void) llvm::createCFGSimplificationPass();
00066       (void) llvm::createCFLAliasAnalysisPass();
00067       (void) llvm::createStructurizeCFGPass();
00068       (void) llvm::createConstantMergePass();
00069       (void) llvm::createConstantPropagationPass();
00070       (void) llvm::createCostModelAnalysisPass();
00071       (void) llvm::createDeadArgEliminationPass();
00072       (void) llvm::createDeadCodeEliminationPass();
00073       (void) llvm::createDeadInstEliminationPass();
00074       (void) llvm::createDeadStoreEliminationPass();
00075       (void) llvm::createDependenceAnalysisPass();
00076       (void) llvm::createDomOnlyPrinterPass();
00077       (void) llvm::createDomPrinterPass();
00078       (void) llvm::createDomOnlyViewerPass();
00079       (void) llvm::createDomViewerPass();
00080       (void) llvm::createGCOVProfilerPass();
00081       (void) llvm::createFunctionInliningPass();
00082       (void) llvm::createAlwaysInlinerPass();
00083       (void) llvm::createGlobalDCEPass();
00084       (void) llvm::createGlobalOptimizerPass();
00085       (void) llvm::createGlobalsModRefPass();
00086       (void) llvm::createIPConstantPropagationPass();
00087       (void) llvm::createIPSCCPPass();
00088       (void) llvm::createIndVarSimplifyPass();
00089       (void) llvm::createInstructionCombiningPass();
00090       (void) llvm::createInternalizePass();
00091       (void) llvm::createJumpInstrTableInfoPass();
00092       (void) llvm::createJumpInstrTablesPass();
00093       (void) llvm::createLCSSAPass();
00094       (void) llvm::createLICMPass();
00095       (void) llvm::createLazyValueInfoPass();
00096       (void) llvm::createLoopExtractorPass();
00097       (void) llvm::createLoopSimplifyPass();
00098       (void) llvm::createLoopStrengthReducePass();
00099       (void) llvm::createLoopRerollPass();
00100       (void) llvm::createLoopUnrollPass();
00101       (void) llvm::createLoopUnswitchPass();
00102       (void) llvm::createLoopIdiomPass();
00103       (void) llvm::createLoopRotatePass();
00104       (void) llvm::createLowerExpectIntrinsicPass();
00105       (void) llvm::createLowerInvokePass();
00106       (void) llvm::createLowerSwitchPass();
00107       (void) llvm::createNoAAPass();
00108       (void) llvm::createObjCARCAliasAnalysisPass();
00109       (void) llvm::createObjCARCAPElimPass();
00110       (void) llvm::createObjCARCExpandPass();
00111       (void) llvm::createObjCARCContractPass();
00112       (void) llvm::createObjCARCOptPass();
00113       (void) llvm::createPromoteMemoryToRegisterPass();
00114       (void) llvm::createDemoteRegisterToMemoryPass();
00115       (void) llvm::createPruneEHPass();
00116       (void) llvm::createPostDomOnlyPrinterPass();
00117       (void) llvm::createPostDomPrinterPass();
00118       (void) llvm::createPostDomOnlyViewerPass();
00119       (void) llvm::createPostDomViewerPass();
00120       (void) llvm::createReassociatePass();
00121       (void) llvm::createRegionInfoPass();
00122       (void) llvm::createRegionOnlyPrinterPass();
00123       (void) llvm::createRegionOnlyViewerPass();
00124       (void) llvm::createRegionPrinterPass();
00125       (void) llvm::createRegionViewerPass();
00126       (void) llvm::createSCCPPass();
00127       (void) llvm::createScalarReplAggregatesPass();
00128       (void) llvm::createSingleLoopExtractorPass();
00129       (void) llvm::createStripSymbolsPass();
00130       (void) llvm::createStripNonDebugSymbolsPass();
00131       (void) llvm::createStripDeadDebugInfoPass();
00132       (void) llvm::createStripDeadPrototypesPass();
00133       (void) llvm::createTailCallEliminationPass();
00134       (void) llvm::createJumpThreadingPass();
00135       (void) llvm::createUnifyFunctionExitNodesPass();
00136       (void) llvm::createInstCountPass();
00137       (void) llvm::createConstantHoistingPass();
00138       (void) llvm::createCodeGenPreparePass();
00139       (void) llvm::createEarlyCSEPass();
00140       (void) llvm::createMergedLoadStoreMotionPass();
00141       (void) llvm::createGVNPass();
00142       (void) llvm::createMemCpyOptPass();
00143       (void) llvm::createLoopDeletionPass();
00144       (void) llvm::createPostDomTree();
00145       (void) llvm::createInstructionNamerPass();
00146       (void) llvm::createMetaRenamerPass();
00147       (void) llvm::createFunctionAttrsPass();
00148       (void) llvm::createMergeFunctionsPass();
00149       (void) llvm::createPrintModulePass(*(llvm::raw_ostream*)nullptr);
00150       (void) llvm::createPrintFunctionPass(*(llvm::raw_ostream*)nullptr);
00151       (void) llvm::createPrintBasicBlockPass(*(llvm::raw_ostream*)nullptr);
00152       (void) llvm::createModuleDebugInfoPrinterPass();
00153       (void) llvm::createPartialInliningPass();
00154       (void) llvm::createLintPass();
00155       (void) llvm::createSinkingPass();
00156       (void) llvm::createLowerAtomicPass();
00157       (void) llvm::createCorrelatedValuePropagationPass();
00158       (void) llvm::createMemDepPrinter();
00159       (void) llvm::createInstructionSimplifierPass();
00160       (void) llvm::createLoopVectorizePass();
00161       (void) llvm::createSLPVectorizerPass();
00162       (void) llvm::createBBVectorizePass();
00163       (void) llvm::createPartiallyInlineLibCallsPass();
00164       (void) llvm::createScalarizerPass();
00165       (void) llvm::createSeparateConstOffsetFromGEPPass();
00166 
00167       (void)new llvm::IntervalPartition();
00168       (void)new llvm::FindUsedTypes();
00169       (void)new llvm::ScalarEvolution();
00170       ((llvm::Function*)nullptr)->viewCFGOnly();
00171       llvm::RGPassManager RGM;
00172       ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);
00173       llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);
00174       X.add((llvm::Value*)nullptr, 0, nullptr);  // for -print-alias-sets
00175     }
00176   } ForcePassLinking; // Force link by creating a global definition.
00177 }
00178 
00179 #endif