From 201e10d0072b7d85f021888fddca8c4a76d08223 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 18 Sep 2015 21:06:14 +0000 Subject: 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. llvm-svn: 248037 --- clang/lib/CodeGen/CGDebugInfo.cpp | 2 +- clang/lib/CodeGen/CGDebugInfo.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index b8cf83ee48c..0b44e93c5cf 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1674,7 +1674,7 @@ llvm::DIType *CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, llvm::DIModule * CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod) { - auto &ModRef = ModuleRefCache[Mod.Signature]; + auto &ModRef = ModuleRefCache[Mod.ModuleName]; if (ModRef) return cast(ModRef); diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 6a2a1424e5a..72c67791784 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -93,8 +93,8 @@ class CGDebugInfo { /// Cache of previously constructed interfaces which may change. llvm::SmallVector ObjCInterfaceCache; - /// Cache of references to AST files such as PCHs or modules. - llvm::DenseMap ModuleRefCache; + /// Cache of references to clang modules and precompiled headers. + llvm::StringMap ModuleRefCache; /// List of interfaces we want to keep even if orphaned. std::vector RetainedTypes; -- cgit v1.2.3