From 8cd38554fbd1ff4a3dbece202d10e415aa892eac Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 10 Oct 2017 13:00:18 +0000 Subject: Revert "[Modules TS] Avoid computing the linkage of the enclosing DeclContext for a declaration in the global module." This reverts commit r315256. See the original commit thread for reason. llvm-svn: 315308 --- clang/lib/AST/Decl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/AST/Decl.cpp') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 4a9b9bea830..cdd89d20e6b 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1395,7 +1395,7 @@ LinkageInfo LinkageComputer::getDeclLinkageAndVisibility(const NamedDecl *D) { : NamedDecl::VisibilityForValue)); } -Module *Decl::getOwningModuleForLinkage(bool IgnoreLinkage) const { +Module *Decl::getOwningModuleForLinkage() const { Module *M = getOwningModule(); if (!M) return nullptr; @@ -1413,8 +1413,6 @@ Module *Decl::getOwningModuleForLinkage(bool IgnoreLinkage) const { // for linkage purposes. But internal linkage declarations in the global // module fragment of a particular module are owned by that module for // linkage purposes. - if (IgnoreLinkage) - return nullptr; bool InternalLinkage; if (auto *ND = dyn_cast(this)) InternalLinkage = !ND->hasExternalFormalLinkage(); -- cgit v1.2.3