[all-commits] [llvm/llvm-project] 8a077c: [clang][deps] Make the C++ API more type-safe

Jan Svoboda via All-commits all-commits at lists.llvm.org
Fri Jul 28 12:04:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a077cfe23e3856d406bd3633e1a3026609f3537
      https://github.com/llvm/llvm-project/commit/8a077cfe23e3856d406bd3633e1a3026609f3537
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

  Changed paths:
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
    M clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
    M clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
    M clang/tools/clang-scan-deps/ClangScanDeps.cpp

  Log Message:
  -----------
  [clang][deps] Make the C++ API more type-safe

Scanner's C++ API accepts a set of modular dependencies the client has already seen and for which it doesn't need the full details. This is currently a set of strings, which somewhat implies that it should contain the set of module names. However, scanner internally expects the values to be in the format "{hash}{name}". Besides not being documented, this is very unintuitive. This patch makes this expectation explicit by changing the type to set of `ModuleID`.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D156492




More information about the All-commits mailing list