[clang] [clang][ssaf][NFC] Rename Transformation's Suite to AnalysisRes (PR #235183)
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 23 19:23:20 PDT 2026
https://github.com/jkorous-apple created https://github.com/llvm/llvm-project/pull/235183
A transformation reads the whole-program analysis result through Transformation's WPASuite member. Name the member for what it holds. AnalysisRes rather than AnalysisResult, which would hide the clang::ssaf::AnalysisResult class in every transformation.
Assisted-by: Claude
>From 68052f12f636e66fadd657b2d43b511bf613547a Mon Sep 17 00:00:00 2001
From: Jan Korous <jkorous at apple.com>
Date: Fri, 23 Oct 2026 19:17:00 -0700
Subject: [PATCH] [clang][ssaf][NFC] Rename Transformation's Suite to
AnalysisRes
A transformation reads the whole-program analysis result through
Transformation's WPASuite member. Name the member for what it holds.
AnalysisRes rather than AnalysisResult, which would hide the
clang::ssaf::AnalysisResult class in every transformation.
Assisted-by: Claude
---
.../SourceTransformation/Transformation.h | 6 +++---
.../Transformations/CppBoundedBuffers.cpp | 4 ++--
.../Plugins/TestTransformationPlugin/TestTransformation.cpp | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/clang/include/clang/ScalableStaticAnalysis/SourceTransformation/Transformation.h b/clang/include/clang/ScalableStaticAnalysis/SourceTransformation/Transformation.h
index 5416facab0dd4b..ad953b43a9736a 100644
--- a/clang/include/clang/ScalableStaticAnalysis/SourceTransformation/Transformation.h
+++ b/clang/include/clang/ScalableStaticAnalysis/SourceTransformation/Transformation.h
@@ -25,12 +25,12 @@ class SSAFOptions;
class Transformation : public clang::ASTConsumer {
public:
- Transformation(const WPASuite &Suite, const SSAFOptions &Opts,
+ Transformation(const WPASuite &AnalysisRes, const SSAFOptions &Opts,
SourceEditEmitter &Edits, TransformationReportEmitter &Report)
- : Suite(Suite), Opts(Opts), Edits(Edits), Report(Report) {}
+ : AnalysisRes(AnalysisRes), Opts(Opts), Edits(Edits), Report(Report) {}
protected:
- const WPASuite &Suite;
+ const WPASuite &AnalysisRes;
const SSAFOptions &Opts;
SourceEditEmitter &Edits;
TransformationReportEmitter &Report;
diff --git a/clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp b/clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
index c119ee2f01c5ea..a055f29ba14df5 100644
--- a/clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
+++ b/clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
@@ -593,13 +593,13 @@ classifyDeclType(QualType T, const llvm::SmallSet<unsigned, 4> &ReachableLevels,
}
void CppBoundedBuffers::HandleTranslationUnit(ASTContext &Ctx) {
- auto Reachable = Suite.get<UnsafeBufferReachableAnalysisResult>();
+ auto Reachable = AnalysisRes.get<UnsafeBufferReachableAnalysisResult>();
if (!Reachable) {
llvm::consumeError(Reachable.takeError());
return;
}
- ReachabilityMap Reach(Suite, Reachable->Reachables);
+ ReachabilityMap Reach(AnalysisRes, Reachable->Reachables);
NestedBuildNamespace TUNamespace =
NestedBuildNamespace::makeCompilationUnit(Opts.CompilationUnitId);
NestedBuildNamespace LUNamespace =
diff --git a/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/TestTransformation.cpp b/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/TestTransformation.cpp
index 2909cdfc5821ba..5aed7ee49ba90d 100644
--- a/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/TestTransformation.cpp
+++ b/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/TestTransformation.cpp
@@ -42,7 +42,7 @@ class TestTransformation final : public Transformation {
using Transformation::Transformation;
void HandleTranslationUnit(ASTContext &Ctx) override {
- bool SuiteIsNonEmpty = Suite.getIdTable().count() > 0;
+ bool SuiteIsNonEmpty = AnalysisRes.getIdTable().count() > 0;
Visitor V{*this, Ctx, SuiteIsNonEmpty};
V.TraverseDecl(Ctx.getTranslationUnitDecl());
}
More information about the cfe-commits
mailing list