[PATCH] D127243: [clang][deps] Make order of module dependencies deterministic

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 08:38:29 PDT 2022


benlangmuir added inline comments.


================
Comment at: clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp:181
     std::vector<PrebuiltModuleDep> PrebuiltModuleDeps;
-    std::map<std::string, ModuleDeps> ClangModuleDeps;
+    llvm::MapVector<std::string, std::unique_ptr<ModuleDeps>,
+                    llvm::StringMap<unsigned>>
----------------
jansvoboda11 wrote:
> What's the reason for wrapping `ModuleDeps` in `unique_ptr`?
Oh hmm, my thinking was that DenseMap is optimized for small values, but I guess in this setup the map only stores integers and the values are in a vector.  I'll change this to values, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127243/new/

https://reviews.llvm.org/D127243



More information about the cfe-commits mailing list