diff options
author | Puyan Lotfi <puyan@puyan.org> | 2020-04-23 00:05:08 -0400 |
---|---|---|
committer | Puyan Lotfi <puyan@puyan.org> | 2020-04-23 00:05:08 -0400 |
commit | bbf386f02b05db017fda66875cc5edef70779244 (patch) | |
tree | 8857fb70fd20c9b394d0388b9b634cb631a1d99d /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 2aa044ed088ae41461ad7029c055014df6c60976 (diff) | |
download | llvm-bbf386f02b05db017fda66875cc5edef70779244.zip llvm-bbf386f02b05db017fda66875cc5edef70779244.tar.gz llvm-bbf386f02b05db017fda66875cc5edef70779244.tar.bz2 |
Revert "[NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec."
This reverts commit 2aa044ed088ae41461ad7029c055014df6c60976.
Reverting due to bot failure in lldb.
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 61 |
1 files changed, 24 insertions, 37 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 0aad056..00d47faec 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -6513,24 +6513,22 @@ static bool ObjCPropertyFlagConflicts(unsigned Attributes, unsigned NewFlag) { Attributes |= NewFlag; // Check for collisions with "readonly". - if ((Attributes & ObjCPropertyAttribute::kind_readonly) && - (Attributes & ObjCPropertyAttribute::kind_readwrite)) + if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) && + (Attributes & ObjCDeclSpec::DQ_PR_readwrite)) return true; // Check for more than one of { assign, copy, retain, strong, weak }. unsigned AssignCopyRetMask = Attributes & - (ObjCPropertyAttribute::kind_assign | - ObjCPropertyAttribute::kind_unsafe_unretained | - ObjCPropertyAttribute::kind_copy | ObjCPropertyAttribute::kind_retain | - ObjCPropertyAttribute::kind_strong | ObjCPropertyAttribute::kind_weak); - if (AssignCopyRetMask && - AssignCopyRetMask != ObjCPropertyAttribute::kind_assign && - AssignCopyRetMask != ObjCPropertyAttribute::kind_unsafe_unretained && - AssignCopyRetMask != ObjCPropertyAttribute::kind_copy && - AssignCopyRetMask != ObjCPropertyAttribute::kind_retain && - AssignCopyRetMask != ObjCPropertyAttribute::kind_strong && - AssignCopyRetMask != ObjCPropertyAttribute::kind_weak) + (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_unsafe_unretained | + ObjCDeclSpec::DQ_PR_copy | ObjCDeclSpec::DQ_PR_retain | + ObjCDeclSpec::DQ_PR_strong | ObjCDeclSpec::DQ_PR_weak); + if (AssignCopyRetMask && AssignCopyRetMask != ObjCDeclSpec::DQ_PR_assign && + AssignCopyRetMask != ObjCDeclSpec::DQ_PR_unsafe_unretained && + AssignCopyRetMask != ObjCDeclSpec::DQ_PR_copy && + AssignCopyRetMask != ObjCDeclSpec::DQ_PR_retain && + AssignCopyRetMask != ObjCDeclSpec::DQ_PR_strong && + AssignCopyRetMask != ObjCDeclSpec::DQ_PR_weak) return true; return false; @@ -6546,41 +6544,32 @@ void Sema::CodeCompleteObjCPropertyFlags(Scope *S, ObjCDeclSpec &ODS) { CodeCompleter->getCodeCompletionTUInfo(), CodeCompletionContext::CCC_Other); Results.EnterNewScope(); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_readonly)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readonly)) Results.AddResult(CodeCompletionResult("readonly")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_assign)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_assign)) Results.AddResult(CodeCompletionResult("assign")); if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_unsafe_unretained)) + ObjCDeclSpec::DQ_PR_unsafe_unretained)) Results.AddResult(CodeCompletionResult("unsafe_unretained")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_readwrite)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readwrite)) Results.AddResult(CodeCompletionResult("readwrite")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_retain)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_retain)) Results.AddResult(CodeCompletionResult("retain")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_strong)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_strong)) Results.AddResult(CodeCompletionResult("strong")); - if (!ObjCPropertyFlagConflicts(Attributes, ObjCPropertyAttribute::kind_copy)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_copy)) Results.AddResult(CodeCompletionResult("copy")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_nonatomic)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nonatomic)) Results.AddResult(CodeCompletionResult("nonatomic")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_atomic)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_atomic)) Results.AddResult(CodeCompletionResult("atomic")); // Only suggest "weak" if we're compiling for ARC-with-weak-references or GC. if (getLangOpts().ObjCWeak || getLangOpts().getGC() != LangOptions::NonGC) - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_weak)) + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_weak)) Results.AddResult(CodeCompletionResult("weak")); - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_setter)) { + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_setter)) { CodeCompletionBuilder Setter(Results.getAllocator(), Results.getCodeCompletionTUInfo()); Setter.AddTypedTextChunk("setter"); @@ -6588,8 +6577,7 @@ void Sema::CodeCompleteObjCPropertyFlags(Scope *S, ObjCDeclSpec &ODS) { Setter.AddPlaceholderChunk("method"); Results.AddResult(CodeCompletionResult(Setter.TakeString())); } - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_getter)) { + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_getter)) { CodeCompletionBuilder Getter(Results.getAllocator(), Results.getCodeCompletionTUInfo()); Getter.AddTypedTextChunk("getter"); @@ -6597,8 +6585,7 @@ void Sema::CodeCompleteObjCPropertyFlags(Scope *S, ObjCDeclSpec &ODS) { Getter.AddPlaceholderChunk("method"); Results.AddResult(CodeCompletionResult(Getter.TakeString())); } - if (!ObjCPropertyFlagConflicts(Attributes, - ObjCPropertyAttribute::kind_nullability)) { + if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nullability)) { Results.AddResult(CodeCompletionResult("nonnull")); Results.AddResult(CodeCompletionResult("nullable")); Results.AddResult(CodeCompletionResult("null_unspecified")); |