<commit_before>//== AnalysisManager.cpp - Path sensitive analysis data manager ----*- C++ -*-//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements the AnalysisManager class.
//
//===----------------------------------------------------------------------===//

#include "clang/Analysis/PathSensitive/AnalysisManager.h"
#include "clang/Basic/SourceManager.h"

using namespace clang;

void AnalysisManager::DisplayFunction(Decl *D) {

  if (DisplayedFunction)
    return;

  DisplayedFunction = true;

  // FIXME: Is getCodeDecl() always a named decl?
  if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) {
    const NamedDecl *ND = cast<NamedDecl>(D);
    SourceManager &SM = getASTContext().getSourceManager();
    llvm::errs() << "ANALYZE: "
                 << SM.getPresumedLoc(ND->getLocation()).getFilename()
                 << ' ' << ND->getNameAsString() << '\n';
  }
}
<commit_msg>Fix 'clang-cc -analyzer-display-progress' by flushing standard error after printing the name of the analyzed function.<commit_after>//== AnalysisManager.cpp - Path sensitive analysis data manager ----*- C++ -*-//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements the AnalysisManager class.
//
//===----------------------------------------------------------------------===//

#include "clang/Analysis/PathSensitive/AnalysisManager.h"
#include "clang/Basic/SourceManager.h"

using namespace clang;

void AnalysisManager::DisplayFunction(Decl *D) {

  if (DisplayedFunction)
    return;

  DisplayedFunction = true;

  // FIXME: Is getCodeDecl() always a named decl?
  if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) {
    const NamedDecl *ND = cast<NamedDecl>(D);
    SourceManager &SM = getASTContext().getSourceManager();
    (llvm::errs() << "ANALYZE: "
                  << SM.getPresumedLoc(ND->getLocation()).getFilename()
                  << ' ' << ND->getNameAsString() << '\n').flush();
  }
}

{'fraction_non_alphanumeric': 0.26024503591043513, 'fraction_numerical': 0.0, 'mean_word_length': 1.9786163522012579, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3288517', 'n_tokens_mistral': 626, 'n_tokens_neox': 609, 'n_words': 156}