1 //===--- ARC.h - Declare ARC target feature support -------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file declares ARC TargetInfo objects.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
14 #define LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
16 #include "clang/Basic/TargetInfo.h"
17 #include "clang/Basic/TargetOptions.h"
18 #include "llvm/Support/Compiler.h"
19 #include "llvm/TargetParser/Triple.h"
24 class LLVM_LIBRARY_VISIBILITY ARCTargetInfo
: public TargetInfo
{
26 ARCTargetInfo(const llvm::Triple
&Triple
, const TargetOptions
&)
27 : TargetInfo(Triple
) {
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");
40 void getTargetDefines(const LangOptions
&Opts
,
41 MacroBuilder
&Builder
) const override
;
43 ArrayRef
<Builtin::Info
> getTargetBuiltins() const override
{ return {}; }
45 BuiltinVaListKind
getBuiltinVaListKind() const override
{
46 return TargetInfo::VoidPtrBuiltinVaList
;
49 std::string_view
getClobbers() const override
{ return ""; }
51 ArrayRef
<const char *> getGCCRegNames() const override
{
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::ArrayRef(GCCRegNames
);
60 ArrayRef
<TargetInfo::GCCRegAlias
> getGCCRegAliases() const override
{
64 bool validateAsmConstraint(const char *&Name
,
65 TargetInfo::ConstraintInfo
&Info
) const override
{
69 bool hasBitIntType() const override
{ return true; }
71 bool isCLZForZeroUndef() const override
{ return false; }
74 } // namespace targets
77 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H