LCOV - code coverage report
Current view: top level - lib/Analysis - PtrUseVisitor.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 10 10 100.0 %
Date: 2017-09-14 15:23:50 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- PtrUseVisitor.cpp - InstVisitors over a pointers uses --------------===//
       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             : /// \file
      11             : /// Implementation of the pointer use visitors.
      12             : //
      13             : //===----------------------------------------------------------------------===//
      14             : 
      15             : #include "llvm/Analysis/PtrUseVisitor.h"
      16             : #include "llvm/IR/Instruction.h"
      17             : #include "llvm/IR/Instructions.h"
      18             : #include <algorithm>
      19             : 
      20             : using namespace llvm;
      21             : 
      22      210989 : void detail::PtrUseVisitorBase::enqueueUsers(Instruction &I) {
      23     1244043 :   for (Use &U : I.uses()) {
      24      611076 :     if (VisitedUses.insert(&U).second) {
      25             :       UseToVisit NewU = {
      26      611068 :         UseToVisit::UseAndIsOffsetKnownPair(&U, IsOffsetKnown),
      27             :         Offset
      28     2444272 :       };
      29      611068 :       Worklist.push_back(std::move(NewU));
      30             :     }
      31             :   }
      32      210989 : }
      33             : 
      34       20846 : bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) {
      35       20846 :   if (!IsOffsetKnown)
      36             :     return false;
      37             : 
      38       20833 :   return GEPI.accumulateConstantOffset(DL, Offset);
      39             : }

Generated by: LCOV version 1.13