Changed SymbolContext so when you search for functions
it returns a list of functions as a SymbolContextList.

Rewrote the clients of SymbolContext to use this
SymbolContextList.

Rewrote some of the providers of the data to SymbolContext
to make them respect preferences as to whether the list
should be cleared first; propagated that change out.

ClangExpressionDeclMap and ClangASTSource use this new
function list to properly generate function definitions -
even for functions that don't have a prototype in the
debug information.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109476 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectCall.cpp b/source/Commands/CommandObjectCall.cpp
index 12281b3..b3dfc53 100644
--- a/source/Commands/CommandObjectCall.cpp
+++ b/source/Commands/CommandObjectCall.cpp
@@ -169,9 +169,20 @@
         //const char *return_type = command.GetArgumentAtIndex(0);
         const char *function_name = command.GetArgumentAtIndex(1);
         // Look up the called function:
+        
+        Function *target_fn = NULL;
+        
+        SymbolContextList sc_list;
+        
+        exe_ctx.frame->GetSymbolContext(eSymbolContextEverything).FindFunctionsByName(ConstString(function_name), false, sc_list);
 
-        Function *target_fn = exe_ctx.frame->GetSymbolContext(eSymbolContextEverything).FindFunctionByName (function_name);
-
+        if (sc_list.GetSize() > 0)
+        {
+            SymbolContext sc;
+            sc_list.GetContextAtIndex(0, sc);
+            target_fn = sc.function;
+        }
+        
         // FIXME: If target_fn is NULL, we should look up the name as a symbol and use it and the provided
         // return type.