ARC.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //===--- ARC.h - Declare ARC 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 ARC TargetInfo objects.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
  13. #define LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H
  14. #include "clang/Basic/TargetInfo.h"
  15. #include "clang/Basic/TargetOptions.h"
  16. #include "llvm/ADT/Triple.h"
  17. #include "llvm/Support/Compiler.h"
  18. namespace clang {
  19. namespace targets {
  20. class LLVM_LIBRARY_VISIBILITY ARCTargetInfo : public TargetInfo {
  21. public:
  22. ARCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
  23. : TargetInfo(Triple) {
  24. NoAsmVariants = true;
  25. LongLongAlign = 32;
  26. SuitableAlign = 32;
  27. DoubleAlign = LongDoubleAlign = 32;
  28. SizeType = UnsignedInt;
  29. PtrDiffType = SignedInt;
  30. IntPtrType = SignedInt;
  31. UseZeroLengthBitfieldAlignment = true;
  32. resetDataLayout("e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-"
  33. "i32:32:32-f32:32:32-i64:32-f64:32-a:0:32-n32");
  34. }
  35. void getTargetDefines(const LangOptions &Opts,
  36. MacroBuilder &Builder) const override;
  37. ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
  38. BuiltinVaListKind getBuiltinVaListKind() const override {
  39. return TargetInfo::VoidPtrBuiltinVaList;
  40. }
  41. const char *getClobbers() const override { return ""; }
  42. ArrayRef<const char *> getGCCRegNames() const override {
  43. static const char *const GCCRegNames[] = {
  44. "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
  45. "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
  46. "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
  47. "r24", "r25", "gp", "sp", "fp", "ilink1", "r30", "blink"};
  48. return llvm::makeArrayRef(GCCRegNames);
  49. }
  50. ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
  51. return None;
  52. }
  53. bool validateAsmConstraint(const char *&Name,
  54. TargetInfo::ConstraintInfo &Info) const override {
  55. return false;
  56. }
  57. bool hasBitIntType() const override { return true; }
  58. bool isCLZForZeroUndef() const override { return false; }
  59. };
  60. } // namespace targets
  61. } // namespace clang
  62. #endif // LLVM_CLANG_LIB_BASIC_TARGETS_ARC_H