Skip to content

Commit 994493c

Browse files
authored
[clang][dataflow][NFC] Rename a confusingly named variable. (#80182)
1 parent 908fd09 commit 994493c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class HTMLLogger : public Logger {
162162
llvm::raw_string_ostream JStringStream{JSON};
163163
llvm::json::OStream JOS{JStringStream, /*Indent=*/2};
164164

165-
const ControlFlowContext *CFG;
165+
const ControlFlowContext *CFC;
166166
// Timeline of iterations of CFG block visitation.
167167
std::vector<Iteration> Iters;
168168
// Indexes in `Iters` of the iterations for each block.
@@ -176,15 +176,15 @@ class HTMLLogger : public Logger {
176176

177177
public:
178178
explicit HTMLLogger(StreamFactory Streams) : Streams(std::move(Streams)) {}
179-
void beginAnalysis(const ControlFlowContext &CFG,
179+
void beginAnalysis(const ControlFlowContext &CFC,
180180
TypeErasedDataflowAnalysis &A) override {
181181
OS = Streams();
182-
this->CFG = &CFG;
182+
this->CFC = &CFC;
183183
*OS << llvm::StringRef(HTMLLogger_html).split("<?INJECT?>").first;
184184

185-
BlockConverged.resize(CFG.getCFG().getNumBlockIDs());
185+
BlockConverged.resize(CFC.getCFG().getNumBlockIDs());
186186

187-
const auto &D = CFG.getDecl();
187+
const auto &D = CFC.getDecl();
188188
const auto &SM = A.getASTContext().getSourceManager();
189189
*OS << "<title>";
190190
if (const auto *ND = dyn_cast<NamedDecl>(&D))
@@ -345,15 +345,15 @@ class HTMLLogger : public Logger {
345345
// tokens are associated with, and even which BB element (so that clicking
346346
// can select the right element).
347347
void writeCode() {
348-
const auto &AST = CFG->getDecl().getASTContext();
348+
const auto &AST = CFC->getDecl().getASTContext();
349349
bool Invalid = false;
350350

351351
// Extract the source code from the original file.
352352
// Pretty-printing from the AST would probably be nicer (no macros or
353353
// indentation to worry about), but we need the boundaries of particular
354354
// AST nodes and the printer doesn't provide this.
355355
auto Range = clang::Lexer::makeFileCharRange(
356-
CharSourceRange::getTokenRange(CFG->getDecl().getSourceRange()),
356+
CharSourceRange::getTokenRange(CFC->getDecl().getSourceRange()),
357357
AST.getSourceManager(), AST.getLangOpts());
358358
if (Range.isInvalid())
359359
return;
@@ -419,7 +419,7 @@ class HTMLLogger : public Logger {
419419
// Construct one TokenInfo per character in a flat array.
420420
// This is inefficient (chars in a token all have the same info) but simple.
421421
std::vector<TokenInfo> State(Code.size());
422-
for (const auto *Block : CFG->getCFG()) {
422+
for (const auto *Block : CFC->getCFG()) {
423423
unsigned EltIndex = 0;
424424
for (const auto& Elt : *Block) {
425425
++EltIndex;
@@ -480,7 +480,7 @@ class HTMLLogger : public Logger {
480480
// out to `dot` to turn it into an SVG.
481481
void writeCFG() {
482482
*OS << "<template data-copy='cfg'>\n";
483-
if (auto SVG = renderSVG(buildCFGDot(CFG->getCFG())))
483+
if (auto SVG = renderSVG(buildCFGDot(CFC->getCFG())))
484484
*OS << *SVG;
485485
else
486486
*OS << "Can't draw CFG: " << toString(SVG.takeError());

0 commit comments

Comments
 (0)