clang  14.0.0git
ARC.h
Go to the documentation of this file.
1 //===--- ARC.h - Declare ARC target feature support -------------*- 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 declares ARC TargetInfo objects.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
14 #define LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
15 
16 #include "clang/Basic/TargetInfo.h"
18 #include "llvm/ADT/Triple.h"
19 #include "llvm/Support/Compiler.h"
20 
21 namespace clang {
22 namespace targets {
23 
24 class LLVM_LIBRARY_VISIBILITY ARCTargetInfo : public TargetInfo {
25 public:
26  ARCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
27  : TargetInfo(Triple) {
28  NoAsmVariants = true;
29  LongLongAlign = 32;
30  SuitableAlign = 32;
31  DoubleAlign = LongDoubleAlign = 32;
32  SizeType = UnsignedInt;
33  PtrDiffType = SignedInt;
34  IntPtrType = SignedInt;
35  UseZeroLengthBitfieldAlignment = true;
36  resetDataLayout("e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-"
37  "i32:32:32-f32:32:32-i64:32-f64:32-a:0:32-n32");
38  }
39 
40  void getTargetDefines(const LangOptions &Opts,
41  MacroBuilder &Builder) const override;
42 
43  ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
44 
47  }
48 
49  const char *getClobbers() const override { return ""; }
50 
52  static const char *const GCCRegNames[] = {
53  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
54  "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
55  "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
56  "r24", "r25", "gp", "sp", "fp", "ilink1", "r30", "blink"};
57  return llvm::makeArrayRef(GCCRegNames);
58  }
59 
61  return None;
62  }
63 
64  bool validateAsmConstraint(const char *&Name,
65  TargetInfo::ConstraintInfo &Info) const override {
66  return false;
67  }
68 
69  bool hasExtIntType() const override { return true; }
70 
71  bool isCLZForZeroUndef() const override { return false; }
72 };
73 
74 } // namespace targets
75 } // namespace clang
76 
77 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
clang::targets::ARCTargetInfo
Definition: ARC.h:24
TargetInfo.h
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:189
clang::TargetInfo::VoidPtrBuiltinVaList
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition: TargetInfo.h:270
clang::TargetInfo::BuiltinVaListKind
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition: TargetInfo.h:265
clang::targets::ARCTargetInfo::validateAsmConstraint
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
Definition: ARC.h:64
clang::targets::ARCTargetInfo::isCLZForZeroUndef
bool isCLZForZeroUndef() const override
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
Definition: ARC.h:71
clang::targets::GCCRegNames
static const char *const GCCRegNames[]
Definition: X86.cpp:43
clang::targets::ARCTargetInfo::getGCCRegAliases
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition: ARC.h:60
TargetOptions.h
llvm::ArrayRef
Definition: LLVM.h:34
clang::targets::ARCTargetInfo::getGCCRegNames
ArrayRef< const char * > getGCCRegNames() const override
Definition: ARC.h:51
clang::TargetInfo::ConstraintInfo
Definition: TargetInfo.h:960
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:58
clang
Definition: CalledOnceCheck.h:17
clang::targets::ARCTargetInfo::getBuiltinVaListKind
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition: ARC.h:45
clang::targets::ARCTargetInfo::getClobbers
const char * getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition: ARC.h:49
clang::TargetOptions
Options for controlling the target.
Definition: TargetOptions.h:26
clang::MacroBuilder
Definition: MacroBuilder.h:23
clang::targets::ARCTargetInfo::ARCTargetInfo
ARCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition: ARC.h:26
clang::targets::ARCTargetInfo::getTargetBuiltins
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
Definition: ARC.h:43
clang::targets::ARCTargetInfo::hasExtIntType
bool hasExtIntType() const override
Determine whether the _ExtInt type is supported on this target.
Definition: ARC.h:69