clang 20.0.0git
M68k.h
Go to the documentation of this file.
1//===--- M68k.h - Declare M68k 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 M68k TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_M68K_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_M68K_H
15
16#include "OSTargets.h"
19#include "llvm/Support/Compiler.h"
20#include "llvm/TargetParser/Triple.h"
21#include <optional>
22
23namespace clang {
24namespace targets {
25
26class LLVM_LIBRARY_VISIBILITY M68kTargetInfo : public TargetInfo {
27 static const char *const GCCRegNames[];
28 static const TargetInfo::GCCRegAlias GCCRegAliases[];
29
30 enum CPUKind {
31 CK_Unknown,
32 CK_68000,
33 CK_68010,
34 CK_68020,
35 CK_68030,
36 CK_68040,
37 CK_68060
38 } CPU = CK_Unknown;
39
40 const TargetOptions &TargetOpts;
41
42public:
43 M68kTargetInfo(const llvm::Triple &Triple, const TargetOptions &);
44
45 void getTargetDefines(const LangOptions &Opts,
46 MacroBuilder &Builder) const override;
47 ArrayRef<Builtin::Info> getTargetBuiltins() const override;
48 bool hasFeature(StringRef Feature) const override;
49 ArrayRef<const char *> getGCCRegNames() const override;
50 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;
51 std::string convertConstraint(const char *&Constraint) const override;
52 bool validateAsmConstraint(const char *&Name,
53 TargetInfo::ConstraintInfo &info) const override;
54 std::optional<std::string> handleAsmEscapedChar(char EscChar) const override;
55 std::string_view getClobbers() const override;
56 BuiltinVaListKind getBuiltinVaListKind() const override;
57 bool setCPU(const std::string &Name) override;
58 CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
59
60 std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
61 return std::make_pair(32, 32);
62 }
63};
64
65} // namespace targets
66} // namespace clang
67
68#endif
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
Definition: Module.cpp:100
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...
Definition: LangOptions.h:476
Exposes information about the current target.
Definition: TargetInfo.h:218
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition: TargetInfo.h:319
Options for controlling the target.
Definition: TargetOptions.h:26
std::pair< unsigned, unsigned > hardwareInterferenceSizes() const override
The first value in the pair is the minimum offset between two objects to avoid false sharing (destruc...
Definition: M68k.h:60
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:278