Skip to content

Commit

Permalink
[clang][dataflow][NFC] Rename a confusingly named variable. (#80182)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehme committed Feb 1, 2024
1 parent 908fd09 commit 994493c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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))
Expand Down Expand Up @@ -345,15 +345,15 @@ 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.
// Pretty-printing from the AST would probably be nicer (no macros or
// 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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 994493c

Please sign in to comment.