diff options
author | Eric Liu <ioeric@google.com> | 2017-10-10 13:09:40 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2017-10-10 13:09:40 +0000 |
commit | e8f1fa7770f1d9c8a25344b3c342aef7bb8c0bca (patch) | |
tree | a4ca0cc33605603dd3c587cb671b4ee75defb9a4 /include/clang/Sema/Lookup.h | |
parent | 5c21b0272a1bf5bfa17457368afcbd097ea1314e (diff) |
Revert "[Modules TS] Module ownership semantics for redeclarations."
This reverts commit r315251. See the original commit thread for reason.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/Lookup.h')
-rw-r--r-- | include/clang/Sema/Lookup.h | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/include/clang/Sema/Lookup.h b/include/clang/Sema/Lookup.h index 546df8842a..ea32997d40 100644 --- a/include/clang/Sema/Lookup.h +++ b/include/clang/Sema/Lookup.h @@ -139,7 +139,6 @@ public: LookupKind(LookupKind), IDNS(0), Redecl(Redecl != Sema::NotForRedeclaration), - ExternalRedecl(Redecl == Sema::ForExternalRedeclaration), HideTags(true), Diagnose(Redecl == Sema::NotForRedeclaration), AllowHidden(false), @@ -162,7 +161,6 @@ public: LookupKind(LookupKind), IDNS(0), Redecl(Redecl != Sema::NotForRedeclaration), - ExternalRedecl(Redecl == Sema::ForExternalRedeclaration), HideTags(true), Diagnose(Redecl == Sema::NotForRedeclaration), AllowHidden(false), @@ -183,7 +181,6 @@ public: LookupKind(Other.LookupKind), IDNS(Other.IDNS), Redecl(Other.Redecl), - ExternalRedecl(Other.ExternalRedecl), HideTags(Other.HideTags), Diagnose(false), AllowHidden(Other.AllowHidden), @@ -204,9 +201,7 @@ public: SemaPtr(std::move(Other.SemaPtr)), NameInfo(std::move(Other.NameInfo)), NameContextRange(std::move(Other.NameContextRange)), LookupKind(std::move(Other.LookupKind)), IDNS(std::move(Other.IDNS)), - Redecl(std::move(Other.Redecl)), - ExternalRedecl(std::move(Other.ExternalRedecl)), - HideTags(std::move(Other.HideTags)), + Redecl(std::move(Other.Redecl)), HideTags(std::move(Other.HideTags)), Diagnose(std::move(Other.Diagnose)), AllowHidden(std::move(Other.AllowHidden)), Shadowed(std::move(Other.Shadowed)) { @@ -226,7 +221,6 @@ public: LookupKind = std::move(Other.LookupKind); IDNS = std::move(Other.IDNS); Redecl = std::move(Other.Redecl); - ExternalRedecl = std::move(Other.ExternalRedecl); HideTags = std::move(Other.HideTags); Diagnose = std::move(Other.Diagnose); AllowHidden = std::move(Other.AllowHidden); @@ -271,17 +265,6 @@ public: return Redecl; } - /// True if this lookup is just looking for an existing declaration to link - /// against a declaration with external linkage. - bool isForExternalRedeclaration() const { - return ExternalRedecl; - } - - Sema::RedeclarationKind redeclarationKind() const { - return ExternalRedecl ? Sema::ForExternalRedeclaration : - Redecl ? Sema::ForVisibleRedeclaration : Sema::NotForRedeclaration; - } - /// \brief Specify whether hidden declarations are visible, e.g., /// for recovery reasons. void setAllowHidden(bool AH) { @@ -292,7 +275,7 @@ public: /// declarations, such as those in modules that have not yet been imported. bool isHiddenDeclarationVisible(NamedDecl *ND) const { return AllowHidden || - (isForExternalRedeclaration() && ND->isExternallyDeclarable()); + (isForRedeclaration() && ND->hasExternalFormalLinkage()); } /// Sets whether tag declarations should be hidden by non-tag @@ -573,8 +556,7 @@ public: /// \brief Change this lookup's redeclaration kind. void setRedeclarationKind(Sema::RedeclarationKind RK) { - Redecl = (RK != Sema::NotForRedeclaration); - ExternalRedecl = (RK == Sema::ForExternalRedeclaration); + Redecl = RK; configure(); } @@ -737,7 +719,6 @@ private: unsigned IDNS; // set by configure() bool Redecl; - bool ExternalRedecl; /// \brief True if tag declarations should be hidden if non-tags /// are present |