Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h
Line
Count
Source
1
//===-- BPFMCAsmInfo.h - BPF asm properties -------------------*- C++ -*--====//
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 declaration of the BPFMCAsmInfo class.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H
14
#define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H
15
16
#include "llvm/ADT/Triple.h"
17
#include "llvm/MC/MCAsmInfo.h"
18
19
namespace llvm {
20
class Target;
21
22
class BPFMCAsmInfo : public MCAsmInfo {
23
public:
24
231
  explicit BPFMCAsmInfo(const Triple &TT) {
25
231
    if (TT.getArch() == Triple::bpfeb)
26
85
      IsLittleEndian = false;
27
231
28
231
    PrivateGlobalPrefix = ".L";
29
231
    WeakRefDirective = "\t.weak\t";
30
231
31
231
    UsesELFSectionDirectiveForBSS = true;
32
231
    HasSingleParameterDotFile = true;
33
231
    HasDotTypeDotSizeDirective = true;
34
231
35
231
    SupportsDebugInformation = true;
36
231
    ExceptionsType = ExceptionHandling::DwarfCFI;
37
231
    MinInstAlignment = 8;
38
231
39
231
    // the default is 4 and it only affects dwarf elf output
40
231
    // so if not set correctly, the dwarf data will be
41
231
    // messed up in random places by 4 bytes. .debug_line
42
231
    // section will be parsable, but with odd offsets and
43
231
    // line numbers, etc.
44
231
    CodePointerSize = 8;
45
231
  }
46
47
212
  void setDwarfUsesRelocationsAcrossSections(bool enable) {
48
212
    DwarfUsesRelocationsAcrossSections = enable;
49
212
  }
50
};
51
}
52
53
#endif