M68k.h 1.9 KB

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