LLVM  9.0.0svn
BPFMCAsmInfo.h
Go to the documentation of this file.
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  explicit BPFMCAsmInfo(const Triple &TT) {
25  if (TT.getArch() == Triple::bpfeb)
26  IsLittleEndian = false;
27 
28  PrivateGlobalPrefix = ".L";
29  WeakRefDirective = "\t.weak\t";
30 
34 
37  MinInstAlignment = 8;
38 
39  // the default is 4 and it only affects dwarf elf output
40  // so if not set correctly, the dwarf data will be
41  // messed up in random places by 4 bytes. .debug_line
42  // section will be parsable, but with odd offsets and
43  // line numbers, etc.
44  CodePointerSize = 8;
45  }
46 
49  }
50 };
51 }
52 
53 #endif
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:283
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool DwarfUsesRelocationsAcrossSections
True if Dwarf2 output generally uses relocations for references to other .debug_* sections...
Definition: MCAsmInfo.h:342
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:70
bool HasDotTypeDotSizeDirective
True if the target has .type and .size directives, this is true for most ELF targets.
Definition: MCAsmInfo.h:279
BPFMCAsmInfo(const Triple &TT)
Definition: BPFMCAsmInfo.h:24
void setDwarfUsesRelocationsAcrossSections(bool enable)
Definition: BPFMCAsmInfo.h:47
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:221
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:295
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:332
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol...
Definition: MCAsmInfo.h:302
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition: MCAsmInfo.h:102
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:63
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:335
DWARF-like instruction based exceptions.
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ...
Definition: MCAsmInfo.h:128