Path: blob/main/contrib/llvm-project/llvm/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h
35294 views
//===-- BPFMCAsmInfo.h - BPF asm properties -------------------*- C++ -*--====//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains the declaration of the BPFMCAsmInfo class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H13#define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H1415#include "llvm/MC/MCAsmInfo.h"16#include "llvm/TargetParser/Triple.h"1718namespace llvm {1920class BPFMCAsmInfo : public MCAsmInfo {21public:22explicit BPFMCAsmInfo(const Triple &TT, const MCTargetOptions &Options) {23if (TT.getArch() == Triple::bpfeb)24IsLittleEndian = false;2526PrivateGlobalPrefix = ".L";27WeakRefDirective = "\t.weak\t";2829UsesELFSectionDirectiveForBSS = true;30HasSingleParameterDotFile = true;31HasDotTypeDotSizeDirective = true;3233SupportsDebugInformation = true;34ExceptionsType = ExceptionHandling::DwarfCFI;35MinInstAlignment = 8;3637// the default is 4 and it only affects dwarf elf output38// so if not set correctly, the dwarf data will be39// messed up in random places by 4 bytes. .debug_line40// section will be parsable, but with odd offsets and41// line numbers, etc.42CodePointerSize = 8;43}4445void setDwarfUsesRelocationsAcrossSections(bool enable) {46DwarfUsesRelocationsAcrossSections = enable;47}48};49}5051#endif525354