ARMTargetParserCommon.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===---------------- ARMTargetParserCommon ---------------------*- 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. // Code that is common to ARMTargetParser and AArch64TargetParser.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H
  18. #define LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H
  19. #include "llvm/ADT/StringRef.h"
  20. namespace llvm {
  21. namespace ARM {
  22. enum class ISAKind { INVALID = 0, ARM, THUMB, AARCH64 };
  23. enum class EndianKind { INVALID = 0, LITTLE, BIG };
  24. /// Converts e.g. "armv8" -> "armv8-a"
  25. StringRef getArchSynonym(StringRef Arch);
  26. /// MArch is expected to be of the form (arm|thumb)?(eb)?(v.+)?(eb)?, but
  27. /// (iwmmxt|xscale)(eb)? is also permitted. If the former, return
  28. /// "v.+", if the latter, return unmodified string, minus 'eb'.
  29. /// If invalid, return empty string.
  30. StringRef getCanonicalArchName(StringRef Arch);
  31. // ARM, Thumb, AArch64
  32. ISAKind parseArchISA(StringRef Arch);
  33. // Little/Big endian
  34. EndianKind parseArchEndian(StringRef Arch);
  35. struct ParsedBranchProtection {
  36. StringRef Scope;
  37. StringRef Key;
  38. bool BranchTargetEnforcement;
  39. };
  40. bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP,
  41. StringRef &Err);
  42. } // namespace ARM
  43. } // namespace llvm
  44. #endif
  45. #ifdef __GNUC__
  46. #pragma GCC diagnostic pop
  47. #endif