summaryrefslogtreecommitdiffstats
path: root/clang/lib/GR/AnalysisManager.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-12-22 18:52:29 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-12-22 18:52:29 +0000
commit2ff5ab1516e48c2fff0138f953d887b5e695214b (patch)
treec52787595b6c148ca1a646c31f93e1eb764c362f /clang/lib/GR/AnalysisManager.cpp
parent8d602a8aa8e6697509465d8a5473fc41cb1a382e (diff)
downloadbcm5719-llvm-2ff5ab1516e48c2fff0138f953d887b5e695214b.tar.gz
bcm5719-llvm-2ff5ab1516e48c2fff0138f953d887b5e695214b.zip
[analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> libclangGRCore
llvm-svn: 122421
Diffstat (limited to 'clang/lib/GR/AnalysisManager.cpp')
-rw-r--r--clang/lib/GR/AnalysisManager.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/lib/GR/AnalysisManager.cpp b/clang/lib/GR/AnalysisManager.cpp
new file mode 100644
index 00000000000..736cf1d7b18
--- /dev/null
+++ b/clang/lib/GR/AnalysisManager.cpp
@@ -0,0 +1,31 @@
+//===-- 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/GR/PathSensitive/AnalysisManager.h"
+#include "clang/Index/Entity.h"
+#include "clang/Index/Indexer.h"
+
+using namespace clang;
+
+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);
+}
OpenPOWER on IntegriCloud