LCOV - code coverage report
Current view: top level - lib/IR - DiagnosticPrinter.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 27 54 50.0 %
Date: 2017-09-14 15:23:50 Functions: 9 18 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- llvm/Support/DiagnosticInfo.cpp - Diagnostic Definitions -*- 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 file defines a diagnostic printer relying on raw_ostream.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #include "llvm/IR/DiagnosticPrinter.h"
      15             : #include "llvm/ADT/Twine.h"
      16             : #include "llvm/IR/Module.h"
      17             : #include "llvm/IR/Value.h"
      18             : #include "llvm/Support/SourceMgr.h"
      19             : #include "llvm/Support/raw_ostream.h"
      20             : 
      21             : using namespace llvm;
      22             : 
      23           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(char C) {
      24           0 :   Stream << C;
      25           0 :   return *this;
      26             : }
      27             : 
      28           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(unsigned char C) {
      29           0 :   Stream << C;
      30           0 :   return *this;
      31             : }
      32             : 
      33           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(signed char C) {
      34           0 :   Stream << C;
      35           0 :   return *this;
      36             : }
      37             : 
      38          20 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(StringRef Str) {
      39          20 :   Stream << Str;
      40          20 :   return *this;
      41             : }
      42             : 
      43        1446 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const char *Str) {
      44        1446 :   Stream << Str;
      45        1446 :   return *this;
      46             : }
      47             : 
      48        2218 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(
      49             :     const std::string &Str) {
      50        4436 :   Stream << Str;
      51        2218 :   return *this;
      52             : }
      53             : 
      54          52 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(unsigned long N) {
      55          52 :   Stream << N;
      56          52 :   return *this;
      57             : }
      58           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(long N) {
      59           0 :   Stream << N;
      60           0 :   return *this;
      61             : }
      62             : 
      63           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(
      64             :     unsigned long long N) {
      65           0 :   Stream << N;
      66           0 :   return *this;
      67             : }
      68             : 
      69           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(long long N) {
      70           0 :   Stream << N;
      71           0 :   return *this;
      72             : }
      73             : 
      74           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const void *P) {
      75           0 :   Stream << P;
      76           0 :   return *this;
      77             : }
      78             : 
      79          85 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(unsigned int N) {
      80         170 :   Stream << N;
      81          85 :   return *this;
      82             : }
      83             : 
      84           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(int N) {
      85           0 :   Stream << N;
      86           0 :   return *this;
      87             : }
      88             : 
      89           0 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(double N) {
      90           0 :   Stream << N;
      91           0 :   return *this;
      92             : }
      93             : 
      94         312 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const Twine &Str) {
      95         312 :   Str.print(Stream);
      96         312 :   return *this;
      97             : }
      98             : 
      99             : // IR related types.
     100          99 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const Value &V) {
     101          99 :   Stream << V.getName();
     102          99 :   return *this;
     103             : }
     104             : 
     105          54 : DiagnosticPrinter &DiagnosticPrinterRawOStream::operator<<(const Module &M) {
     106         108 :   Stream << M.getModuleIdentifier();
     107          54 :   return *this;
     108             : }
     109             : 
     110             : // Other types.
     111         112 : DiagnosticPrinter &DiagnosticPrinterRawOStream::
     112             : operator<<(const SMDiagnostic &Diag) {
     113             :   // We don't have to print the SMDiagnostic kind, as the diagnostic severity
     114             :   // is printed by the diagnostic handler.
     115         112 :   Diag.print("", Stream, /*ShowColors=*/true, /*ShowKindLabel=*/false);
     116         112 :   return *this;
     117             : }

Generated by: LCOV version 1.13