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

Generated by: LCOV version 1.13