blob: f29cd7857595e919634294f38473716d6c48011b [file] [log] [blame]
Zhongxing Xufda78322009-07-30 09:11:52 +00001//== AnalysisManager.cpp - Path sensitive analysis data manager ----*- C++ -*-//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the AnalysisManager class.
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/Analysis/PathSensitive/AnalysisManager.h"
15#include "clang/Basic/SourceManager.h"
16#include "llvm/Support/Streams.h"
17
18using namespace clang;
19
20void AnalysisManager::DisplayFunction() {
21
22 if (DisplayedFunction)
23 return;
24
25 DisplayedFunction = true;
26
27 // FIXME: Is getCodeDecl() always a named decl?
28 if (isa<FunctionDecl>(getCodeDecl()) ||
29 isa<ObjCMethodDecl>(getCodeDecl())) {
Ted Kremenek23760022009-08-21 23:58:43 +000030 const NamedDecl *ND = cast<NamedDecl>(getCodeDecl());
Zhongxing Xufda78322009-07-30 09:11:52 +000031 SourceManager &SM = getContext().getSourceManager();
32 llvm::cerr << "ANALYZE: "
33 << SM.getPresumedLoc(ND->getLocation()).getFilename()
34 << ' ' << ND->getNameAsString() << '\n';
35 }
36}