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
llvm::DIModule *
CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod) {
- auto &ModRef = ModuleRefCache[Mod.Signature];
+ auto &ModRef = ModuleRefCache[Mod.ModuleName];
if (ModRef)
return cast<llvm::DIModule>(ModRef);
/// 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;