File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
clang/lib/Tooling/DependencyScanning Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -569,12 +569,11 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
569
569
return {};
570
570
571
571
// If this module has been handled already, just return its ID.
572
- auto ModI = MDC.ModularDeps .insert ({M, nullptr });
573
- if (!ModI.second )
574
- return ModI.first ->second ->ID ;
572
+ if (auto ModI = MDC.ModularDeps .find (M); ModI != MDC.ModularDeps .end ())
573
+ return ModI->second ->ID ;
575
574
576
- ModI. first -> second = std::make_unique<ModuleDeps>();
577
- ModuleDeps &MD = *ModI. first -> second ;
575
+ auto OwnedMD = std::make_unique<ModuleDeps>();
576
+ ModuleDeps &MD = *OwnedMD ;
578
577
579
578
MD.ID .ModuleName = M->getFullModuleName ();
580
579
MD.IsSystem = M->IsSystem ;
@@ -650,6 +649,8 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
650
649
651
650
MD.BuildInfo = std::move (CI);
652
651
652
+ MDC.ModularDeps .insert ({M, std::move (OwnedMD)});
653
+
653
654
return MD.ID ;
654
655
}
655
656
You can’t perform that action at this time.
0 commit comments