Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/MC/MCSectionXCOFF.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- lib/MC/MCSectionXCOFF.cpp - XCOFF Code Section Representation ------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "llvm/MC/MCSectionXCOFF.h"
10
#include "llvm/MC/MCAsmInfo.h"
11
#include "llvm/MC/MCExpr.h"
12
#include "llvm/Support/raw_ostream.h"
13
14
using namespace llvm;
15
16
16
MCSectionXCOFF::~MCSectionXCOFF() = default;
17
18
void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
19
                                          raw_ostream &OS,
20
11
                                          const MCExpr *Subsection) const {
21
11
  if (getKind().isText()) {
22
3
    if (getMappingClass() != XCOFF::XMC_PR)
23
3
      
llvm_unreachable0
("Unsupported storage-mapping class for .text csect");
24
3
25
3
    OS << "\t.csect " << getSectionName() << "["
26
3
       << "PR"
27
3
       << "]" << '\n';
28
3
    return;
29
8
  }
30
8
31
8
  if (getKind().isCommon()) {
32
8
    if (getMappingClass() != XCOFF::XMC_RW)
33
8
      
llvm_unreachable0
("Unsupported storage-mapping class for common csect");
34
8
    if (getCSectType() != XCOFF::XTY_CM)
35
8
      
llvm_unreachable0
("wrong csect type for common csect");
36
8
    // Don't have to print a directive for switching to section for commons.
37
8
    // '.comm' and '.lcomm' directives for the variable will create the needed
38
8
    // csect.
39
8
    return;
40
0
  }
41
0
42
0
  report_fatal_error("Printing for this SectionKind is unimplemented.");
43
0
}
44
45
0
bool MCSectionXCOFF::UseCodeAlign() const { return getKind().isText(); }
46
47
4
bool MCSectionXCOFF::isVirtualSection() const { return XCOFF::XTY_CM == Type; }