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: 2017-09-14 15:23:50 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/MCAssembler.h"
      12             : #include "llvm/MC/MCContext.h"
      13             : #include "llvm/MC/MCStreamer.h"
      14             : using namespace llvm;
      15             : 
      16             : #define DEBUG_TYPE "armmcexpr"
      17             : 
      18             : const ARMMCExpr*
      19        3144 : ARMMCExpr::create(VariantKind Kind, const MCExpr *Expr,
      20             :                        MCContext &Ctx) {
      21        6288 :   return new (Ctx) ARMMCExpr(Kind, Expr);
      22             : }
      23             : 
      24        2928 : void ARMMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
      25        2928 :   switch (Kind) {
      26           0 :   default: llvm_unreachable("Invalid kind!");
      27        1461 :   case VK_ARM_HI16: OS << ":upper16:"; break;
      28        1467 :   case VK_ARM_LO16: OS << ":lower16:"; break;
      29             :   }
      30             : 
      31        2928 :   const MCExpr *Expr = getSubExpr();
      32        2928 :   if (Expr->getKind() != MCExpr::SymbolRef)
      33             :     OS << '(';
      34        2928 :   Expr->print(OS, MAI);
      35        2928 :   if (Expr->getKind() != MCExpr::SymbolRef)
      36             :     OS << ')';
      37        2928 : }
      38             : 
      39         213 : void ARMMCExpr::visitUsedExpr(MCStreamer &Streamer) const {
      40         213 :   Streamer.visitUsedExpr(*getSubExpr());
      41         213 : }

Generated by: LCOV version 1.13