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-06-17 00:07:59 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        3326 : ARMMCExpr::create(VariantKind Kind, const MCExpr *Expr,
      19             :                        MCContext &Ctx) {
      20        3326 :   return new (Ctx) ARMMCExpr(Kind, Expr);
      21             : }
      22             : 
      23        3112 : void ARMMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
      24        3112 :   switch (Kind) {
      25           0 :   default: llvm_unreachable("Invalid kind!");
      26        1553 :   case VK_ARM_HI16: OS << ":upper16:"; break;
      27        1559 :   case VK_ARM_LO16: OS << ":lower16:"; break;
      28             :   }
      29             : 
      30        3112 :   const MCExpr *Expr = getSubExpr();
      31        3112 :   if (Expr->getKind() != MCExpr::SymbolRef)
      32             :     OS << '(';
      33        3112 :   Expr->print(OS, MAI);
      34        3112 :   if (Expr->getKind() != MCExpr::SymbolRef)
      35             :     OS << ')';
      36        3112 : }
      37             : 
      38         211 : void ARMMCExpr::visitUsedExpr(MCStreamer &Streamer) const {
      39         211 :   Streamer.visitUsedExpr(*getSubExpr());
      40         211 : }

Generated by: LCOV version 1.13