blob: c2733faa683cc0b1a5fdd0926eab988680de3bec [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"
Zhongxing Xufda78322009-07-30 09:11:52 +000016
17using namespace clang;
18
Zhongxing Xub317f8f2009-09-10 05:44:00 +000019void AnalysisManager::DisplayFunction(Decl *D) {
Mike Stump1eb44332009-09-09 15:08:12 +000020
Zhongxing Xufda78322009-07-30 09:11:52 +000021 if (DisplayedFunction)
22 return;
Mike Stump1eb44332009-09-09 15:08:12 +000023
Zhongxing Xufda78322009-07-30 09:11:52 +000024 DisplayedFunction = true;
Mike Stump1eb44332009-09-09 15:08:12 +000025
Zhongxing Xufda78322009-07-30 09:11:52 +000026 // FIXME: Is getCodeDecl() always a named decl?
Zhongxing Xub317f8f2009-09-10 05:44:00 +000027 if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) {
28 const NamedDecl *ND = cast<NamedDecl>(D);
Zhongxing Xu5032ffe2009-08-25 06:51:30 +000029 SourceManager &SM = getASTContext().getSourceManager();
Ted Kremenek9e8710b2009-10-06 03:49:25 +000030 (llvm::errs() << "ANALYZE: "
31 << SM.getPresumedLoc(ND->getLocation()).getFilename()
32 << ' ' << ND->getNameAsString() << '\n').flush();
Zhongxing Xufda78322009-07-30 09:11:52 +000033 }
34}
Zhongxing Xub317f8f2009-09-10 05:44:00 +000035