[PATCH] D145098: [clang][deps] Preserve input ordering in the full output

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 12:04:01 PST 2023


jansvoboda11 marked 2 inline comments as done.
jansvoboda11 added inline comments.


================
Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:788
+  if (Format == ScanningOutputFormat::Full && ModuleName.empty())
+    FD.resize(Inputs.size());
+
----------------
benlangmuir wrote:
> Since you should never resize `FullDeps` after you start, how about removing `resize` and instead:
> * Make `FullDeps` constructor take the size
> * Change `FullDeps FD;` to `std::optional<FullDeps>`
> * Change this line to `FullDeps.emplace(Inputs.size())`
We don't want to resize when we're only scanning by module name, in that case our input is not a translation unit. I implemented your idea and will try to improve how we model the result types in a follow-up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145098



More information about the cfe-commits mailing list