Coverage Report

Created: 2025-12-27 06:12

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