16#include "llvm/ADT/StringRef.h"
17#include "llvm/ADT/StringSwitch.h"
18#include "llvm/TargetParser/TargetParser.h"
39 CPU = llvm::StringSwitch<CPUKind>(Name)
40 .Case(
"generic", CK_68000)
41 .Case(
"M68000", CK_68000)
42 .Case(
"M68010", CK_68010)
43 .Case(
"M68020", CK_68020)
44 .Case(
"M68030", CK_68030)
45 .Case(
"M68040", CK_68040)
46 .Case(
"M68060", CK_68060)
48 return CPU != CK_Unknown;
55 Builder.defineMacro(
"__m68k__");
80 if (CPU >= CK_68020) {
81 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
82 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
83 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
87 if (TargetOpts.FeatureMap.lookup(
"isa-68881") ||
88 TargetOpts.FeatureMap.lookup(
"isa-68882"))
89 Builder.defineMacro(
"__HAVE_68881__");
103const char *
const M68kTargetInfo::GCCRegNames[] = {
104 "d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
105 "a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"sp",
115 {{
"usp",
"ssp",
"isp",
"a7"},
"sp"},
134 std::numeric_limits<int16_t>::max());
180std::optional<std::string>
201 return std::string(1,
C);
205 if (*Constraint ==
'C')
207 return std::string(
"^") + std::string(Constraint++, 2);
209 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)
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.
void resetDataLayout()
Set the data layout based on current triple and ABI.
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.
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 -----------------------—===//
bool setCPU(StringRef Name) override
Target the specified CPU.
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