diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-09-11 01:03:19 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-09-11 01:03:19 +0000 |
commit | d0929a1c8759d320bd43982722380b9a864d3c2d (patch) | |
tree | b4376182829671e595e706e3e9877441c07f7491 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | e03226b1d90f5cce9eeb08f0a6f8755348c09b8d (diff) | |
download | bcm5719-llvm-d0929a1c8759d320bd43982722380b9a864d3c2d.tar.gz bcm5719-llvm-d0929a1c8759d320bd43982722380b9a864d3c2d.zip |
Cleanup: Let CGDebugInfo::ModuleRefCache use a TrackingMDNode (NFC).
llvm-svn: 247368
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 83b5e01deef..693d0f6fdfc 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1638,9 +1638,9 @@ llvm::DIType *CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, llvm::DIModule * CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod) { - auto it = ModuleRefCache.find(Mod.Signature); - if (it != ModuleRefCache.end()) - return it->second; + auto &ModRef = ModuleRefCache[Mod.Signature]; + if (ModRef) + return cast<llvm::DIModule>(ModRef); // Macro definitions that were defined with "-D" on the command line. SmallString<128> ConfigMacros; @@ -1669,12 +1669,12 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod) { TheCU->getSourceLanguage(), internString(Mod.ModuleName), internString(Mod.Path), TheCU->getProducer(), true, StringRef(), 0, internString(Mod.ASTFile), llvm::DIBuilder::FullDebug, Mod.Signature); - llvm::DIModule *ModuleRef = + llvm::DIModule *M = DIB.createModule(CU, Mod.ModuleName, ConfigMacros, internString(Mod.Path), internString(CGM.getHeaderSearchOpts().Sysroot)); DIB.finalize(); - ModuleRefCache.insert(std::make_pair(Mod.Signature, ModuleRef)); - return ModuleRef; + ModRef.reset(M); + return M; } llvm::DIType *CGDebugInfo::CreateTypeDefinition(const ObjCInterfaceType *Ty, |