Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- SparcMCAsmInfo.cpp - Sparc asm properties --------------------------===//
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
// This file contains the declarations of the SparcMCAsmInfo properties.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "SparcMCAsmInfo.h"
14
#include "SparcMCExpr.h"
15
#include "llvm/ADT/Triple.h"
16
#include "llvm/BinaryFormat/Dwarf.h"
17
#include "llvm/MC/MCExpr.h"
18
#include "llvm/MC/MCStreamer.h"
19
#include "llvm/MC/MCTargetOptions.h"
20
21
using namespace llvm;
22
23
0
void SparcELFMCAsmInfo::anchor() {}
24
25
298
SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Triple &TheTriple) {
26
298
  bool isV9 = (TheTriple.getArch() == Triple::sparcv9);
27
298
  IsLittleEndian = (TheTriple.getArch() == Triple::sparcel);
28
298
29
298
  if (isV9) {
30
107
    CodePointerSize = CalleeSaveStackSlotSize = 8;
31
107
  }
32
298
33
298
  Data16bitsDirective = "\t.half\t";
34
298
  Data32bitsDirective = "\t.word\t";
35
298
  // .xword is only supported by V9.
36
298
  Data64bitsDirective = (isV9) ? 
"\t.xword\t"107
:
nullptr191
;
37
298
  ZeroDirective = "\t.skip\t";
38
298
  CommentString = "!";
39
298
  SupportsDebugInformation = true;
40
298
41
298
  ExceptionsType = ExceptionHandling::DwarfCFI;
42
298
43
298
  SunStyleELFSectionSwitchSyntax = true;
44
298
  UsesELFSectionDirectiveForBSS = true;
45
298
46
298
  UseIntegratedAssembler = true;
47
298
}
48
49
const MCExpr*
50
SparcELFMCAsmInfo::getExprForPersonalitySymbol(const MCSymbol *Sym,
51
                                               unsigned Encoding,
52
0
                                               MCStreamer &Streamer) const {
53
0
  if (Encoding & dwarf::DW_EH_PE_pcrel) {
54
0
    MCContext &Ctx = Streamer.getContext();
55
0
    return SparcMCExpr::create(SparcMCExpr::VK_Sparc_R_DISP32,
56
0
                               MCSymbolRefExpr::create(Sym, Ctx), Ctx);
57
0
  }
58
0
59
0
  return MCAsmInfo::getExprForPersonalitySymbol(Sym, Encoding, Streamer);
60
0
}
61
62
const MCExpr*
63
SparcELFMCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym,
64
                                       unsigned Encoding,
65
16
                                       MCStreamer &Streamer) const {
66
16
  if (Encoding & dwarf::DW_EH_PE_pcrel) {
67
14
    MCContext &Ctx = Streamer.getContext();
68
14
    return SparcMCExpr::create(SparcMCExpr::VK_Sparc_R_DISP32,
69
14
                               MCSymbolRefExpr::create(Sym, Ctx), Ctx);
70
14
  }
71
2
  return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer);
72
2
}