1 //===-- AnalysisManager.cpp -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "clang/GR/PathSensitive/AnalysisManager.h"
11 #include "clang/Index/Entity.h"
12 #include "clang/Index/Indexer.h"
14 using namespace clang
;
18 AnalysisManager::getAnalysisContextInAnotherTU(const Decl
*D
) {
19 idx::Entity Ent
= idx::Entity::get(const_cast<Decl
*>(D
),
21 FunctionDecl
*FuncDef
;
22 idx::TranslationUnit
*TU
;
23 llvm::tie(FuncDef
, TU
) = Idxer
->getDefinitionFor(Ent
);
28 // This AnalysisContext wraps function definition in another translation unit.
29 // But it is still owned by the AnalysisManager associated with the current
31 return AnaCtxMgr
.getContext(FuncDef
, TU
);