|
19 | 19 | #define SWIFT_STORAGEIMPL_H |
20 | 20 |
|
21 | 21 | #include "swift/Basic/Range.h" |
| 22 | +#include "llvm/ADT/StringRef.h" |
| 23 | + |
| 24 | +namespace llvm { |
| 25 | +class StringRef; |
| 26 | +class raw_ostream; |
| 27 | +} // namespace llvm |
22 | 28 |
|
23 | 29 | namespace swift { |
24 | 30 |
|
@@ -108,7 +114,7 @@ static inline IntRange<AccessorKind> allAccessorKinds() { |
108 | 114 | } |
109 | 115 |
|
110 | 116 | /// \returns a user-readable string name for the accessor kind |
111 | | -static inline StringRef accessorKindName(AccessorKind ak) { |
| 117 | +static inline llvm::StringRef accessorKindName(AccessorKind ak) { |
112 | 118 | switch(ak) { |
113 | 119 |
|
114 | 120 | #define ACCESSOR(ID) ID |
@@ -400,10 +406,7 @@ class StorageImplInfo { |
400 | 406 | } |
401 | 407 |
|
402 | 408 | /// Describe the implementation of a mutable property implemented opaquely. |
403 | | - static StorageImplInfo getMutableOpaque(OpaqueReadOwnership ownership) { |
404 | | - return { getOpaqueReadImpl(ownership), WriteImplKind::Set, |
405 | | - ReadWriteImplKind::Modify }; |
406 | | - } |
| 409 | + static StorageImplInfo getMutableOpaque(OpaqueReadOwnership ownership); |
407 | 410 |
|
408 | 411 | static StorageImplInfo getComputed(StorageIsMutable_t isMutable) { |
409 | 412 | return (isMutable ? getMutableComputed() |
@@ -451,19 +454,10 @@ class StorageImplInfo { |
451 | 454 | } |
452 | 455 |
|
453 | 456 | private: |
454 | | - static ReadImplKind getOpaqueReadImpl(OpaqueReadOwnership ownership) { |
455 | | - switch (ownership) { |
456 | | - case OpaqueReadOwnership::Owned: |
457 | | - return ReadImplKind::Get; |
458 | | - case OpaqueReadOwnership::OwnedOrBorrowed: |
459 | | - case OpaqueReadOwnership::Borrowed: |
460 | | - return ReadImplKind::Read; |
461 | | - } |
462 | | - llvm_unreachable("bad read-ownership kind"); |
463 | | - } |
| 457 | + static ReadImplKind getOpaqueReadImpl(OpaqueReadOwnership ownership); |
464 | 458 | }; |
465 | 459 |
|
466 | | -StringRef getAccessorLabel(AccessorKind kind); |
| 460 | +llvm::StringRef getAccessorLabel(AccessorKind kind); |
467 | 461 | void simple_display(llvm::raw_ostream &out, AccessorKind kind); |
468 | 462 |
|
469 | 463 | } // end namespace swift |
|
0 commit comments