Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- ARMMCAsmInfo.cpp - ARM 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 ARMMCAsmInfo properties.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "ARMMCAsmInfo.h"
14
#include "llvm/ADT/Triple.h"
15
16
using namespace llvm;
17
18
0
void ARMMCAsmInfoDarwin::anchor() { }
19
20
3.98k
ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) {
21
3.98k
  if ((TheTriple.getArch() == Triple::armeb) ||
22
3.98k
      (TheTriple.getArch() == Triple::thumbeb))
23
0
    IsLittleEndian = false;
24
3.98k
25
3.98k
  Data64bitsDirective = nullptr;
26
3.98k
  CommentString = "@";
27
3.98k
  Code16Directive = ".code\t16";
28
3.98k
  Code32Directive = ".code\t32";
29
3.98k
  UseDataRegionDirectives = true;
30
3.98k
31
3.98k
  SupportsDebugInformation = true;
32
3.98k
33
3.98k
  // Conditional Thumb 4-byte instructions can have an implicit IT.
34
3.98k
  MaxInstLength = 6;
35
3.98k
36
3.98k
  // Exceptions handling
37
3.98k
  ExceptionsType = (TheTriple.isOSDarwin() && 
!TheTriple.isWatchABI()3.14k
)
38
3.98k
                       ? 
ExceptionHandling::SjLj2.43k
39
3.98k
                       : 
ExceptionHandling::DwarfCFI1.54k
;
40
3.98k
41
3.98k
  UseIntegratedAssembler = true;
42
3.98k
}
43
44
0
void ARMELFMCAsmInfo::anchor() { }
45
46
4.44k
ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
47
4.44k
  if ((TheTriple.getArch() == Triple::armeb) ||
48
4.44k
      
(TheTriple.getArch() == Triple::thumbeb)4.38k
)
49
82
    IsLittleEndian = false;
50
4.44k
51
4.44k
  // ".comm align is in bytes but .align is pow-2."
52
4.44k
  AlignmentIsInBytes = false;
53
4.44k
54
4.44k
  Data64bitsDirective = nullptr;
55
4.44k
  CommentString = "@";
56
4.44k
  Code16Directive = ".code\t16";
57
4.44k
  Code32Directive = ".code\t32";
58
4.44k
59
4.44k
  SupportsDebugInformation = true;
60
4.44k
61
4.44k
  // Conditional Thumb 4-byte instructions can have an implicit IT.
62
4.44k
  MaxInstLength = 6;
63
4.44k
64
4.44k
  // Exceptions handling
65
4.44k
  switch (TheTriple.getOS()) {
66
4.44k
  case Triple::NetBSD:
67
16
    ExceptionsType = ExceptionHandling::DwarfCFI;
68
16
    break;
69
4.44k
  default:
70
4.42k
    ExceptionsType = ExceptionHandling::ARM;
71
4.42k
    break;
72
4.44k
  }
73
4.44k
74
4.44k
  // foo(plt) instead of foo@plt
75
4.44k
  UseParensForSymbolVariant = true;
76
4.44k
77
4.44k
  UseIntegratedAssembler = true;
78
4.44k
}
79
80
15
void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) {
81
15
  UseIntegratedAssembler = Value;
82
15
  if (!UseIntegratedAssembler) {
83
15
    // gas doesn't handle VFP register names in cfi directives,
84
15
    // so don't use register names with external assembler.
85
15
    // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
86
15
    DwarfRegNumForCFI = true;
87
15
  }
88
15
}
89
90
0
void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
91
92
91
ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
93
91
  AlignmentIsInBytes = false;
94
91
  ExceptionsType = ExceptionHandling::WinEH;
95
91
  PrivateGlobalPrefix = "$M";
96
91
  PrivateLabelPrefix = "$M";
97
91
  CommentString = ";";
98
91
99
91
  // Conditional Thumb 4-byte instructions can have an implicit IT.
100
91
  MaxInstLength = 6;
101
91
}
102
103
0
void ARMCOFFMCAsmInfoGNU::anchor() { }
104
105
67
ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
106
67
  AlignmentIsInBytes = false;
107
67
  HasSingleParameterDotFile = true;
108
67
109
67
  CommentString = "@";
110
67
  Code16Directive = ".code\t16";
111
67
  Code32Directive = ".code\t32";
112
67
  PrivateGlobalPrefix = ".L";
113
67
  PrivateLabelPrefix = ".L";
114
67
115
67
  SupportsDebugInformation = true;
116
67
  ExceptionsType = ExceptionHandling::DwarfCFI;
117
67
  UseParensForSymbolVariant = true;
118
67
119
67
  UseIntegratedAssembler = true;
120
67
  DwarfRegNumForCFI = false;
121
67
122
67
  // Conditional Thumb 4-byte instructions can have an implicit IT.
123
67
  MaxInstLength = 6;
124
67
}