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"
21 class BPFMCAsmInfo
: public MCAsmInfo
{
23 explicit BPFMCAsmInfo(const Triple
&TT
, const MCTargetOptions
&Options
) {
24 if (TT
.getArch() == Triple::bpfeb
)
25 IsLittleEndian
= false;
27 PrivateGlobalPrefix
= ".L";
28 WeakRefDirective
= "\t.weak\t";
30 UsesELFSectionDirectiveForBSS
= true;
31 HasSingleParameterDotFile
= true;
32 HasDotTypeDotSizeDirective
= true;
34 SupportsDebugInformation
= true;
35 ExceptionsType
= ExceptionHandling::DwarfCFI
;
38 // the default is 4 and it only affects dwarf elf output
39 // so if not set correctly, the dwarf data will be
40 // messed up in random places by 4 bytes. .debug_line
41 // section will be parsable, but with odd offsets and
45 UseIntegratedAssembler
= false;
48 void setDwarfUsesRelocationsAcrossSections(bool enable
) {
49 DwarfUsesRelocationsAcrossSections
= enable
;