16#include "llvm/ADT/StringRef.h"
17#include "llvm/ADT/StringSwitch.h"
18#include "llvm/TargetParser/TargetParser.h"
40 Layout +=
"-p:32:16:32";
43 Layout +=
"-i8:8:8-i16:16:16-i32:16:32";
48 Layout +=
"-n8:16:32";
52 Layout +=
"-a:0:16-S16";
64 CPU = llvm::StringSwitch<CPUKind>(N)
65 .Case(
"generic", CK_68000)
66 .Case(
"M68000", CK_68000)
67 .Case(
"M68010", CK_68010)
68 .Case(
"M68020", CK_68020)
69 .Case(
"M68030", CK_68030)
70 .Case(
"M68040", CK_68040)
71 .Case(
"M68060", CK_68060)
73 return CPU != CK_Unknown;
80 Builder.defineMacro(
"__m68k__");
105 if (CPU >= CK_68020) {
106 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
107 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
108 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
112 if (TargetOpts.FeatureMap.lookup(
"isa-68881") ||
113 TargetOpts.FeatureMap.lookup(
"isa-68882"))
114 Builder.defineMacro(
"__HAVE_68881__");
128const char *
const M68kTargetInfo::GCCRegNames[] = {
129 "d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
130 "a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"sp",
140 {{
"usp",
"ssp",
"isp",
"a7"},
"sp"},
159 std::numeric_limits<int16_t>::max());
205std::optional<std::string>
226 return std::string(1,
C);
230 if (*Constraint ==
'C')
232 return std::string(
"^") + std::string(Constraint++, 2);
234 return std::string(1, *Constraint);
Defines the Diagnostic-related interfaces.
Defines enum values for all the target-independent builtin functions.
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)
void resetDataLayout(StringRef DL, const char *UserLabelPrefix="")
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const
Determines whether a given calling convention is valid for the target.
Options for controlling the target.
std::string convertConstraint(const char *&Constraint) const override
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
std::optional< std::string > handleAsmEscapedChar(char EscChar) const override
Replace some escaped characters with another string based on target-specific rules.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
bool setCPU(const std::string &Name) override
Target the specified CPU.
M68kTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
ArrayRef< const char * > getGCCRegNames() const override
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
llvm::SmallVector< Builtin::InfosShard > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
LLVM_LIBRARY_VISIBILITY void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, const clang::LangOptions &Opts)
Define a macro name and standard variants.
The JSON file list parser is used to communicate input to InstallAPI.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
void setRequiresImmediate(int Min, int Max)
unsigned char PointerAlign