diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-07-06 05:55:13 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-07-06 05:55:13 +0000 |
commit | dc01a153f20be7121c4d3fdc17bb28ff4442231c (patch) | |
tree | f9cec6de8e403fc2ffd0eee55de1abb1060f16b2 /examples | |
parent | 044cc54a7d83c90857187c4cd4a0fd33664a7f7f (diff) |
Collect function definitions in the Indexer when indexing through the ASTs.
Add an API to get an Entity associated with a name in the global namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/wpa/clang-wpa.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/wpa/clang-wpa.cpp b/examples/wpa/clang-wpa.cpp index 4f103b2a8d..bfac398532 100644 --- a/examples/wpa/clang-wpa.cpp +++ b/examples/wpa/clang-wpa.cpp @@ -105,5 +105,12 @@ int main(int argc, char **argv) { Idxer.IndexAST(&TU); } + Entity Ent = Entity::get(AnalyzeFunction, Prog); + FunctionDecl *FD; + TranslationUnit *TU; + llvm::tie(FD, TU) = Idxer.getDefinitionFor(Ent); + + if (!FD) + return 0; return 0; } |