1 //===-- BPFMCAsmInfo.h - BPF asm properties -------------------*- C++ -*--====//
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
7 //===----------------------------------------------------------------------===//
9 // This file contains the declaration of the BPFMCAsmInfo class.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H
14 #define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H
16 #include "llvm/ADT/Triple.h"
17 #include "llvm/MC/MCAsmInfo.h"
22 class BPFMCAsmInfo
: public MCAsmInfo
{
24 explicit BPFMCAsmInfo(const Triple
&TT
) {
25 if (TT
.getArch() == Triple::bpfeb
)
26 IsLittleEndian
= false;
28 PrivateGlobalPrefix
= ".L";
29 WeakRefDirective
= "\t.weak\t";
31 UsesELFSectionDirectiveForBSS
= true;
32 HasSingleParameterDotFile
= true;
33 HasDotTypeDotSizeDirective
= true;
35 SupportsDebugInformation
= true;
36 ExceptionsType
= ExceptionHandling::DwarfCFI
;
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
47 void setDwarfUsesRelocationsAcrossSections(bool enable
) {
48 DwarfUsesRelocationsAcrossSections
= enable
;