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

Generated by: LCOV version 1.13