[clang] [clang][ssaf] Integrate source-edit-generation (PR #208590)
Ziqing Luo via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 10 14:48:04 PDT 2026
================
@@ -0,0 +1,63 @@
+==============================
+Source Edit Generation
+==============================
+
+Source edit generation relies on a ``WPASuite`` result produced by an
+earlier whole-program analysis. It runs alongside the normal compile
+and emits two per-translation-unit artifacts:
+
+- a *source-edit file* (``--ssaf-src-edit-file=``) containing
+ ``clang::tooling::Replacement`` records ready for
+ ``clang-apply-replacements``,
+- a *transformation-report file* (``--ssaf-transformation-report-file=``)
+ containing diagnostic-style findings.
+
+Driver flags
+============
+
+Four flags control the pipeline; they are all both ``--ssaf-…`` driver
+flags and ``cc1`` flags. The compilation-unit identifier is shared
+with the summary extraction step. A given compilation unit needs to
+receive the same identifier for both summary extraction and source
+edit generation.
+
+.. list-table::
+ :header-rows: 1
+
+ * - Flag
+ - Purpose
+ * - ``--ssaf-source-transformation=<name>``
+ - Name of the transformation to run.
+ * - ``--ssaf-global-scope-analysis-result=<path>.<format>``
+ - WPASuite input. The extension selects the serialization format.
+ * - ``--ssaf-src-edit-file=<path>``
----------------
ziqingluo-90 wrote:
A possible follow-up SSAF discussion: Can we make input/output explicit in flag names? Like, adding "output" to all output flags `--ssaf-output-*`.
https://github.com/llvm/llvm-project/pull/208590
More information about the cfe-commits
mailing list