17#include "llvm/ADT/StringExtras.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/ADT/StringSwitch.h"
20#include "llvm/TargetParser/TargetParser.h"
42 Layout +=
"-p:32:16:32";
45 Layout +=
"-i8:8:8-i16:16:16-i32:16:32";
50 Layout +=
"-n8:16:32";
54 Layout +=
"-a:0:16-S16";
65 CPU = llvm::StringSwitch<CPUKind>(N)
66 .Case(
"generic", CK_68000)
67 .Case(
"M68000", CK_68000)
68 .Case(
"M68010", CK_68010)
69 .Case(
"M68020", CK_68020)
70 .Case(
"M68030", CK_68030)
71 .Case(
"M68040", CK_68040)
72 .Case(
"M68060", CK_68060)
74 return CPU != CK_Unknown;
81 Builder.defineMacro(
"__m68k__");
106 if (CPU >= CK_68020) {
107 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
108 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
109 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
113 if (TargetOpts.
FeatureMap.lookup(
"isa-68881") ||
115 Builder.defineMacro(
"__HAVE_68881__");
125 return Feature ==
"M68000";
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.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
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.
llvm::StringMap< bool > FeatureMap
The map of which features have been enabled disabled based on the command line.
std::string convertConstraint(const char *&Constraint) const override
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
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_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)