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/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index f778f45..bb0182c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3566,17 +3566,27 @@
                                         // in the DWARF for C++ methods... Default to public for now...
                                         if (accessibility == eAccessNone)
                                             accessibility = eAccessPublic;
-
-                                        clang::CXXMethodDecl *cxx_method_decl;
-                                        cxx_method_decl = ast.AddMethodToCXXRecordType (class_opaque_type, 
-                                                                                        type_name_cstr,
-                                                                                        clang_type,
-                                                                                        accessibility,
-                                                                                        is_virtual,
-                                                                                        is_static,
-                                                                                        is_inline,
-                                                                                        is_explicit);
-                                        type_handled = cxx_method_decl != NULL;
+                                        
+                                        if (!is_static && !die->HasChildren())
+                                        {
+                                            // We have a C++ member function with no children (this pointer!)
+                                            // and clang will get mad if we try and make a function that isn't
+                                            // well formed in the DWARF, so we will just skip it...
+                                            type_handled = true;
+                                        }
+                                        else
+                                        {
+                                            clang::CXXMethodDecl *cxx_method_decl;
+                                            cxx_method_decl = ast.AddMethodToCXXRecordType (class_opaque_type, 
+                                                                                            type_name_cstr,
+                                                                                            clang_type,
+                                                                                            accessibility,
+                                                                                            is_virtual,
+                                                                                            is_static,
+                                                                                            is_inline,
+                                                                                            is_explicit);
+                                            type_handled = cxx_method_decl != NULL;
+                                        }
                                     }
                                 }
                             }