Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- PPCMCAsmInfo.cpp - PPC 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 MCAsmInfoDarwin properties.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "PPCMCAsmInfo.h"
14
#include "llvm/ADT/Triple.h"
15
16
using namespace llvm;
17
18
0
void PPCMCAsmInfoDarwin::anchor() { }
19
20
4
PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
21
4
  if (is64Bit) {
22
1
    CodePointerSize = CalleeSaveStackSlotSize = 8;
23
1
  }
24
4
  IsLittleEndian = false;
25
4
26
4
  SeparatorString = "@";
27
4
  CommentString = ";";
28
4
  ExceptionsType = ExceptionHandling::DwarfCFI;
29
4
30
4
  if (!is64Bit)
31
3
    Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode.
32
4
33
4
  AssemblerDialect = 1;           // New-Style mnemonics.
34
4
  SupportsDebugInformation= true; // Debug information.
35
4
36
4
  // The installed assembler for OSX < 10.6 lacks some directives.
37
4
  // FIXME: this should really be a check on the assembler characteristics
38
4
  // rather than OS version
39
4
  if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6))
40
4
    HasWeakDefCanBeHiddenDirective = false;
41
4
42
4
  UseIntegratedAssembler = true;
43
4
}
44
45
0
void PPCELFMCAsmInfo::anchor() { }
46
47
4.00k
PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
48
4.00k
  // FIXME: This is not always needed. For example, it is not needed in the
49
4.00k
  // v2 abi.
50
4.00k
  NeedsLocalForSize = true;
51
4.00k
52
4.00k
  if (is64Bit) {
53
3.51k
    CodePointerSize = CalleeSaveStackSlotSize = 8;
54
3.51k
  }
55
4.00k
  IsLittleEndian = T.getArch() == Triple::ppc64le;
56
4.00k
57
4.00k
  // ".comm align is in bytes but .align is pow-2."
58
4.00k
  AlignmentIsInBytes = false;
59
4.00k
60
4.00k
  CommentString = "#";
61
4.00k
62
4.00k
  // Uses '.section' before '.bss' directive
63
4.00k
  UsesELFSectionDirectiveForBSS = true;
64
4.00k
65
4.00k
  // Debug Information
66
4.00k
  SupportsDebugInformation = true;
67
4.00k
68
4.00k
  DollarIsPC = true;
69
4.00k
70
4.00k
  // Set up DWARF directives
71
4.00k
  MinInstAlignment = 4;
72
4.00k
73
4.00k
  // Exceptions handling
74
4.00k
  ExceptionsType = ExceptionHandling::DwarfCFI;
75
4.00k
76
4.00k
  ZeroDirective = "\t.space\t";
77
4.00k
  Data64bitsDirective = is64Bit ? 
"\t.quad\t"3.51k
:
nullptr490
;
78
4.00k
  AssemblerDialect = 1;           // New-Style mnemonics.
79
4.00k
  LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
80
4.00k
81
4.00k
  UseIntegratedAssembler = true;
82
4.00k
}
83
84
0
void PPCXCOFFMCAsmInfo::anchor() {}
85
86
9
PPCXCOFFMCAsmInfo::PPCXCOFFMCAsmInfo(bool Is64Bit, const Triple &T) {
87
9
  assert(!IsLittleEndian && "Little-endian XCOFF not supported.");
88
9
  CodePointerSize = CalleeSaveStackSlotSize = Is64Bit ? 
84
:
45
;
89
9
}