DeclObjCCommon.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- DeclObjCCommon.h - Classes for representing declarations -*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file contains common ObjC enums and classes used in AST and
  15. // Sema.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CLANG_AST_DECLOBJCCOMMON_H
  19. #define LLVM_CLANG_AST_DECLOBJCCOMMON_H
  20. namespace clang {
  21. /// ObjCPropertyAttribute::Kind - list of property attributes.
  22. /// Keep this list in sync with LLVM's Dwarf.h ApplePropertyAttributes.s
  23. namespace ObjCPropertyAttribute {
  24. enum Kind {
  25. kind_noattr = 0x00,
  26. kind_readonly = 0x01,
  27. kind_getter = 0x02,
  28. kind_assign = 0x04,
  29. kind_readwrite = 0x08,
  30. kind_retain = 0x10,
  31. kind_copy = 0x20,
  32. kind_nonatomic = 0x40,
  33. kind_setter = 0x80,
  34. kind_atomic = 0x100,
  35. kind_weak = 0x200,
  36. kind_strong = 0x400,
  37. kind_unsafe_unretained = 0x800,
  38. /// Indicates that the nullability of the type was spelled with a
  39. /// property attribute rather than a type qualifier.
  40. kind_nullability = 0x1000,
  41. kind_null_resettable = 0x2000,
  42. kind_class = 0x4000,
  43. kind_direct = 0x8000,
  44. // Adding a property should change NumObjCPropertyAttrsBits
  45. // Also, don't forget to update the Clang C API at CXObjCPropertyAttrKind and
  46. // clang_Cursor_getObjCPropertyAttributes.
  47. };
  48. } // namespace ObjCPropertyAttribute::Kind
  49. enum {
  50. /// Number of bits fitting all the property attributes.
  51. NumObjCPropertyAttrsBits = 16
  52. };
  53. } // namespace clang
  54. #endif // LLVM_CLANG_AST_DECLOBJCCOMMON_H
  55. #ifdef __GNUC__
  56. #pragma GCC diagnostic pop
  57. #endif