]> granicus.if.org Git - clang/commitdiff
Debug Info: Use the full module name as a key when caching DIModules.
authorAdrian Prantl <aprantl@apple.com>
Fri, 18 Sep 2015 21:06:14 +0000 (21:06 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 18 Sep 2015 21:06:14 +0000 (21:06 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248037 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h

index b8cf83ee48c66d269f4278cb89bf63bfb3252148..0b44e93c5cf9b3288b4abc5e4075bae7e7c8d4ed 100644 (file)
@@ -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<llvm::DIModule>(ModRef);
 
index 6a2a1424e5a088b0ce5f74a818e7594e84824ce8..72c67791784b8ed90d32e63f5fa8e0dee04f38c8 100644 (file)
@@ -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;