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
diff --git a/examples/wpa/clang-wpa.cpp b/examples/wpa/clang-wpa.cpp
index 4f103b2..bfac398 100644
--- a/examples/wpa/clang-wpa.cpp
+++ b/examples/wpa/clang-wpa.cpp
@@ -105,5 +105,12 @@
     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;
 }