diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-08 22:30:36 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-08 22:30:36 +0000 |
commit | fa0734ec4f15f8a83053812e17e210f5790c042a (patch) | |
tree | 0b8399b58b40f3e92aa9d9a92a20fa496f35465d /clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp | |
parent | 4975170267cadcd0048b69d60e5fd2044280204b (diff) | |
download | bcm5719-llvm-fa0734ec4f15f8a83053812e17e210f5790c042a.tar.gz bcm5719-llvm-fa0734ec4f15f8a83053812e17e210f5790c042a.zip |
[analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.
Eventually there will also be a lib/StaticAnalyzer/Frontend that will handle initialization and checker registration.
Yet another library to avoid cyclic dependencies between Core and Checkers.
llvm-svn: 125124
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp b/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp new file mode 100644 index 00000000000..cc5e2713934 --- /dev/null +++ b/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp @@ -0,0 +1,32 @@ +//===-- AnalysisManager.cpp -------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/StaticAnalyzer/PathSensitive/AnalysisManager.h" +#include "clang/Index/Entity.h" +#include "clang/Index/Indexer.h" + +using namespace clang; +using namespace ento; + +AnalysisContext * +AnalysisManager::getAnalysisContextInAnotherTU(const Decl *D) { + idx::Entity Ent = idx::Entity::get(const_cast<Decl *>(D), + Idxer->getProgram()); + FunctionDecl *FuncDef; + idx::TranslationUnit *TU; + llvm::tie(FuncDef, TU) = Idxer->getDefinitionFor(Ent); + + if (FuncDef == 0) + return 0; + + // This AnalysisContext wraps function definition in another translation unit. + // But it is still owned by the AnalysisManager associated with the current + // translation unit. + return AnaCtxMgr.getContext(FuncDef, TU); +} |