RISCVAttributes.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- RISCVAttributes.h - RISCV Attributes --------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file contains enumerations for RISCV attributes as defined in RISC-V
  15. // ELF psABI specification.
  16. //
  17. // RISC-V ELF psABI specification
  18. //
  19. // https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
  20. //
  21. //===----------------------------------------------------------------------===//
  22. #ifndef LLVM_SUPPORT_RISCVATTRIBUTES_H
  23. #define LLVM_SUPPORT_RISCVATTRIBUTES_H
  24. #include "llvm/Support/ELFAttributes.h"
  25. namespace llvm {
  26. namespace RISCVAttrs {
  27. const TagNameMap &getRISCVAttributeTags();
  28. enum AttrType : unsigned {
  29. // Attribute types in ELF/.riscv.attributes.
  30. STACK_ALIGN = 4,
  31. ARCH = 5,
  32. UNALIGNED_ACCESS = 6,
  33. PRIV_SPEC = 8,
  34. PRIV_SPEC_MINOR = 10,
  35. PRIV_SPEC_REVISION = 12,
  36. };
  37. enum StackAlign { ALIGN_4 = 4, ALIGN_16 = 16 };
  38. enum { NOT_ALLOWED = 0, ALLOWED = 1 };
  39. } // namespace RISCVAttrs
  40. } // namespace llvm
  41. #endif
  42. #ifdef __GNUC__
  43. #pragma GCC diagnostic pop
  44. #endif