[Lldb-commits] [lldb] r204310 - cleanup unreferenced functions

Saleem Abdulrasool compnerd at compnerd.org
Wed Mar 19 23:08:37 PDT 2014


Author: compnerd
Date: Thu Mar 20 01:08:36 2014
New Revision: 204310

URL: http://llvm.org/viewvc/llvm-project?rev=204310&view=rev
Log:
cleanup unreferenced functions

This is a mechanical cleanup of unused functions.  In the case where the
functions are referenced (in comment form), I've simply commented out the
functions.  A second pass to clean that up is warranted.

The functions which are otherwise unused have been removed.  Some of these were
introduced in the initial commit and not in use prior to that point!

NFC

Modified:
    lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
    lldb/trunk/source/Core/DataExtractor.cpp
    lldb/trunk/source/DataFormatters/FormatManager.cpp
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Expression/ClangExpressionParser.cpp
    lldb/trunk/source/Expression/ClangUserExpression.cpp
    lldb/trunk/source/Expression/IRForTarget.cpp
    lldb/trunk/source/Host/common/Condition.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Symbol/Symtab.cpp
    lldb/trunk/source/Symbol/TypeList.cpp
    lldb/trunk/source/Target/ThreadPlanTracer.cpp
    lldb/trunk/source/Utility/StringExtractor.cpp

Modified: lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp Thu Mar 20 01:08:36 2014
@@ -28,6 +28,8 @@
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/Target.h"
 
+#include "llvm/ADT/StringRef.h"
+
 #include <vector>
 
 using namespace lldb;
@@ -62,14 +64,6 @@ CheckTargetForWatchpointOperations(Targe
     return true;
 }
 
-// FIXME: This doesn't seem to be the right place for this functionality.
-#include "llvm/ADT/StringRef.h"
-static inline void StripLeadingSpaces(llvm::StringRef &Str)
-{
-    while (!Str.empty() && isspace(Str[0]))
-        Str = Str.substr(1);
-}
-
 // Equivalent class: {"-", "to", "To", "TO"} of range specifier array.
 static const char* RSA[4] = { "-", "to", "To", "TO" };
 

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Mar 20 01:08:36 2014
@@ -52,7 +52,7 @@ ReadInt16(const unsigned char* ptr, offs
 }
 
 static inline uint32_t
-ReadInt32 (const unsigned char* ptr, offset_t offset)
+ReadInt32 (const unsigned char* ptr, offset_t offset = 0)
 {
     uint32_t value;
     memcpy (&value, ptr + offset, 4);
@@ -60,7 +60,7 @@ ReadInt32 (const unsigned char* ptr, off
 }
 
 static inline uint64_t 
-ReadInt64(const unsigned char* ptr, offset_t offset)
+ReadInt64(const unsigned char* ptr, offset_t offset = 0)
 {
     uint64_t value;
     memcpy (&value, ptr + offset, 8);
@@ -75,22 +75,6 @@ ReadInt16(const void* ptr)
     return value;
 }
 
-static inline uint32_t
-ReadInt32 (const void* ptr)
-{
-    uint32_t value;
-    memcpy (&value, ptr, 4);
-    return value;
-}
-
-static inline uint64_t
-ReadInt64(const void* ptr)
-{
-    uint64_t value;
-    memcpy (&value, ptr, 8);
-    return value;
-}
-
 static inline uint16_t
 ReadSwapInt16(const unsigned char* ptr, offset_t offset)
 {

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Thu Mar 20 01:08:36 2014
@@ -768,28 +768,6 @@ AddStringSummary(TypeCategoryImpl::Share
 
 #ifndef LLDB_DISABLE_PYTHON
 static void
-AddScriptSummary(TypeCategoryImpl::SharedPointer category_sp,
-                 const char* funct_name,
-                 ConstString type_name,
-                 TypeSummaryImpl::Flags flags,
-                 bool regex = false)
-{
-    
-    std::string code("     ");
-    code.append(funct_name).append("(valobj,internal_dict)");
-    
-    lldb::TypeSummaryImplSP summary_sp(new ScriptSummaryFormat(flags,
-                                                               funct_name,
-                                                               code.c_str()));
-    if (regex)
-        category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
-    else
-        category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
-}
-#endif
-
-#ifndef LLDB_DISABLE_PYTHON
-static void
 AddCXXSummary (TypeCategoryImpl::SharedPointer category_sp,
                CXXFunctionSummaryFormat::Callback funct,
                const char* description,

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Mar 20 01:08:36 2014
@@ -1440,43 +1440,43 @@ ClangExpressionDeclMap::FindExternalVisi
     }
 }
 
-static clang_type_t
-MaybePromoteToBlockPointerType
-(
-    ASTContext *ast_context,
-    clang_type_t candidate_type
-)
-{
-    if (!candidate_type)
-        return candidate_type;
-    
-    QualType candidate_qual_type = QualType::getFromOpaquePtr(candidate_type);
-    
-    const PointerType *candidate_pointer_type = dyn_cast<PointerType>(candidate_qual_type);
-    
-    if (!candidate_pointer_type)
-        return candidate_type;
-    
-    QualType pointee_qual_type = candidate_pointer_type->getPointeeType();
-    
-    const RecordType *pointee_record_type = dyn_cast<RecordType>(pointee_qual_type);
-    
-    if (!pointee_record_type)
-        return candidate_type;
-    
-    RecordDecl *pointee_record_decl = pointee_record_type->getDecl();
-    
-    if (!pointee_record_decl->isRecord())
-        return candidate_type;
-    
-    if (!pointee_record_decl->getName().startswith(llvm::StringRef("__block_literal_")))
-        return candidate_type;
-    
-    QualType generic_function_type = ast_context->getFunctionNoProtoType(ast_context->UnknownAnyTy);
-    QualType block_pointer_type = ast_context->getBlockPointerType(generic_function_type);
-    
-    return block_pointer_type.getAsOpaquePtr();
-}
+//static clang_type_t
+//MaybePromoteToBlockPointerType
+//(
+//    ASTContext *ast_context,
+//    clang_type_t candidate_type
+//)
+//{
+//    if (!candidate_type)
+//        return candidate_type;
+//
+//    QualType candidate_qual_type = QualType::getFromOpaquePtr(candidate_type);
+//
+//    const PointerType *candidate_pointer_type = dyn_cast<PointerType>(candidate_qual_type);
+//
+//    if (!candidate_pointer_type)
+//        return candidate_type;
+//
+//    QualType pointee_qual_type = candidate_pointer_type->getPointeeType();
+//
+//    const RecordType *pointee_record_type = dyn_cast<RecordType>(pointee_qual_type);
+//
+//    if (!pointee_record_type)
+//        return candidate_type;
+//
+//    RecordDecl *pointee_record_decl = pointee_record_type->getDecl();
+//
+//    if (!pointee_record_decl->isRecord())
+//        return candidate_type;
+//
+//    if (!pointee_record_decl->getName().startswith(llvm::StringRef("__block_literal_")))
+//        return candidate_type;
+//
+//    QualType generic_function_type = ast_context->getFunctionNoProtoType(ast_context->UnknownAnyTy);
+//    QualType block_pointer_type = ast_context->getBlockPointerType(generic_function_type);
+//
+//    return block_pointer_type.getAsOpaquePtr();
+//}
 
 bool
 ClangExpressionDeclMap::GetVariableValue (VariableSP &var,

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Thu Mar 20 01:08:36 2014
@@ -88,87 +88,6 @@ std::string GetBuiltinIncludePath(const
     return P.str();
 }
 
-
-//===----------------------------------------------------------------------===//
-// Main driver for Clang
-//===----------------------------------------------------------------------===//
-
-static void LLVMErrorHandler(void *UserData, const std::string &Message) {
-    DiagnosticsEngine &Diags = *static_cast<DiagnosticsEngine*>(UserData);
-    
-    Diags.Report(diag::err_fe_error_backend) << Message;
-    
-    // We cannot recover from llvm errors.
-    assert(0);
-}
-
-static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
-    using namespace clang::frontend;
-    
-    switch (CI.getFrontendOpts().ProgramAction) {
-        default:
-            llvm_unreachable("Invalid program action!");
-            
-        case ASTDump:                return new ASTDumpAction();
-        case ASTPrint:               return new ASTPrintAction();
-        case ASTView:                return new ASTViewAction();
-        case DumpRawTokens:          return new DumpRawTokensAction();
-        case DumpTokens:             return new DumpTokensAction();
-        case EmitAssembly:           return new EmitAssemblyAction();
-        case EmitBC:                 return new EmitBCAction();
-        case EmitHTML:               return new HTMLPrintAction();
-        case EmitLLVM:               return new EmitLLVMAction();
-        case EmitLLVMOnly:           return new EmitLLVMOnlyAction();
-        case EmitCodeGenOnly:        return new EmitCodeGenOnlyAction();
-        case EmitObj:                return new EmitObjAction();
-        case FixIt:                  return new FixItAction();
-        case GeneratePCH:            return new GeneratePCHAction();
-        case GeneratePTH:            return new GeneratePTHAction();
-        case InitOnly:               return new InitOnlyAction();
-        case ParseSyntaxOnly:        return new SyntaxOnlyAction();
-            
-        case PluginAction: {
-            for (FrontendPluginRegistry::iterator it =
-                 FrontendPluginRegistry::begin(), ie = FrontendPluginRegistry::end();
-                 it != ie; ++it) {
-                if (it->getName() == CI.getFrontendOpts().ActionName) {
-                    std::unique_ptr<PluginASTAction> P(it->instantiate());
-                    if (!P->ParseArgs(CI, CI.getFrontendOpts().PluginArgs))
-                        return 0;
-                    return P.release();
-                }
-            }
-            
-            CI.getDiagnostics().Report(diag::err_fe_invalid_plugin_name)
-            << CI.getFrontendOpts().ActionName;
-            return 0;
-        }
-            
-        case PrintDeclContext:       return new DeclContextPrintAction();
-        case PrintPreamble:          return new PrintPreambleAction();
-        case PrintPreprocessedInput: return new PrintPreprocessedAction();
-        case RewriteMacros:          return new RewriteMacrosAction();
-        case RewriteObjC:            return new RewriteObjCAction();
-        case RewriteTest:            return new RewriteTestAction();
-        //case RunAnalysis:            return new AnalysisAction();
-        case RunPreprocessorOnly:    return new PreprocessOnlyAction();
-    }
-}
-
-static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
-    // Create the underlying action.
-    FrontendAction *Act = CreateFrontendBaseAction(CI);
-    if (!Act)
-        return 0;
-    
-    // If there are any AST files to merge, create a frontend action
-    // adaptor to perform the merge.
-    if (!CI.getFrontendOpts().ASTMergeFiles.empty())
-        Act = new ASTMergeAction(Act, CI.getFrontendOpts().ASTMergeFiles);
-    
-    return Act;
-}
-
 //===----------------------------------------------------------------------===//
 // Implementation of ClangExpressionParser
 //===----------------------------------------------------------------------===//

Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Thu Mar 20 01:08:36 2014
@@ -396,20 +396,20 @@ ApplyObjcCastHack(std::string &expr)
 // hopefully we'll figure out a way to #include the same environment as is
 // present in the original source file rather than try to hack specific type
 // definitions in as needed.
-static void
-ApplyUnicharHack(std::string &expr)
-{
-#define UNICHAR_HACK_FROM "unichar"
-#define UNICHAR_HACK_TO   "unsigned short"
-    
-    size_t from_offset;
-    
-    while ((from_offset = expr.find(UNICHAR_HACK_FROM)) != expr.npos)
-        expr.replace(from_offset, sizeof(UNICHAR_HACK_FROM) - 1, UNICHAR_HACK_TO);
-    
-#undef UNICHAR_HACK_TO
-#undef UNICHAR_HACK_FROM
-}
+//static void
+//ApplyUnicharHack(std::string &expr)
+//{
+//#define UNICHAR_HACK_FROM "unichar"
+//#define UNICHAR_HACK_TO   "unsigned short"
+//
+//    size_t from_offset;
+//
+//    while ((from_offset = expr.find(UNICHAR_HACK_FROM)) != expr.npos)
+//        expr.replace(from_offset, sizeof(UNICHAR_HACK_FROM) - 1, UNICHAR_HACK_TO);
+//
+//#undef UNICHAR_HACK_TO
+//#undef UNICHAR_HACK_FROM
+//}
 
 bool
 ClangUserExpression::Parse (Stream &error_stream, 

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Thu Mar 20 01:08:36 2014
@@ -687,27 +687,6 @@ IRForTarget::CreateResultVariable (llvm:
     return true;
 }
 
-static void DebugUsers(lldb_private::Log *log, Value *value, uint8_t depth)
-{    
-    if (!depth)
-        return;
-    
-    depth--;
-    
-    if (log)
-        log->Printf("  <Begin %d users>", value->getNumUses());
-    
-    for (llvm::User *u : value->users())
-    {
-        if (log)
-            log->Printf("  <Use %p> %s", u, PrintValue(u).c_str());
-        DebugUsers(log, u, depth);
-    }
-    
-    if (log)
-        log->Printf("  <End uses>");
-}
-
 bool
 IRForTarget::RewriteObjCConstString (llvm::GlobalVariable *ns_str,
                                      llvm::GlobalVariable *cstr)

Modified: lldb/trunk/source/Host/common/Condition.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Condition.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Condition.cpp (original)
+++ lldb/trunk/source/Host/common/Condition.cpp Thu Mar 20 01:08:36 2014
@@ -57,11 +57,6 @@ Condition::Signal ()
     return ::pthread_cond_signal (&m_condition);
 }
 
-/* convert struct timeval to ms(milliseconds) */
-static unsigned long int tv2ms(struct timeval a) {
-    return ((a.tv_sec * 1000) + (a.tv_usec / 1000));
-}
-
 //----------------------------------------------------------------------
 // The Wait() function atomically blocks the current thread
 // waiting on the owned condition variable, and unblocks the mutex

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Thu Mar 20 01:08:36 2014
@@ -1069,30 +1069,6 @@ Host::GetOSVersion
 }
 
 static bool
-GetMacOSXProcessName (const ProcessInstanceInfoMatch *match_info_ptr,
-                      ProcessInstanceInfo &process_info)
-{
-    if (process_info.ProcessIDIsValid())
-    {
-        char process_name[MAXCOMLEN * 2 + 1];
-        int name_len = ::proc_name(process_info.GetProcessID(), process_name, MAXCOMLEN * 2);
-        if (name_len == 0)
-            return false;
-        
-        if (match_info_ptr == NULL || NameMatches(process_name,
-                                                  match_info_ptr->GetNameMatchType(),
-                                                  match_info_ptr->GetProcessInfo().GetName()))
-        {
-            process_info.GetExecutableFile().SetFile (process_name, false);
-            return true;
-        }
-    }
-    process_info.GetExecutableFile().Clear();
-    return false;
-}
-
-
-static bool
 GetMacOSXProcessCPUType (ProcessInstanceInfo &process_info)
 {
     if (process_info.ProcessIDIsValid())

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Thu Mar 20 01:08:36 2014
@@ -62,13 +62,6 @@ static ScriptInterpreter::SWIGPythonScri
 static ScriptInterpreter::SWIGPythonScriptKeyword_Frame g_swig_run_script_keyword_frame = NULL;
 static ScriptInterpreter::SWIGPython_GetDynamicSetting g_swig_plugin_get = NULL;
 
-static int
-_check_and_flush (FILE *stream)
-{
-  int prev_fail = ferror (stream);
-  return fflush (stream) || prev_fail ? EOF : 0;
-}
-
 static std::string
 ReadPythonBacktrace (PyObject* py_backtrace);
 

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Thu Mar 20 01:08:36 2014
@@ -708,27 +708,6 @@ GDBRemoteCommunicationServer::Handle_qSp
     return SendErrorResponse (7);
 }
 
-
-static void *
-AcceptPortFromInferior (void *arg)
-{
-    const char *connect_url = (const char *)arg;
-    ConnectionFileDescriptor file_conn;
-    Error error;
-    if (file_conn.Connect (connect_url, &error) == eConnectionStatusSuccess)
-    {
-        char pid_str[256];
-        ::memset (pid_str, 0, sizeof(pid_str));
-        ConnectionStatus status;
-        const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), 0, status, NULL);
-        if (pid_str_len > 0)
-        {
-            int pid = atoi (pid_str);
-            return (void *)(intptr_t)pid;
-        }
-    }
-    return NULL;
-}
 //
 //static bool
 //WaitForProcessToSIGSTOP (const lldb::pid_t pid, const int timeout_in_seconds)

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Mar 20 01:08:36 2014
@@ -166,8 +166,6 @@ namespace {
     
 } // anonymous namespace end
 
-static bool rand_initialized = false;
-
 // TODO Randomly assigning a port is unsafe.  We should get an unused
 // ephemeral port from the kernel and make sure we reserve it before passing
 // it to debugserver.
@@ -180,19 +178,22 @@ static bool rand_initialized = false;
 #define HIGH_PORT   (49151u)
 #endif
 
+#if defined(__APPLE__) && defined(__arm__)
+static bool rand_initialized = false;
+
 static inline uint16_t
 get_random_port ()
 {
     if (!rand_initialized)
     {
         time_t seed = time(NULL);
-        
+
         rand_initialized = true;
         srand(seed);
     }
     return (rand() % (HIGH_PORT - LOW_PORT)) + LOW_PORT;
 }
-
+#endif
 
 lldb_private::ConstString
 ProcessGDBRemote::GetPluginNameStatic()

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Thu Mar 20 01:08:36 2014
@@ -213,13 +213,6 @@ DWARFDebugInfo::ContainsCompileUnit (con
     return false;
 }
 
-
-static bool CompileUnitOffsetLessThan (const DWARFCompileUnitSP& a, const DWARFCompileUnitSP& b)
-{
-    return a->GetOffset() < b->GetOffset();
-}
-
-
 static int
 CompareDWARFCompileUnitSPOffset (const void *key, const void *arrmem)
 {
@@ -279,15 +272,6 @@ DWARFDebugInfo::GetCompileUnitContaining
 }
 
 //----------------------------------------------------------------------
-// Compare function DWARFDebugAranges::Range structures
-//----------------------------------------------------------------------
-static bool CompareDIEOffset (const DWARFDebugInfoEntry& die1, const DWARFDebugInfoEntry& die2)
-{
-    return die1.GetOffset() < die2.GetOffset();
-}
-
-
-//----------------------------------------------------------------------
 // GetDIE()
 //
 // Get the DIE (Debug Information Entry) with the specified offset.
@@ -340,40 +324,6 @@ DWARFDebugInfo::GetDIEPtrContainingOffse
 }
 
 //----------------------------------------------------------------------
-// DWARFDebugInfo_ParseCallback
-//
-// A callback function for the static DWARFDebugInfo::Parse() function
-// that gets parses all compile units and DIE's into an internate
-// representation for further modification.
-//----------------------------------------------------------------------
-
-static dw_offset_t
-DWARFDebugInfo_ParseCallback
-(
-    SymbolFileDWARF* dwarf2Data,
-    DWARFCompileUnitSP& cu_sp,
-    DWARFDebugInfoEntry* die,
-    const dw_offset_t next_offset,
-    const uint32_t curr_depth,
-    void* userData
-)
-{
-    DWARFDebugInfo* debug_info = (DWARFDebugInfo*)userData;
-    DWARFCompileUnit* cu = cu_sp.get();
-    if (die)
-    {
-        cu->AddDIE(*die);
-    }
-    else if (cu)
-    {
-        debug_info->AddCompileUnit(cu_sp);
-    }
-
-    // Just return the current offset to parse the next CU or DIE entry
-    return next_offset;
-}
-
-//----------------------------------------------------------------------
 // AddCompileUnit
 //----------------------------------------------------------------------
 void

Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Thu Mar 20 01:08:36 2014
@@ -366,20 +366,6 @@ SymbolFileSymtab::FindFunctions(const Re
     return 0;
 }
 
-static int CountMethodArgs(const char *method_signature)
-{
-    int num_args = 0;
-    
-    for (const char *colon_pos = strchr(method_signature, ':');
-         colon_pos != NULL;
-         colon_pos = strchr(colon_pos + 1, ':'))
-    {
-        num_args++;
-    }
-    
-    return num_args;
-}
-
 uint32_t
 SymbolFileSymtab::FindTypes (const lldb_private::SymbolContext& sc, 
                              const lldb_private::ConstString &name, 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Mar 20 01:08:36 2014
@@ -1392,222 +1392,6 @@ ClangASTContext::CreateClassTemplateSpec
     return ClangASTType();
 }
 
-static bool
-IsOperator (const char *name, OverloadedOperatorKind &op_kind)
-{
-    if (name == NULL || name[0] == '\0')
-        return false;
-    
-#define OPERATOR_PREFIX "operator"
-#define OPERATOR_PREFIX_LENGTH (sizeof (OPERATOR_PREFIX) - 1)
-    
-    const char *post_op_name = NULL;
-
-    bool no_space = true;
-    
-    if (::strncmp(name, OPERATOR_PREFIX, OPERATOR_PREFIX_LENGTH))
-        return false;
-    
-    post_op_name = name + OPERATOR_PREFIX_LENGTH;
-    
-    if (post_op_name[0] == ' ')
-    {
-        post_op_name++;
-        no_space = false;
-    }
-    
-#undef OPERATOR_PREFIX
-#undef OPERATOR_PREFIX_LENGTH
-    
-    // This is an operator, set the overloaded operator kind to invalid
-    // in case this is a conversion operator...
-    op_kind = NUM_OVERLOADED_OPERATORS;
-
-    switch (post_op_name[0])
-    {
-    default:
-        if (no_space)
-            return false;
-        break;
-    case 'n':
-        if (no_space)
-            return false;
-        if  (strcmp (post_op_name, "new") == 0)  
-            op_kind = OO_New;
-        else if (strcmp (post_op_name, "new[]") == 0)  
-            op_kind = OO_Array_New;
-        break;
-
-    case 'd':
-        if (no_space)
-            return false;
-        if (strcmp (post_op_name, "delete") == 0)
-            op_kind = OO_Delete;
-        else if (strcmp (post_op_name, "delete[]") == 0)  
-            op_kind = OO_Array_Delete;
-        break;
-    
-    case '+':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Plus;
-        else if (post_op_name[2] == '\0')
-        {
-            if (post_op_name[1] == '=')
-                op_kind = OO_PlusEqual;
-            else if (post_op_name[1] == '+')
-                op_kind = OO_PlusPlus;
-        }
-        break;
-
-    case '-':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Minus;
-        else if (post_op_name[2] == '\0')
-        {
-            switch (post_op_name[1])
-            {
-            case '=': op_kind = OO_MinusEqual; break;
-            case '-': op_kind = OO_MinusMinus; break;
-            case '>': op_kind = OO_Arrow; break;
-            }
-        }
-        else if (post_op_name[3] == '\0')
-        {
-            if (post_op_name[2] == '*')
-                op_kind = OO_ArrowStar; break;
-        }
-        break;
-        
-    case '*':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Star;
-        else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-            op_kind = OO_StarEqual;
-        break;
-    
-    case '/':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Slash;
-        else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-            op_kind = OO_SlashEqual;
-        break;
-    
-    case '%':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Percent;
-        else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-            op_kind = OO_PercentEqual;
-        break;
-
-
-    case '^':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Caret;
-        else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-            op_kind = OO_CaretEqual;
-        break;
-
-    case '&':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Amp;
-        else if (post_op_name[2] == '\0')
-        {
-            switch (post_op_name[1])
-            {
-            case '=': op_kind = OO_AmpEqual; break;
-            case '&': op_kind = OO_AmpAmp; break;
-            }   
-        }
-        break;
-
-    case '|':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Pipe;
-        else if (post_op_name[2] == '\0')
-        {
-            switch (post_op_name[1])
-            {
-            case '=': op_kind = OO_PipeEqual; break;
-            case '|': op_kind = OO_PipePipe; break;
-            }   
-        }
-        break;
-    
-    case '~':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Tilde;
-        break;
-    
-    case '!':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Exclaim;
-        else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-            op_kind = OO_ExclaimEqual;
-        break;
-
-    case '=':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Equal;
-        else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-            op_kind = OO_EqualEqual;
-        break;
-    
-    case '<':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Less;
-        else if (post_op_name[2] == '\0')
-        {
-            switch (post_op_name[1])
-            {
-            case '<': op_kind = OO_LessLess; break;
-            case '=': op_kind = OO_LessEqual; break;
-            }   
-        }
-        else if (post_op_name[3] == '\0')
-        {
-            if (post_op_name[2] == '=')
-                op_kind = OO_LessLessEqual;
-        }
-        break;
-
-    case '>':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Greater;
-        else if (post_op_name[2] == '\0')
-        {
-            switch (post_op_name[1])
-            {
-            case '>': op_kind = OO_GreaterGreater; break;
-            case '=': op_kind = OO_GreaterEqual; break;
-            }   
-        }
-        else if (post_op_name[1] == '>' && 
-                 post_op_name[2] == '=' && 
-                 post_op_name[3] == '\0')
-        {
-                op_kind = OO_GreaterGreaterEqual;
-        }
-        break;
-        
-    case ',':
-        if (post_op_name[1] == '\0')
-            op_kind = OO_Comma;
-        break;
-    
-    case '(':
-        if (post_op_name[1] == ')' && post_op_name[2] == '\0')
-            op_kind = OO_Call;
-        break;
-    
-    case '[':
-        if (post_op_name[1] == ']' && post_op_name[2] == '\0')
-            op_kind = OO_Subscript;
-        break;
-    }
-
-    return true;
-}
-
 static inline bool
 check_op_param (uint32_t op_kind, bool unary, bool binary, uint32_t num_params)
 {

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Thu Mar 20 01:08:36 2014
@@ -4340,22 +4340,6 @@ IsOperator (const char *name, Overloaded
     return true;
 }
 
-static inline bool
-check_op_param (uint32_t op_kind, bool unary, bool binary, uint32_t num_params)
-{
-    // Special-case call since it can take any number of operands
-    if(op_kind == OO_Call)
-        return true;
-    
-    // The parameter count doens't include "this"
-    if (num_params == 0)
-        return unary;
-    if (num_params == 1)
-        return binary;
-    else
-        return false;
-}
-
 clang::RecordDecl *
 ClangASTType::GetAsRecordDecl () const
 {

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Thu Mar 20 01:08:36 2014
@@ -867,32 +867,6 @@ typedef struct
 } SymbolSearchInfo;
 
 static int
-SymbolWithFileAddress (SymbolSearchInfo *info, const uint32_t *index_ptr)
-{
-    const Symbol *curr_symbol = info->symtab->SymbolAtIndex (index_ptr[0]);
-    if (curr_symbol == NULL)
-        return -1;
-
-    const addr_t info_file_addr = info->file_addr;
-
-    // lldb::Symbol::GetAddressRangePtr() will only return a non NULL address
-    // range if the symbol has a section!
-    if (curr_symbol->ValueIsAddress())
-    {
-        const addr_t curr_file_addr = curr_symbol->GetAddress().GetFileAddress();
-        if (info_file_addr < curr_file_addr)
-            return -1;
-        if (info_file_addr > curr_file_addr)
-            return +1;
-        info->match_symbol = const_cast<Symbol *>(curr_symbol);
-        info->match_index_ptr = index_ptr;
-        return 0;
-    }
-
-    return -1;
-}
-
-static int
 SymbolWithClosestFileAddress (SymbolSearchInfo *info, const uint32_t *index_ptr)
 {
     const Symbol *symbol = info->symtab->SymbolAtIndex (index_ptr[0]);
@@ -921,19 +895,6 @@ SymbolWithClosestFileAddress (SymbolSear
     return -1;
 }
 
-static SymbolSearchInfo
-FindIndexPtrForSymbolContainingAddress(Symtab* symtab, addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes)
-{
-    SymbolSearchInfo info = { symtab, file_addr, NULL, NULL, 0 };
-    ::bsearch (&info, 
-               indexes, 
-               num_indexes, 
-               sizeof(uint32_t), 
-               (ComparisonFunction)SymbolWithClosestFileAddress);
-    return info;
-}
-
-
 void
 Symtab::InitAddressIndexes()
 {

Modified: lldb/trunk/source/Symbol/TypeList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/TypeList.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/TypeList.cpp (original)
+++ lldb/trunk/source/Symbol/TypeList.cpp Thu Mar 20 01:08:36 2014
@@ -179,49 +179,6 @@ TypeList::Dump(Stream *s, bool show_cont
     }
 }
 
-// depending on implementation details, type lookup might fail because of
-// embedded spurious namespace:: prefixes. this call strips them, paying
-// attention to the fact that a type might have namespace'd type names as
-// arguments to templates, and those must not be stripped off
-static bool
-GetTypeScopeAndBasename(const char* name_cstr, std::string &scope, std::string &basename, bool *exact_ptr)
-{
-    // Protect against null c string.
-    
-    if (name_cstr && name_cstr[0])
-    {
-        const char *basename_cstr = name_cstr;
-        const char* namespace_separator = ::strstr (basename_cstr, "::");
-        if (namespace_separator)
-        {
-            const char* template_arg_char = ::strchr (basename_cstr, '<');
-            while (namespace_separator != NULL)
-            {
-                if (template_arg_char && namespace_separator > template_arg_char) // but namespace'd template arguments are still good to go
-                    break;
-                basename_cstr = namespace_separator + 2;
-                namespace_separator = strstr(basename_cstr, "::");
-            }
-            if (basename_cstr > name_cstr)
-            {
-                scope.assign (name_cstr, basename_cstr - name_cstr);
-                if (scope.size() >= 2 && scope[0] == ':' && scope[1] == ':')
-                {
-                    // The typename passed in started with "::" so make sure we only do exact matches
-                    if (exact_ptr)
-                        *exact_ptr = true;
-                    // Strip the leading "::" as this won't ever show in qualified typenames we get
-                    // from clang.
-                    scope.erase(0,2);
-                }
-                basename.assign (basename_cstr);
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
 void
 TypeList::RemoveMismatchedTypes (const char *qualified_typename,
                                  bool exact_match)

Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Thu Mar 20 01:08:36 2014
@@ -166,17 +166,6 @@ ThreadPlanAssemblyTracer::TracingEnded (
     m_register_values.clear();
 }
 
-static void
-PadOutTo (StreamString &stream, int target)
-{
-    stream.Flush();
-
-    int length = stream.GetString().length();
-
-    if (length + 1 < target)
-        stream.Printf("%*s", target - (length + 1) + 1, "");
-}
-
 void 
 ThreadPlanAssemblyTracer::Log ()
 {

Modified: lldb/trunk/source/Utility/StringExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=204310&r1=204309&r2=204310&view=diff
==============================================================================
--- lldb/trunk/source/Utility/StringExtractor.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractor.cpp Thu Mar 20 01:08:36 2014
@@ -63,16 +63,6 @@ xdigit_to_sint (char ch)
     return ch - '0';
 }
 
-static inline unsigned int
-xdigit_to_uint (uint8_t ch)
-{
-    if (ch >= 'a' && ch <= 'f')
-        return 10u + ch - 'a';
-    if (ch >= 'A' && ch <= 'F')
-        return 10u + ch - 'A';
-    return ch - '0';
-}
-
 //----------------------------------------------------------------------
 // StringExtractor constructor
 //----------------------------------------------------------------------





More information about the lldb-commits mailing list