[clang] [clang][dataflow][NFC] Rename a confusingly named variable. (PR #80182)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 31 11:17:01 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: None (martinboehme)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/80182.diff
1 Files Affected:
- (modified) clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp (+9-9)
``````````diff
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp b/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
index 1e098d8d23c42..ff4e18de2c70f 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
@@ -162,7 +162,7 @@ class HTMLLogger : public Logger {
llvm::raw_string_ostream JStringStream{JSON};
llvm::json::OStream JOS{JStringStream, /*Indent=*/2};
- const ControlFlowContext *CFG;
+ const ControlFlowContext *CFC;
// Timeline of iterations of CFG block visitation.
std::vector<Iteration> Iters;
// Indexes in `Iters` of the iterations for each block.
@@ -176,15 +176,15 @@ class HTMLLogger : public Logger {
public:
explicit HTMLLogger(StreamFactory Streams) : Streams(std::move(Streams)) {}
- void beginAnalysis(const ControlFlowContext &CFG,
+ void beginAnalysis(const ControlFlowContext &CFC,
TypeErasedDataflowAnalysis &A) override {
OS = Streams();
- this->CFG = &CFG;
+ this->CFC = &CFC;
*OS << llvm::StringRef(HTMLLogger_html).split("<?INJECT?>").first;
- BlockConverged.resize(CFG.getCFG().getNumBlockIDs());
+ BlockConverged.resize(CFC.getCFG().getNumBlockIDs());
- const auto &D = CFG.getDecl();
+ const auto &D = CFC.getDecl();
const auto &SM = A.getASTContext().getSourceManager();
*OS << "<title>";
if (const auto *ND = dyn_cast<NamedDecl>(&D))
@@ -345,7 +345,7 @@ class HTMLLogger : public Logger {
// tokens are associated with, and even which BB element (so that clicking
// can select the right element).
void writeCode() {
- const auto &AST = CFG->getDecl().getASTContext();
+ const auto &AST = CFC->getDecl().getASTContext();
bool Invalid = false;
// Extract the source code from the original file.
@@ -353,7 +353,7 @@ class HTMLLogger : public Logger {
// indentation to worry about), but we need the boundaries of particular
// AST nodes and the printer doesn't provide this.
auto Range = clang::Lexer::makeFileCharRange(
- CharSourceRange::getTokenRange(CFG->getDecl().getSourceRange()),
+ CharSourceRange::getTokenRange(CFC->getDecl().getSourceRange()),
AST.getSourceManager(), AST.getLangOpts());
if (Range.isInvalid())
return;
@@ -419,7 +419,7 @@ class HTMLLogger : public Logger {
// Construct one TokenInfo per character in a flat array.
// This is inefficient (chars in a token all have the same info) but simple.
std::vector<TokenInfo> State(Code.size());
- for (const auto *Block : CFG->getCFG()) {
+ for (const auto *Block : CFC->getCFG()) {
unsigned EltIndex = 0;
for (const auto& Elt : *Block) {
++EltIndex;
@@ -480,7 +480,7 @@ class HTMLLogger : public Logger {
// out to `dot` to turn it into an SVG.
void writeCFG() {
*OS << "<template data-copy='cfg'>\n";
- if (auto SVG = renderSVG(buildCFGDot(CFG->getCFG())))
+ if (auto SVG = renderSVG(buildCFGDot(CFC->getCFG())))
*OS << *SVG;
else
*OS << "Can't draw CFG: " << toString(SVG.takeError());
``````````
</details>
https://github.com/llvm/llvm-project/pull/80182
More information about the cfe-commits
mailing list