[all-commits] [llvm/llvm-project] 473ca9: [clang][ssaf] Add --ssaf-compilation-unit-id= flag...

Jan Korous via All-commits all-commits at lists.llvm.org
Fri Jun 12 10:30:42 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 473ca91cdb03d01394eea440ea4f3a14cdc04b6e
      https://github.com/llvm/llvm-project/commit/473ca91cdb03d01394eea440ea4f3a14cdc04b6e
  Author: Jan Korous <jkorous at apple.com>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticFrontendKinds.td
    M clang/include/clang/Frontend/FrontendOptions.h
    M clang/include/clang/Options/Options.td
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/ScalableStaticAnalysisFramework/Frontend/TUSummaryExtractorFrontendAction.cpp
    M clang/test/Analysis/Scalable/PointerFlow/external-inline-function-in-multi-tu.test
    M clang/test/Analysis/Scalable/call-graph.cpp
    A clang/test/Analysis/Scalable/cli-errors-compilation-unit-id.cpp
    M clang/test/Analysis/Scalable/command-line-interface.cpp
    M clang/test/Analysis/Scalable/downgradable-errors.cpp
    M clang/test/Analysis/Scalable/extraction-works-alongside-compilation.cpp
    M clang/test/Analysis/Scalable/help.cpp
    M clang/unittests/ScalableStaticAnalysisFramework/Frontend/TUSummaryExtractorFrontendActionTest.cpp

  Log Message:
  -----------
  [clang][ssaf] Add --ssaf-compilation-unit-id= flag (#203345)

The TU summary extractor previously sourced the CompilationUnit
namespace name from clang's `InFile` argument, which made the identity
of a TU summary depend on the file path the build system passed to
clang. Have the build system pass the identifier directly:

- New driver/cc1 option `--ssaf-compilation-unit-id=<id>`, marshalled
into `FrontendOptions::SSAFCompilationUnitId`.
- `TUSummaryRunner` builds its `BuildNamespace(CompilationUnit, ...)`
from the new option's value; `InFile` is no longer threaded into the
runner.
- New diagnostic `warn_ssaf_tu_summary_requires_compilation_unit_id`
(under `-Wscalable-static-analysis-framework`, `DefaultError`) fires
when `--ssaf-tu-summary-file=` is set without a non-empty
`--ssaf-compilation-unit-id=`. The runner falls back to the wrapped
consumer alone in that case, matching the existing setup-time SSAF
diagnostics.

Assisted-By: Claude Opus 4.7



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list