Changed the SymbolFile::FindFunction() function calls to only return 
lldb_private::Function objects. Previously the SymbolFileSymtab subclass
would return lldb_private::Symbol objects when it was asked to find functions.

The Module::FindFunctions (...) now take a boolean "bool include_symbols" so
that the module can track down functions and symbols, yet functions are found
by the SymbolFile plug-ins (through the SymbolVendor class), and symbols are
gotten through the ObjectFile plug-ins.

Fixed and issue where the DWARF parser might run into incomplete class member
function defintions which would make clang mad when we tried to make certain
member functions with invalid number of parameters (such as an operator=
operator that had no parameters). Now we just avoid and don't complete these
incomplete functions.

llvm-svn: 124359
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 6226fb2..ef8e393 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -321,21 +321,88 @@
 }
 
 uint32_t
-Module::FindFunctions(const ConstString &name, uint32_t name_type_mask, bool append, SymbolContextList& sc_list)
+Module::FindFunctions (const ConstString &name, 
+                       uint32_t name_type_mask, 
+                       bool include_symbols, 
+                       bool append, 
+                       SymbolContextList& sc_list)
 {
+    if (!append)
+        sc_list.Clear();
+
+    const uint32_t start_size = sc_list.GetSize();
+
+    // Find all the functions (not symbols, but debug information functions...
     SymbolVendor *symbols = GetSymbolVendor ();
     if (symbols)
-        return symbols->FindFunctions(name, name_type_mask, append, sc_list);
-    return 0;
+        symbols->FindFunctions(name, name_type_mask, append, sc_list);
+
+    // Now check our symbol table for symbols that are code symbols if requested
+    if (include_symbols)
+    {
+        ObjectFile *objfile = GetObjectFile();
+        if (objfile)
+        {
+            Symtab *symtab = objfile->GetSymtab();
+            if (symtab)
+            {
+                std::vector<uint32_t> symbol_indexes;
+                symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
+                const uint32_t num_matches = symbol_indexes.size();
+                if (num_matches)
+                {
+                    SymbolContext sc(this);
+                    for (uint32_t i=0; i<num_matches; i++)
+                    {
+                        sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
+                        sc_list.AppendIfUnique (sc);
+                    }
+                }
+            }
+        }
+    }
+    return sc_list.GetSize() - start_size;
 }
 
 uint32_t
-Module::FindFunctions(const RegularExpression& regex, bool append, SymbolContextList& sc_list)
+Module::FindFunctions (const RegularExpression& regex, 
+                       bool include_symbols, 
+                       bool append, 
+                       SymbolContextList& sc_list)
 {
+    if (!append)
+        sc_list.Clear();
+    
+    const uint32_t start_size = sc_list.GetSize();
+    
     SymbolVendor *symbols = GetSymbolVendor ();
     if (symbols)
         return symbols->FindFunctions(regex, append, sc_list);
-    return 0;
+    // Now check our symbol table for symbols that are code symbols if requested
+    if (include_symbols)
+    {
+        ObjectFile *objfile = GetObjectFile();
+        if (objfile)
+        {
+            Symtab *symtab = objfile->GetSymtab();
+            if (symtab)
+            {
+                std::vector<uint32_t> symbol_indexes;
+                symtab->AppendSymbolIndexesMatchingRegExAndType (regex, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
+                const uint32_t num_matches = symbol_indexes.size();
+                if (num_matches)
+                {
+                    SymbolContext sc(this);
+                    for (uint32_t i=0; i<num_matches; i++)
+                    {
+                        sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
+                        sc_list.AppendIfUnique (sc);
+                    }
+                }
+            }
+        }
+    }
+    return sc_list.GetSize() - start_size;
 }
 
 uint32_t