From a72a70aeb94c0b4cd4c5ef855cbc42da13fc0463 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 17 Oct 2016 13:00:44 +0000 Subject: Revert "Reinstate r281429, reverted in r281452, with a fix for its mishandling of" This reverts commit r284176. It still marks some modules as invisible that should be visible. Will follow up with the author with a test case. llvm-svn: 284382 --- clang/include/clang/AST/ASTContext.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'clang/include') diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index f5a9bd2da54..3d777524b83 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -308,18 +308,10 @@ class ASTContext : public RefCountedBase { /// merged into. llvm::DenseMap MergedDecls; - /// The modules into which a definition has been merged, or a map from a - /// merged definition to its canonical definition. This is really a union of - /// a NamedDecl* and a vector of Module*. - struct MergedModulesOrCanonicalDef { - llvm::TinyPtrVector MergedModules; - NamedDecl *CanonicalDef = nullptr; - }; - /// \brief A mapping from a defining declaration to a list of modules (other /// than the owning module of the declaration) that contain merged /// definitions of that entity. - llvm::DenseMap MergedDefModules; + llvm::DenseMap> MergedDefModules; /// \brief Initializers for a module, in order. Each Decl will be either /// something that has a semantic effect on startup (such as a variable with @@ -891,7 +883,6 @@ public: /// and should be visible whenever \p M is visible. void mergeDefinitionIntoModule(NamedDecl *ND, Module *M, bool NotifyListeners = true); - void mergeDefinitionIntoModulesOf(NamedDecl *ND, NamedDecl *Other); /// \brief Clean up the merged definition list. Call this if you might have /// added duplicates into the list. void deduplicateMergedDefinitonsFor(NamedDecl *ND); @@ -902,9 +893,7 @@ public: auto MergedIt = MergedDefModules.find(Def); if (MergedIt == MergedDefModules.end()) return None; - if (auto *CanonDef = MergedIt->second.CanonicalDef) - return getModulesWithMergedDefinition(CanonDef); - return MergedIt->second.MergedModules; + return MergedIt->second; } /// Add a declaration to the list of declarations that are initialized -- cgit v1.2.3