aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-07-30 09:11:52 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-07-30 09:11:52 +0000
commitfda7832b000ff8927386f093b52c067641679469 (patch)
tree57f0f1c526923f5263eaedc1586d0e41a71f015d /lib/Analysis
parenta0a2c7dbf9138ee89dd379813cab839e68e8f6ef (diff)
Make AnalysisManager into its own source file and a pure data management class.
Move all components creation code into AnalysisConsumer::DigestAnalyzerOptions(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/AnalysisManager.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/Analysis/AnalysisManager.cpp b/lib/Analysis/AnalysisManager.cpp
new file mode 100644
index 0000000000..125c00bfee
--- /dev/null
+++ b/lib/Analysis/AnalysisManager.cpp
@@ -0,0 +1,36 @@
+//== 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"
+#include "llvm/Support/Streams.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())) {
+ NamedDecl *ND = cast<NamedDecl>(getCodeDecl());
+ SourceManager &SM = getContext().getSourceManager();
+ llvm::cerr << "ANALYZE: "
+ << SM.getPresumedLoc(ND->getLocation()).getFilename()
+ << ' ' << ND->getNameAsString() << '\n';
+ }
+}