aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/AnalysisManager.cpp
blob: 623db17b927debac65bd9c44a39bf17630580e94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//== 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() {

  if (DisplayedFunction)
    return;

  DisplayedFunction = true;

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