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

Generated by: LCOV version 1.13