LCOV - code coverage report
Current view: top level - include/llvm - LinkAllPasses.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 4 161 2.5 %
Date: 2017-09-14 15:23:50 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
       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             : //===----------------------------------------------------------------------===//
       9             : //
      10             : // This header file pulls in all transformation and analysis passes for tools
      11             : // like opt and bugpoint that need this functionality.
      12             : //
      13             : //===----------------------------------------------------------------------===//
      14             : 
      15             : #ifndef LLVM_LINKALLPASSES_H
      16             : #define LLVM_LINKALLPASSES_H
      17             : 
      18             : #include "llvm/ADT/Statistic.h"
      19             : #include "llvm/Analysis/AliasAnalysisEvaluator.h"
      20             : #include "llvm/Analysis/AliasSetTracker.h"
      21             : #include "llvm/Analysis/BasicAliasAnalysis.h"
      22             : #include "llvm/Analysis/CFLAndersAliasAnalysis.h"
      23             : #include "llvm/Analysis/CFLSteensAliasAnalysis.h"
      24             : #include "llvm/Analysis/CallPrinter.h"
      25             : #include "llvm/Analysis/DomPrinter.h"
      26             : #include "llvm/Analysis/GlobalsModRef.h"
      27             : #include "llvm/Analysis/IntervalPartition.h"
      28             : #include "llvm/Analysis/Lint.h"
      29             : #include "llvm/Analysis/Passes.h"
      30             : #include "llvm/Analysis/PostDominators.h"
      31             : #include "llvm/Analysis/RegionPass.h"
      32             : #include "llvm/Analysis/RegionPrinter.h"
      33             : #include "llvm/Analysis/ScalarEvolution.h"
      34             : #include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
      35             : #include "llvm/Analysis/ScopedNoAliasAA.h"
      36             : #include "llvm/Analysis/TargetLibraryInfo.h"
      37             : #include "llvm/Analysis/TypeBasedAliasAnalysis.h"
      38             : #include "llvm/CodeGen/Passes.h"
      39             : #include "llvm/IR/Function.h"
      40             : #include "llvm/IR/IRPrintingPasses.h"
      41             : #include "llvm/Support/Valgrind.h"
      42             : #include "llvm/Transforms/IPO.h"
      43             : #include "llvm/Transforms/IPO/AlwaysInliner.h"
      44             : #include "llvm/Transforms/IPO/FunctionAttrs.h"
      45             : #include "llvm/Transforms/Instrumentation.h"
      46             : #include "llvm/Transforms/ObjCARC.h"
      47             : #include "llvm/Transforms/Scalar.h"
      48             : #include "llvm/Transforms/Scalar/GVN.h"
      49             : #include "llvm/Transforms/Utils/SymbolRewriter.h"
      50             : #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
      51             : #include "llvm/Transforms/Vectorize.h"
      52             : #include <cstdlib>
      53             : 
      54             : namespace {
      55             :   struct ForcePassLinking {
      56       30965 :     ForcePassLinking() {
      57             :       // We must reference the passes in such a way that compilers will not
      58             :       // delete it all as dead code, even with whole program optimization,
      59             :       // yet is effectively a NO-OP. As the compiler isn't smart enough
      60             :       // to know that getenv() never returns -1, this will do the job.
      61       30965 :       if (std::getenv("bar") != (char*) -1)
      62       30965 :         return;
      63             : 
      64           0 :       (void) llvm::createAAEvalPass();
      65           0 :       (void) llvm::createAggressiveDCEPass();
      66           0 :       (void) llvm::createBitTrackingDCEPass();
      67           0 :       (void) llvm::createArgumentPromotionPass();
      68           0 :       (void) llvm::createAlignmentFromAssumptionsPass();
      69           0 :       (void) llvm::createBasicAAWrapperPass();
      70           0 :       (void) llvm::createSCEVAAWrapperPass();
      71           0 :       (void) llvm::createTypeBasedAAWrapperPass();
      72           0 :       (void) llvm::createScopedNoAliasAAWrapperPass();
      73           0 :       (void) llvm::createBoundsCheckingPass();
      74           0 :       (void) llvm::createBreakCriticalEdgesPass();
      75           0 :       (void) llvm::createCallGraphDOTPrinterPass();
      76           0 :       (void) llvm::createCallGraphViewerPass();
      77           0 :       (void) llvm::createCFGSimplificationPass();
      78           0 :       (void) llvm::createLateCFGSimplificationPass();
      79           0 :       (void) llvm::createCFLAndersAAWrapperPass();
      80           0 :       (void) llvm::createCFLSteensAAWrapperPass();
      81           0 :       (void) llvm::createStructurizeCFGPass();
      82           0 :       (void) llvm::createLibCallsShrinkWrapPass();
      83           0 :       (void) llvm::createConstantMergePass();
      84           0 :       (void) llvm::createConstantPropagationPass();
      85           0 :       (void) llvm::createCostModelAnalysisPass();
      86           0 :       (void) llvm::createDeadArgEliminationPass();
      87           0 :       (void) llvm::createDeadCodeEliminationPass();
      88           0 :       (void) llvm::createDeadInstEliminationPass();
      89           0 :       (void) llvm::createDeadStoreEliminationPass();
      90           0 :       (void) llvm::createDependenceAnalysisWrapperPass();
      91           0 :       (void) llvm::createDivergenceAnalysisPass();
      92           0 :       (void) llvm::createDomOnlyPrinterPass();
      93           0 :       (void) llvm::createDomPrinterPass();
      94           0 :       (void) llvm::createDomOnlyViewerPass();
      95           0 :       (void) llvm::createDomViewerPass();
      96           0 :       (void) llvm::createGCOVProfilerPass();
      97           0 :       (void) llvm::createPGOInstrumentationGenLegacyPass();
      98           0 :       (void) llvm::createPGOInstrumentationUseLegacyPass();
      99           0 :       (void) llvm::createPGOIndirectCallPromotionLegacyPass();
     100           0 :       (void) llvm::createPGOMemOPSizeOptLegacyPass();
     101           0 :       (void) llvm::createInstrProfilingLegacyPass();
     102           0 :       (void) llvm::createFunctionImportPass();
     103           0 :       (void) llvm::createFunctionInliningPass();
     104           0 :       (void) llvm::createAlwaysInlinerLegacyPass();
     105           0 :       (void) llvm::createGlobalDCEPass();
     106           0 :       (void) llvm::createGlobalOptimizerPass();
     107           0 :       (void) llvm::createGlobalsAAWrapperPass();
     108           0 :       (void) llvm::createGuardWideningPass();
     109           0 :       (void) llvm::createIPConstantPropagationPass();
     110           0 :       (void) llvm::createIPSCCPPass();
     111           0 :       (void) llvm::createInductiveRangeCheckEliminationPass();
     112           0 :       (void) llvm::createIndVarSimplifyPass();
     113           0 :       (void) llvm::createInstructionCombiningPass();
     114           0 :       (void) llvm::createInternalizePass();
     115           0 :       (void) llvm::createLCSSAPass();
     116           0 :       (void) llvm::createLICMPass();
     117           0 :       (void) llvm::createLoopSinkPass();
     118           0 :       (void) llvm::createLazyValueInfoPass();
     119           0 :       (void) llvm::createLoopExtractorPass();
     120           0 :       (void) llvm::createLoopInterchangePass();
     121           0 :       (void) llvm::createLoopPredicationPass();
     122           0 :       (void) llvm::createLoopSimplifyPass();
     123           0 :       (void) llvm::createLoopSimplifyCFGPass();
     124           0 :       (void) llvm::createLoopStrengthReducePass();
     125           0 :       (void) llvm::createLoopRerollPass();
     126           0 :       (void) llvm::createLoopUnrollPass();
     127           0 :       (void) llvm::createLoopUnswitchPass();
     128           0 :       (void) llvm::createLoopVersioningLICMPass();
     129           0 :       (void) llvm::createLoopIdiomPass();
     130           0 :       (void) llvm::createLoopRotatePass();
     131           0 :       (void) llvm::createLowerExpectIntrinsicPass();
     132           0 :       (void) llvm::createLowerInvokePass();
     133           0 :       (void) llvm::createLowerSwitchPass();
     134           0 :       (void) llvm::createNaryReassociatePass();
     135           0 :       (void) llvm::createObjCARCAAWrapperPass();
     136           0 :       (void) llvm::createObjCARCAPElimPass();
     137           0 :       (void) llvm::createObjCARCExpandPass();
     138           0 :       (void) llvm::createObjCARCContractPass();
     139           0 :       (void) llvm::createObjCARCOptPass();
     140           0 :       (void) llvm::createPAEvalPass();
     141           0 :       (void) llvm::createPromoteMemoryToRegisterPass();
     142           0 :       (void) llvm::createDemoteRegisterToMemoryPass();
     143           0 :       (void) llvm::createPruneEHPass();
     144           0 :       (void) llvm::createPostDomOnlyPrinterPass();
     145           0 :       (void) llvm::createPostDomPrinterPass();
     146           0 :       (void) llvm::createPostDomOnlyViewerPass();
     147           0 :       (void) llvm::createPostDomViewerPass();
     148           0 :       (void) llvm::createReassociatePass();
     149           0 :       (void) llvm::createRegionInfoPass();
     150           0 :       (void) llvm::createRegionOnlyPrinterPass();
     151           0 :       (void) llvm::createRegionOnlyViewerPass();
     152           0 :       (void) llvm::createRegionPrinterPass();
     153           0 :       (void) llvm::createRegionViewerPass();
     154           0 :       (void) llvm::createSCCPPass();
     155           0 :       (void) llvm::createSafeStackPass();
     156           0 :       (void) llvm::createSROAPass();
     157           0 :       (void) llvm::createSingleLoopExtractorPass();
     158           0 :       (void) llvm::createStripSymbolsPass();
     159           0 :       (void) llvm::createStripNonDebugSymbolsPass();
     160           0 :       (void) llvm::createStripDeadDebugInfoPass();
     161           0 :       (void) llvm::createStripDeadPrototypesPass();
     162           0 :       (void) llvm::createTailCallEliminationPass();
     163           0 :       (void) llvm::createJumpThreadingPass();
     164           0 :       (void) llvm::createUnifyFunctionExitNodesPass();
     165           0 :       (void) llvm::createInstCountPass();
     166           0 :       (void) llvm::createConstantHoistingPass();
     167           0 :       (void) llvm::createCodeGenPreparePass();
     168           0 :       (void) llvm::createCountingFunctionInserterPass();
     169           0 :       (void) llvm::createEarlyCSEPass();
     170           0 :       (void) llvm::createGVNHoistPass();
     171           0 :       (void) llvm::createMergedLoadStoreMotionPass();
     172           0 :       (void) llvm::createGVNPass();
     173           0 :       (void) llvm::createNewGVNPass();
     174           0 :       (void) llvm::createMemCpyOptPass();
     175           0 :       (void) llvm::createLoopDeletionPass();
     176           0 :       (void) llvm::createPostDomTree();
     177           0 :       (void) llvm::createInstructionNamerPass();
     178           0 :       (void) llvm::createMetaRenamerPass();
     179           0 :       (void) llvm::createPostOrderFunctionAttrsLegacyPass();
     180           0 :       (void) llvm::createReversePostOrderFunctionAttrsPass();
     181           0 :       (void) llvm::createMergeFunctionsPass();
     182           0 :       (void) llvm::createMergeICmpsPass();
     183           0 :       std::string buf;
     184           0 :       llvm::raw_string_ostream os(buf);
     185           0 :       (void) llvm::createPrintModulePass(os);
     186           0 :       (void) llvm::createPrintFunctionPass(os);
     187           0 :       (void) llvm::createPrintBasicBlockPass(os);
     188           0 :       (void) llvm::createModuleDebugInfoPrinterPass();
     189           0 :       (void) llvm::createPartialInliningPass();
     190           0 :       (void) llvm::createLintPass();
     191           0 :       (void) llvm::createSinkingPass();
     192           0 :       (void) llvm::createLowerAtomicPass();
     193           0 :       (void) llvm::createCorrelatedValuePropagationPass();
     194           0 :       (void) llvm::createMemDepPrinter();
     195           0 :       (void) llvm::createInstructionSimplifierPass();
     196           0 :       (void) llvm::createLoopVectorizePass();
     197           0 :       (void) llvm::createSLPVectorizerPass();
     198           0 :       (void) llvm::createLoadStoreVectorizerPass();
     199           0 :       (void) llvm::createPartiallyInlineLibCallsPass();
     200           0 :       (void) llvm::createScalarizerPass();
     201           0 :       (void) llvm::createSeparateConstOffsetFromGEPPass();
     202           0 :       (void) llvm::createSpeculativeExecutionPass();
     203           0 :       (void) llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
     204           0 :       (void) llvm::createRewriteSymbolsPass();
     205           0 :       (void) llvm::createStraightLineStrengthReducePass();
     206           0 :       (void) llvm::createMemDerefPrinter();
     207           0 :       (void) llvm::createFloat2IntPass();
     208           0 :       (void) llvm::createEliminateAvailableExternallyPass();
     209           0 :       (void) llvm::createScalarizeMaskedMemIntrinPass();
     210             : 
     211           0 :       (void)new llvm::IntervalPartition();
     212           0 :       (void)new llvm::ScalarEvolutionWrapperPass();
     213           0 :       llvm::Function::Create(nullptr, llvm::GlobalValue::ExternalLinkage)->viewCFGOnly();
     214           0 :       llvm::RGPassManager RGM;
     215           0 :       llvm::TargetLibraryInfoImpl TLII;
     216           0 :       llvm::TargetLibraryInfo TLI(TLII);
     217           0 :       llvm::AliasAnalysis AA(TLI);
     218           0 :       llvm::AliasSetTracker X(AA);
     219           0 :       X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
     220           0 :       (void) llvm::AreStatisticsEnabled();
     221           0 :       (void) llvm::sys::RunningOnValgrind();
     222             :     }
     223       30965 :   } ForcePassLinking; // Force link by creating a global definition.
     224             : }
     225             : 
     226             : #endif

Generated by: LCOV version 1.13