| 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" |
| 17 |
#include "clang/Basic/TargetInfo.h" |
| 18 |
#include "clang/Basic/TargetOptions.h" |
| 19 |
#include "llvm/ADT/Triple.h" |
| 20 |
#include "llvm/Support/Compiler.h" |
| 21 |
#include <optional> |
| 22 |
|
| 23 |
namespace clang { |
| 24 |
namespace targets { |
| 25 |
|
| 26 |
class LLVM_LIBRARY_VISIBILITY M68kTargetInfo : public TargetInfo { |
| 27 |
static const char *const GCCRegNames[]; |
| 28 |
|
| 29 |
enum CPUKind { |
| 30 |
CK_Unknown, |
| 31 |
CK_68000, |
| 32 |
CK_68010, |
| 33 |
CK_68020, |
| 34 |
CK_68030, |
| 35 |
CK_68040, |
| 36 |
CK_68060 |
| 37 |
} CPU = CK_Unknown; |
| 38 |
|
| 39 |
public: |
| 40 |
M68kTargetInfo(const llvm::Triple &Triple, const TargetOptions &); |
| 41 |
|
| 42 |
void getTargetDefines(const LangOptions &Opts, |
| 43 |
MacroBuilder &Builder) const override; |
| 44 |
ArrayRef<Builtin::Info> getTargetBuiltins() const override; |
| 45 |
bool hasFeature(StringRef Feature) const override; |
| 46 |
ArrayRef<const char *> getGCCRegNames() const override; |
| 47 |
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override; |
| 48 |
std::string convertConstraint(const char *&Constraint) const override; |
| 49 |
bool validateAsmConstraint(const char *&Name, |
| 50 |
TargetInfo::ConstraintInfo &info) const override; |
| 51 |
std::optional<std::string> handleAsmEscapedChar(char EscChar) const override; |
| 52 |
const char *getClobbers() const override; |
| 53 |
BuiltinVaListKind getBuiltinVaListKind() const override; |
| 54 |
bool setCPU(const std::string &Name) override; |
| 55 |
}; |
| 56 |
|
| 57 |
} // namespace targets |
| 58 |
} // namespace clang |
| 59 |
|
| 60 |
#endif |