BPFMCAsmInfo.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #ifndef LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H
  13. #define LLVM_LIB_TARGET_BPF_MCTARGETDESC_BPFMCASMINFO_H
  14. #include "llvm/ADT/Triple.h"
  15. #include "llvm/MC/MCAsmInfo.h"
  16. namespace llvm {
  17. class BPFMCAsmInfo : public MCAsmInfo {
  18. public:
  19. explicit BPFMCAsmInfo(const Triple &TT, const MCTargetOptions &Options) {
  20. if (TT.getArch() == Triple::bpfeb)
  21. IsLittleEndian = false;
  22. PrivateGlobalPrefix = ".L";
  23. WeakRefDirective = "\t.weak\t";
  24. UsesELFSectionDirectiveForBSS = true;
  25. HasSingleParameterDotFile = true;
  26. HasDotTypeDotSizeDirective = true;
  27. SupportsDebugInformation = true;
  28. ExceptionsType = ExceptionHandling::DwarfCFI;
  29. MinInstAlignment = 8;
  30. // the default is 4 and it only affects dwarf elf output
  31. // so if not set correctly, the dwarf data will be
  32. // messed up in random places by 4 bytes. .debug_line
  33. // section will be parsable, but with odd offsets and
  34. // line numbers, etc.
  35. CodePointerSize = 8;
  36. }
  37. void setDwarfUsesRelocationsAcrossSections(bool enable) {
  38. DwarfUsesRelocationsAcrossSections = enable;
  39. }
  40. };
  41. }
  42. #endif