LCOV - code coverage report
Current view: top level - lib/Target/ARM/MCTargetDesc - ARMMCExpr.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 14 15 93.3 %
Date: 2018-10-20 13:21:21 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- ARMMCExpr.cpp - ARM specific MC expression classes ----------------===//
       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 "ARMMCExpr.h"
      11             : #include "llvm/MC/MCContext.h"
      12             : #include "llvm/MC/MCStreamer.h"
      13             : using namespace llvm;
      14             : 
      15             : #define DEBUG_TYPE "armmcexpr"
      16             : 
      17             : const ARMMCExpr*
      18        3440 : ARMMCExpr::create(VariantKind Kind, const MCExpr *Expr,
      19             :                        MCContext &Ctx) {
      20        3440 :   return new (Ctx) ARMMCExpr(Kind, Expr);
      21             : }
      22             : 
      23        3220 : void ARMMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
      24        3220 :   switch (Kind) {
      25           0 :   default: llvm_unreachable("Invalid kind!");
      26        1607 :   case VK_ARM_HI16: OS << ":upper16:"; break;
      27        1613 :   case VK_ARM_LO16: OS << ":lower16:"; break;
      28             :   }
      29             : 
      30        3220 :   const MCExpr *Expr = getSubExpr();
      31        3220 :   if (Expr->getKind() != MCExpr::SymbolRef)
      32             :     OS << '(';
      33        3220 :   Expr->print(OS, MAI);
      34        3220 :   if (Expr->getKind() != MCExpr::SymbolRef)
      35             :     OS << ')';
      36        3220 : }
      37             : 
      38         217 : void ARMMCExpr::visitUsedExpr(MCStreamer &Streamer) const {
      39         217 :   Streamer.visitUsedExpr(*getSubExpr());
      40         217 : }

Generated by: LCOV version 1.13