Zhongxing Xu | fda7832 | 2009-07-30 09:11:52 +0000 | [diff] [blame] | 1 | //== 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 Xu | fda7832 | 2009-07-30 09:11:52 +0000 | [diff] [blame] | 16 | |
| 17 | using namespace clang; |
| 18 | |
Zhongxing Xu | b317f8f | 2009-09-10 05:44:00 +0000 | [diff] [blame] | 19 | void AnalysisManager::DisplayFunction(Decl *D) { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 20 | |
Zhongxing Xu | fda7832 | 2009-07-30 09:11:52 +0000 | [diff] [blame] | 21 | if (DisplayedFunction) |
| 22 | return; |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 23 | |
Zhongxing Xu | fda7832 | 2009-07-30 09:11:52 +0000 | [diff] [blame] | 24 | DisplayedFunction = true; |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 25 | |
Zhongxing Xu | fda7832 | 2009-07-30 09:11:52 +0000 | [diff] [blame] | 26 | // FIXME: Is getCodeDecl() always a named decl? |
Zhongxing Xu | b317f8f | 2009-09-10 05:44:00 +0000 | [diff] [blame] | 27 | if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) { |
| 28 | const NamedDecl *ND = cast<NamedDecl>(D); |
Zhongxing Xu | 5032ffe | 2009-08-25 06:51:30 +0000 | [diff] [blame] | 29 | SourceManager &SM = getASTContext().getSourceManager(); |
Ted Kremenek | 9e8710b | 2009-10-06 03:49:25 +0000 | [diff] [blame] | 30 | (llvm::errs() << "ANALYZE: " |
| 31 | << SM.getPresumedLoc(ND->getLocation()).getFilename() |
| 32 | << ' ' << ND->getNameAsString() << '\n').flush(); |
Zhongxing Xu | fda7832 | 2009-07-30 09:11:52 +0000 | [diff] [blame] | 33 | } |
| 34 | } |
Zhongxing Xu | b317f8f | 2009-09-10 05:44:00 +0000 | [diff] [blame] | 35 | |