clang 22.0.0git
XCore.h
Go to the documentation of this file.
1//===--- XCore.h - Declare XCore 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 XCore TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_XCORE_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_XCORE_H
15
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
20
21namespace clang {
22namespace targets {
23
24class LLVM_LIBRARY_VISIBILITY XCoreTargetInfo : public TargetInfo {
25
26public:
41
42 void getTargetDefines(const LangOptions &Opts,
43 MacroBuilder &Builder) const override;
44
45 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
46
50
51 std::string_view getClobbers() const override { return ""; }
52
54 static const char *const GCCRegNames[] = {
55 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
56 "r8", "r9", "r10", "r11", "cp", "dp", "sp", "lr"
57 };
59 }
60
62 return {};
63 }
64
65 bool validateAsmConstraint(const char *&Name,
66 TargetInfo::ConstraintInfo &Info) const override {
67 return false;
68 }
69
70 int getEHDataRegisterNumber(unsigned RegNo) const override {
71 // R0=ExceptionPointerRegister R1=ExceptionSelectorRegister
72 return (RegNo < 2) ? RegNo : -1;
73 }
74
75 bool allowsLargerPreferedTypeAlignment() const override { return false; }
76
77 bool hasBitIntType() const override { return true; }
78};
79} // namespace targets
80} // namespace clang
81#endif // LLVM_CLANG_LIB_BASIC_TARGETS_XCORE_H
Defines the clang::TargetOptions class.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:333
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition TargetInfo.h:338
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
Options for controlling the target.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition XCore.h:51
ArrayRef< const char * > getGCCRegNames() const override
Definition XCore.h:53
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
Definition XCore.h:65
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition XCore.h:61
XCoreTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition XCore.h:27
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition XCore.h:70
bool allowsLargerPreferedTypeAlignment() const override
Whether target allows to overalign ABI-specified preferred alignment.
Definition XCore.h:75
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition XCore.h:77
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition XCore.h:47
Defines the clang::TargetInfo interface.
static const char *const GCCRegNames[]
Definition X86.cpp:73
The JSON file list parser is used to communicate input to InstallAPI.
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
Definition TargetInfo.h:187