LCOV - code coverage report
Current view: top level - include/llvm - LinkAllPasses.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 4 164 2.4 %
Date: 2018-05-20 00:06:23 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/AggressiveInstCombine/AggressiveInstCombine.h"
      43             : #include "llvm/Transforms/IPO.h"
      44             : #include "llvm/Transforms/IPO/AlwaysInliner.h"
      45             : #include "llvm/Transforms/IPO/FunctionAttrs.h"
      46             : #include "llvm/Transforms/InstCombine/InstCombine.h"
      47             : #include "llvm/Transforms/Instrumentation.h"
      48             : #include "llvm/Transforms/Instrumentation/BoundsChecking.h"
      49             : #include "llvm/Transforms/ObjCARC.h"
      50             : #include "llvm/Transforms/Scalar.h"
      51             : #include "llvm/Transforms/Scalar/GVN.h"
      52             : #include "llvm/Transforms/Utils.h"
      53             : #include "llvm/Transforms/Utils/SymbolRewriter.h"
      54             : #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
      55             : #include "llvm/Transforms/Vectorize.h"
      56             : #include <cstdlib>
      57             : 
      58             : namespace {
      59             :   struct ForcePassLinking {
      60       49032 :     ForcePassLinking() {
      61             :       // We must reference the passes in such a way that compilers will not
      62             :       // delete it all as dead code, even with whole program optimization,
      63             :       // yet is effectively a NO-OP. As the compiler isn't smart enough
      64             :       // to know that getenv() never returns -1, this will do the job.
      65       49032 :       if (std::getenv("bar") != (char*) -1)
      66       49032 :         return;
      67             : 
      68           0 :       (void) llvm::createAAEvalPass();
      69           0 :       (void) llvm::createAggressiveDCEPass();
      70           0 :       (void) llvm::createAggressiveInstCombinerPass();
      71           0 :       (void) llvm::createBitTrackingDCEPass();
      72           0 :       (void) llvm::createArgumentPromotionPass();
      73           0 :       (void) llvm::createAlignmentFromAssumptionsPass();
      74           0 :       (void) llvm::createBasicAAWrapperPass();
      75           0 :       (void) llvm::createSCEVAAWrapperPass();
      76           0 :       (void) llvm::createTypeBasedAAWrapperPass();
      77           0 :       (void) llvm::createScopedNoAliasAAWrapperPass();
      78           0 :       (void) llvm::createBoundsCheckingLegacyPass();
      79           0 :       (void) llvm::createBreakCriticalEdgesPass();
      80           0 :       (void) llvm::createCallGraphDOTPrinterPass();
      81           0 :       (void) llvm::createCallGraphViewerPass();
      82           0 :       (void) llvm::createCFGSimplificationPass();
      83           0 :       (void) llvm::createCFLAndersAAWrapperPass();
      84           0 :       (void) llvm::createCFLSteensAAWrapperPass();
      85           0 :       (void) llvm::createStructurizeCFGPass();
      86           0 :       (void) llvm::createLibCallsShrinkWrapPass();
      87           0 :       (void) llvm::createCalledValuePropagationPass();
      88           0 :       (void) llvm::createConstantMergePass();
      89           0 :       (void) llvm::createConstantPropagationPass();
      90           0 :       (void) llvm::createCostModelAnalysisPass();
      91           0 :       (void) llvm::createDeadArgEliminationPass();
      92           0 :       (void) llvm::createDeadCodeEliminationPass();
      93           0 :       (void) llvm::createDeadInstEliminationPass();
      94           0 :       (void) llvm::createDeadStoreEliminationPass();
      95           0 :       (void) llvm::createDependenceAnalysisWrapperPass();
      96           0 :       (void) llvm::createDivergenceAnalysisPass();
      97           0 :       (void) llvm::createDomOnlyPrinterPass();
      98           0 :       (void) llvm::createDomPrinterPass();
      99           0 :       (void) llvm::createDomOnlyViewerPass();
     100           0 :       (void) llvm::createDomViewerPass();
     101           0 :       (void) llvm::createGCOVProfilerPass();
     102           0 :       (void) llvm::createPGOInstrumentationGenLegacyPass();
     103           0 :       (void) llvm::createPGOInstrumentationUseLegacyPass();
     104           0 :       (void) llvm::createPGOIndirectCallPromotionLegacyPass();
     105           0 :       (void) llvm::createPGOMemOPSizeOptLegacyPass();
     106           0 :       (void) llvm::createInstrProfilingLegacyPass();
     107           0 :       (void) llvm::createFunctionImportPass();
     108           0 :       (void) llvm::createFunctionInliningPass();
     109           0 :       (void) llvm::createAlwaysInlinerLegacyPass();
     110           0 :       (void) llvm::createGlobalDCEPass();
     111           0 :       (void) llvm::createGlobalOptimizerPass();
     112           0 :       (void) llvm::createGlobalsAAWrapperPass();
     113           0 :       (void) llvm::createGuardWideningPass();
     114           0 :       (void) llvm::createLoopGuardWideningPass();
     115           0 :       (void) llvm::createIPConstantPropagationPass();
     116           0 :       (void) llvm::createIPSCCPPass();
     117           0 :       (void) llvm::createInductiveRangeCheckEliminationPass();
     118           0 :       (void) llvm::createIndVarSimplifyPass();
     119           0 :       (void) llvm::createInstructionCombiningPass();
     120           0 :       (void) llvm::createInternalizePass();
     121           0 :       (void) llvm::createLCSSAPass();
     122           0 :       (void) llvm::createLICMPass();
     123           0 :       (void) llvm::createLoopSinkPass();
     124           0 :       (void) llvm::createLazyValueInfoPass();
     125           0 :       (void) llvm::createLoopExtractorPass();
     126           0 :       (void) llvm::createLoopInterchangePass();
     127           0 :       (void) llvm::createLoopPredicationPass();
     128           0 :       (void) llvm::createLoopSimplifyPass();
     129           0 :       (void) llvm::createLoopSimplifyCFGPass();
     130           0 :       (void) llvm::createLoopStrengthReducePass();
     131           0 :       (void) llvm::createLoopRerollPass();
     132           0 :       (void) llvm::createLoopUnrollPass();
     133           0 :       (void) llvm::createLoopUnswitchPass();
     134           0 :       (void) llvm::createLoopVersioningLICMPass();
     135           0 :       (void) llvm::createLoopIdiomPass();
     136           0 :       (void) llvm::createLoopRotatePass();
     137           0 :       (void) llvm::createLowerExpectIntrinsicPass();
     138           0 :       (void) llvm::createLowerInvokePass();
     139           0 :       (void) llvm::createLowerSwitchPass();
     140           0 :       (void) llvm::createNaryReassociatePass();
     141           0 :       (void) llvm::createObjCARCAAWrapperPass();
     142           0 :       (void) llvm::createObjCARCAPElimPass();
     143           0 :       (void) llvm::createObjCARCExpandPass();
     144           0 :       (void) llvm::createObjCARCContractPass();
     145           0 :       (void) llvm::createObjCARCOptPass();
     146           0 :       (void) llvm::createPAEvalPass();
     147           0 :       (void) llvm::createPromoteMemoryToRegisterPass();
     148           0 :       (void) llvm::createDemoteRegisterToMemoryPass();
     149           0 :       (void) llvm::createPruneEHPass();
     150           0 :       (void) llvm::createPostDomOnlyPrinterPass();
     151           0 :       (void) llvm::createPostDomPrinterPass();
     152           0 :       (void) llvm::createPostDomOnlyViewerPass();
     153           0 :       (void) llvm::createPostDomViewerPass();
     154           0 :       (void) llvm::createReassociatePass();
     155           0 :       (void) llvm::createRegionInfoPass();
     156           0 :       (void) llvm::createRegionOnlyPrinterPass();
     157           0 :       (void) llvm::createRegionOnlyViewerPass();
     158           0 :       (void) llvm::createRegionPrinterPass();
     159           0 :       (void) llvm::createRegionViewerPass();
     160           0 :       (void) llvm::createSCCPPass();
     161           0 :       (void) llvm::createSafeStackPass();
     162           0 :       (void) llvm::createSROAPass();
     163           0 :       (void) llvm::createSingleLoopExtractorPass();
     164           0 :       (void) llvm::createStripSymbolsPass();
     165           0 :       (void) llvm::createStripNonDebugSymbolsPass();
     166           0 :       (void) llvm::createStripDeadDebugInfoPass();
     167           0 :       (void) llvm::createStripDeadPrototypesPass();
     168           0 :       (void) llvm::createTailCallEliminationPass();
     169           0 :       (void) llvm::createJumpThreadingPass();
     170           0 :       (void) llvm::createUnifyFunctionExitNodesPass();
     171           0 :       (void) llvm::createInstCountPass();
     172           0 :       (void) llvm::createConstantHoistingPass();
     173           0 :       (void) llvm::createCodeGenPreparePass();
     174           0 :       (void) llvm::createEntryExitInstrumenterPass();
     175           0 :       (void) llvm::createPostInlineEntryExitInstrumenterPass();
     176           0 :       (void) llvm::createEarlyCSEPass();
     177           0 :       (void) llvm::createGVNHoistPass();
     178           0 :       (void) llvm::createMergedLoadStoreMotionPass();
     179           0 :       (void) llvm::createGVNPass();
     180           0 :       (void) llvm::createNewGVNPass();
     181           0 :       (void) llvm::createMemCpyOptPass();
     182           0 :       (void) llvm::createLoopDeletionPass();
     183           0 :       (void) llvm::createPostDomTree();
     184           0 :       (void) llvm::createInstructionNamerPass();
     185           0 :       (void) llvm::createMetaRenamerPass();
     186           0 :       (void) llvm::createPostOrderFunctionAttrsLegacyPass();
     187           0 :       (void) llvm::createReversePostOrderFunctionAttrsPass();
     188           0 :       (void) llvm::createMergeFunctionsPass();
     189           0 :       (void) llvm::createMergeICmpsPass();
     190           0 :       (void) llvm::createExpandMemCmpPass();
     191             :       std::string buf;
     192           0 :       llvm::raw_string_ostream os(buf);
     193           0 :       (void) llvm::createPrintModulePass(os);
     194           0 :       (void) llvm::createPrintFunctionPass(os);
     195           0 :       (void) llvm::createPrintBasicBlockPass(os);
     196           0 :       (void) llvm::createModuleDebugInfoPrinterPass();
     197           0 :       (void) llvm::createPartialInliningPass();
     198           0 :       (void) llvm::createLintPass();
     199           0 :       (void) llvm::createSinkingPass();
     200           0 :       (void) llvm::createLowerAtomicPass();
     201           0 :       (void) llvm::createCorrelatedValuePropagationPass();
     202           0 :       (void) llvm::createMemDepPrinter();
     203           0 :       (void) llvm::createInstructionSimplifierPass();
     204           0 :       (void) llvm::createLoopVectorizePass();
     205           0 :       (void) llvm::createSLPVectorizerPass();
     206           0 :       (void) llvm::createLoadStoreVectorizerPass();
     207           0 :       (void) llvm::createPartiallyInlineLibCallsPass();
     208           0 :       (void) llvm::createScalarizerPass();
     209           0 :       (void) llvm::createSeparateConstOffsetFromGEPPass();
     210           0 :       (void) llvm::createSpeculativeExecutionPass();
     211           0 :       (void) llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
     212           0 :       (void) llvm::createRewriteSymbolsPass();
     213           0 :       (void) llvm::createStraightLineStrengthReducePass();
     214           0 :       (void) llvm::createMemDerefPrinter();
     215           0 :       (void) llvm::createMustExecutePrinter();
     216           0 :       (void) llvm::createFloat2IntPass();
     217           0 :       (void) llvm::createEliminateAvailableExternallyPass();
     218           0 :       (void) llvm::createScalarizeMaskedMemIntrinPass();
     219             : 
     220           0 :       (void)new llvm::IntervalPartition();
     221           0 :       (void)new llvm::ScalarEvolutionWrapperPass();
     222           0 :       llvm::Function::Create(nullptr, llvm::GlobalValue::ExternalLinkage)->viewCFGOnly();
     223           0 :       llvm::RGPassManager RGM;
     224           0 :       llvm::TargetLibraryInfoImpl TLII;
     225             :       llvm::TargetLibraryInfo TLI(TLII);
     226           0 :       llvm::AliasAnalysis AA(TLI);
     227           0 :       llvm::AliasSetTracker X(AA);
     228           0 :       X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
     229           0 :       (void) llvm::AreStatisticsEnabled();
     230           0 :       (void) llvm::sys::RunningOnValgrind();
     231             :     }
     232       49032 :   } ForcePassLinking; // Force link by creating a global definition.
     233             : }
     234             : 
     235             : #endif

Generated by: LCOV version 1.13