Author: adrian Date: Fri Sep 18 16:06:14 2015 New Revision: 248037 URL: http://llvm.org/viewvc/llvm-project?rev=248037&view=rev Log: Debug Info: Use the full module name as a key when caching DIModules. The signature may not have been computed at the time the module reference is generated (e.g.: in the future while emitting debug info for a clang module). Using the full module name is safe because each clang module may only have a single definition.
NFC. Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp cfe/trunk/lib/CodeGen/CGDebugInfo.h Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=248037&r1=248036&r2=248037&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original) +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Sep 18 16:06:14 2015 @@ -1674,7 +1674,7 @@ llvm::DIType *CGDebugInfo::CreateType(co llvm::DIModule * CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod) { - auto &ModRef = ModuleRefCache[Mod.Signature]; + auto &ModRef = ModuleRefCache[Mod.ModuleName]; if (ModRef) return cast<llvm::DIModule>(ModRef); Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=248037&r1=248036&r2=248037&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original) +++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Fri Sep 18 16:06:14 2015 @@ -93,8 +93,8 @@ class CGDebugInfo { /// Cache of previously constructed interfaces which may change. llvm::SmallVector<ObjCInterfaceCacheEntry, 32> ObjCInterfaceCache; - /// Cache of references to AST files such as PCHs or modules. - llvm::DenseMap<uint64_t, llvm::TrackingMDRef> ModuleRefCache; + /// Cache of references to clang modules and precompiled headers. + llvm::StringMap<llvm::TrackingMDRef> ModuleRefCache; /// List of interfaces we want to keep even if orphaned. std::vector<void *> RetainedTypes; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits