LCOV - code coverage report
Current view: top level - lib/Analysis - Analysis.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 74 94 78.7 %
Date: 2018-09-23 13:06:45 Functions: 2 7 28.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- Analysis.cpp ------------------------------------------------------===//
       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             : #include "llvm-c/Analysis.h"
      11             : #include "llvm-c/Initialization.h"
      12             : #include "llvm/IR/Module.h"
      13             : #include "llvm/IR/Verifier.h"
      14             : #include "llvm/InitializePasses.h"
      15             : #include "llvm/PassRegistry.h"
      16             : #include "llvm/Support/raw_ostream.h"
      17             : #include <cstring>
      18             : 
      19             : using namespace llvm;
      20             : 
      21             : /// initializeAnalysis - Initialize all passes linked into the Analysis library.
      22       10671 : void llvm::initializeAnalysis(PassRegistry &Registry) {
      23       10671 :   initializeAAEvalLegacyPassPass(Registry);
      24       10671 :   initializeAliasSetPrinterPass(Registry);
      25       10671 :   initializeBasicAAWrapperPassPass(Registry);
      26       10671 :   initializeBlockFrequencyInfoWrapperPassPass(Registry);
      27       10671 :   initializeBranchProbabilityInfoWrapperPassPass(Registry);
      28       10671 :   initializeCallGraphWrapperPassPass(Registry);
      29       10671 :   initializeCallGraphDOTPrinterPass(Registry);
      30       10671 :   initializeCallGraphPrinterLegacyPassPass(Registry);
      31       10671 :   initializeCallGraphViewerPass(Registry);
      32       10671 :   initializeCostModelAnalysisPass(Registry);
      33       10671 :   initializeCFGViewerLegacyPassPass(Registry);
      34       10671 :   initializeCFGPrinterLegacyPassPass(Registry);
      35       10671 :   initializeCFGOnlyViewerLegacyPassPass(Registry);
      36       10671 :   initializeCFGOnlyPrinterLegacyPassPass(Registry);
      37       10671 :   initializeCFLAndersAAWrapperPassPass(Registry);
      38       10671 :   initializeCFLSteensAAWrapperPassPass(Registry);
      39       10671 :   initializeDependenceAnalysisWrapperPassPass(Registry);
      40       10671 :   initializeDelinearizationPass(Registry);
      41       10671 :   initializeDemandedBitsWrapperPassPass(Registry);
      42       10671 :   initializeDominanceFrontierWrapperPassPass(Registry);
      43       10671 :   initializeDomViewerPass(Registry);
      44       10671 :   initializeDomPrinterPass(Registry);
      45       10671 :   initializeDomOnlyViewerPass(Registry);
      46       10671 :   initializePostDomViewerPass(Registry);
      47       10671 :   initializeDomOnlyPrinterPass(Registry);
      48       10671 :   initializePostDomPrinterPass(Registry);
      49       10671 :   initializePostDomOnlyViewerPass(Registry);
      50       10671 :   initializePostDomOnlyPrinterPass(Registry);
      51       10671 :   initializeAAResultsWrapperPassPass(Registry);
      52       10671 :   initializeGlobalsAAWrapperPassPass(Registry);
      53       10671 :   initializeIVUsersWrapperPassPass(Registry);
      54       10671 :   initializeInstCountPass(Registry);
      55       10671 :   initializeIntervalPartitionPass(Registry);
      56       10671 :   initializeLazyBranchProbabilityInfoPassPass(Registry);
      57       10671 :   initializeLazyBlockFrequencyInfoPassPass(Registry);
      58       10671 :   initializeLazyValueInfoWrapperPassPass(Registry);
      59       10671 :   initializeLazyValueInfoPrinterPass(Registry);
      60       10671 :   initializeLegacyDivergenceAnalysisPass(Registry);
      61       10671 :   initializeLintPass(Registry);
      62       10671 :   initializeLoopInfoWrapperPassPass(Registry);
      63       10671 :   initializeMemDepPrinterPass(Registry);
      64       10671 :   initializeMemDerefPrinterPass(Registry);
      65       10671 :   initializeMemoryDependenceWrapperPassPass(Registry);
      66       10671 :   initializeModuleDebugInfoPrinterPass(Registry);
      67       10671 :   initializeModuleSummaryIndexWrapperPassPass(Registry);
      68       10671 :   initializeMustExecutePrinterPass(Registry);
      69       10671 :   initializeObjCARCAAWrapperPassPass(Registry);
      70       10671 :   initializeOptimizationRemarkEmitterWrapperPassPass(Registry);
      71       10671 :   initializePhiValuesWrapperPassPass(Registry);
      72       10671 :   initializePostDominatorTreeWrapperPassPass(Registry);
      73       10671 :   initializeRegionInfoPassPass(Registry);
      74       10671 :   initializeRegionViewerPass(Registry);
      75       10671 :   initializeRegionPrinterPass(Registry);
      76       10671 :   initializeRegionOnlyViewerPass(Registry);
      77       10671 :   initializeRegionOnlyPrinterPass(Registry);
      78       10671 :   initializeSCEVAAWrapperPassPass(Registry);
      79       10671 :   initializeScalarEvolutionWrapperPassPass(Registry);
      80       10671 :   initializeTargetTransformInfoWrapperPassPass(Registry);
      81       10671 :   initializeTypeBasedAAWrapperPassPass(Registry);
      82       10671 :   initializeScopedNoAliasAAWrapperPassPass(Registry);
      83       10671 :   initializeLCSSAVerificationPassPass(Registry);
      84       10671 :   initializeMemorySSAWrapperPassPass(Registry);
      85       10671 :   initializeMemorySSAPrinterLegacyPassPass(Registry);
      86       10671 : }
      87             : 
      88           0 : void LLVMInitializeAnalysis(LLVMPassRegistryRef R) {
      89           0 :   initializeAnalysis(*unwrap(R));
      90           0 : }
      91             : 
      92           0 : void LLVMInitializeIPA(LLVMPassRegistryRef R) {
      93           0 :   initializeAnalysis(*unwrap(R));
      94           0 : }
      95             : 
      96           8 : LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
      97             :                           char **OutMessages) {
      98           8 :   raw_ostream *DebugOS = Action != LLVMReturnStatusAction ? &errs() : nullptr;
      99             :   std::string Messages;
     100           8 :   raw_string_ostream MsgsOS(Messages);
     101             : 
     102           8 :   LLVMBool Result = verifyModule(*unwrap(M), OutMessages ? &MsgsOS : DebugOS);
     103             : 
     104             :   // Duplicate the output to stderr.
     105           8 :   if (DebugOS && OutMessages)
     106             :     *DebugOS << MsgsOS.str();
     107             : 
     108           8 :   if (Action == LLVMAbortProcessAction && Result)
     109           0 :     report_fatal_error("Broken module found, compilation aborted!");
     110             : 
     111           8 :   if (OutMessages)
     112           8 :     *OutMessages = strdup(MsgsOS.str().c_str());
     113             : 
     114           8 :   return Result;
     115             : }
     116             : 
     117           0 : LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action) {
     118           0 :   LLVMBool Result = verifyFunction(
     119           0 :       *unwrap<Function>(Fn), Action != LLVMReturnStatusAction ? &errs()
     120           0 :                                                               : nullptr);
     121             : 
     122           0 :   if (Action == LLVMAbortProcessAction && Result)
     123           0 :     report_fatal_error("Broken function found, compilation aborted!");
     124             : 
     125           0 :   return Result;
     126             : }
     127             : 
     128           0 : void LLVMViewFunctionCFG(LLVMValueRef Fn) {
     129             :   Function *F = unwrap<Function>(Fn);
     130           0 :   F->viewCFG();
     131           0 : }
     132             : 
     133           0 : void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
     134             :   Function *F = unwrap<Function>(Fn);
     135           0 :   F->viewCFGOnly();
     136           0 : }

Generated by: LCOV version 1.13