[Lldb-commits] [lldb] r296855 - Remove some dead code in FileSpec.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 2 22:14:39 PST 2017


Author: zturner
Date: Fri Mar  3 00:14:38 2017
New Revision: 296855

URL: http://llvm.org/viewvc/llvm-project?rev=296855&view=rev
Log:
Remove some dead code in FileSpec.

This in turn triggered some fallout where other files had
been transitively picking up includes that they needed from
FileSpec.h, so I've fixed those up as well.

Modified:
    lldb/trunk/include/lldb/Core/Disassembler.h
    lldb/trunk/include/lldb/Core/StringList.h
    lldb/trunk/include/lldb/Host/FileCache.h
    lldb/trunk/include/lldb/Host/FileSpec.h
    lldb/trunk/source/Core/StringList.cpp
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
    lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Fri Mar  3 00:14:38 2017
@@ -12,6 +12,8 @@
 
 // C Includes
 // C++ Includes
+#include <map>
+#include <set>
 #include <string>
 #include <vector>
 

Modified: lldb/trunk/include/lldb/Core/StringList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StringList.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/StringList.h (original)
+++ lldb/trunk/include/lldb/Core/StringList.h Fri Mar  3 00:14:38 2017
@@ -49,8 +49,6 @@ public:
 
   void AppendList(StringList strings);
 
-  bool ReadFileLines(FileSpec &input_file);
-
   size_t GetSize() const;
 
   void SetSize(size_t n) { m_strings.resize(n); }

Modified: lldb/trunk/include/lldb/Host/FileCache.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileCache.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/FileCache.h (original)
+++ lldb/trunk/include/lldb/Host/FileCache.h Fri Mar  3 00:14:38 2017
@@ -9,6 +9,7 @@
 #ifndef liblldb_Host_FileCache_h
 #define liblldb_Host_FileCache_h
 
+#include <map>
 #include <stdint.h>
 
 #include "lldb/lldb-forward.h"

Modified: lldb/trunk/include/lldb/Host/FileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/FileSpec.h (original)
+++ lldb/trunk/include/lldb/Host/FileSpec.h Fri Mar  3 00:14:38 2017
@@ -17,7 +17,6 @@
 
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/STLUtils.h"
 #include "lldb/Host/PosixApi.h"
 #include "lldb/Utility/ConstString.h"
 #include "lldb/lldb-private.h"
@@ -590,21 +589,6 @@ public:
   void SetIsResolved(bool is_resolved) { m_is_resolved = is_resolved; }
 
   //------------------------------------------------------------------
-  /// Read the file into an array of strings, one per line.
-  ///
-  /// Opens and reads the file in this object into an array of strings,
-  /// one string per line of the file. Returns a boolean indicating
-  /// success or failure.
-  ///
-  /// @param[out] lines
-  ///     The string array into which to read the file.
-  ///
-  /// @result
-  ///     Returns the number of lines that were read from the file.
-  //------------------------------------------------------------------
-  size_t ReadFileLines(STLStringArray &lines);
-
-  //------------------------------------------------------------------
   /// Resolves user name and links in \a path, and overwrites the input
   /// argument with the resolved path.
   ///

Modified: lldb/trunk/source/Core/StringList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StringList.cpp?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Core/StringList.cpp (original)
+++ lldb/trunk/source/Core/StringList.cpp Fri Mar  3 00:14:38 2017
@@ -65,10 +65,6 @@ void StringList::AppendList(StringList s
     m_strings.push_back(strings.GetStringAtIndex(i));
 }
 
-bool StringList::ReadFileLines(FileSpec &input_file) {
-  return input_file.ReadFileLines(m_strings);
-}
-
 size_t StringList::GetSize() const { return m_strings.size(); }
 
 size_t StringList::GetMaxStringLength() const {

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri Mar  3 00:14:38 2017
@@ -906,21 +906,6 @@ DataBufferSP FileSpec::ReadFileContentsA
   return data_sp;
 }
 
-size_t FileSpec::ReadFileLines(STLStringArray &lines) {
-  lines.clear();
-  char path[PATH_MAX];
-  if (GetPath(path, sizeof(path))) {
-    std::ifstream file_stream(path);
-
-    if (file_stream) {
-      std::string line;
-      while (getline(file_stream, line))
-        lines.push_back(line);
-    }
-  }
-  return lines.size();
-}
-
 FileSpec::EnumerateDirectoryResult
 FileSpec::ForEachItemInDirectory(llvm::StringRef dir_path,
                                  DirectoryCallback const &callback) {

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h Fri Mar  3 00:14:38 2017
@@ -12,6 +12,9 @@
 
 // C Includes
 // C++ Includes
+#include <map>
+#include <memory>
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Breakpoint/StoppointCallbackContext.h"

Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h Fri Mar  3 00:14:38 2017
@@ -22,6 +22,8 @@
 
 // C Includes
 // C++ Includes
+#include <map>
+#include <memory>
 #include <mutex>
 
 class ObjectContainerBSDArchive : public lldb_private::ObjectContainer {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h Fri Mar  3 00:14:38 2017
@@ -15,7 +15,7 @@
 
 #include "DWARFDIE.h"
 #include "SymbolFileDWARF.h"
-#include "lldb/lldb-private.h"
+#include "lldb/Core/STLUtils.h"
 #include "lldb/lldb-private.h"
 
 typedef std::multimap<const char *, dw_offset_t, CStringCompareFunctionObject>

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h Fri Mar  3 00:14:38 2017
@@ -11,6 +11,7 @@
 #define SymbolFileDWARF_DWARFDebugPubnamesSet_h_
 
 #include "SymbolFileDWARF.h"
+#include <map>
 #include <string>
 #include <vector>
 #if __cplusplus >= 201103L || defined(_MSC_VER)
@@ -19,6 +20,8 @@
 #include <ext/hash_map>
 #endif
 
+#include "lldb/Core/STLUtils.h"
+
 class DWARFDebugPubnamesSet {
 public:
   struct Header {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Fri Mar  3 00:14:38 2017
@@ -11,6 +11,7 @@
 #define SymbolFileDWARF_SymbolFileDWARFDebugMap_h_
 
 #include <bitset>
+#include <map>
 #include <vector>
 
 #include "lldb/Core/RangeMap.h"

Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h?rev=296855&r1=296854&r2=296855&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h Fri Mar  3 00:14:38 2017
@@ -12,6 +12,7 @@
 
 // C Includes
 // C++ Includes
+#include <map>
 #include <vector>
 
 // Other libraries and framework includes




More information about the lldb-commits mailing list