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

source code of llvm/include/llvm/TargetParser/ARMTargetParserCommon.h