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.

llvm-svn: 296855
This commit is contained in:
Zachary Turner 2017-03-03 06:14:38 +00:00
parent 4f73dbf403
commit 6007b5f713
12 changed files with 14 additions and 38 deletions

View File

@ -12,6 +12,8 @@
// C Includes
// C++ Includes
#include <map>
#include <set>
#include <string>
#include <vector>

View File

@ -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); }

View File

@ -9,6 +9,7 @@
#ifndef liblldb_Host_FileCache_h
#define liblldb_Host_FileCache_h
#include <map>
#include <stdint.h>
#include "lldb/lldb-forward.h"

View File

@ -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"
@ -589,21 +588,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.

View File

@ -65,10 +65,6 @@ void StringList::AppendList(StringList strings) {
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 {

View File

@ -906,21 +906,6 @@ DataBufferSP FileSpec::ReadFileContentsAsCString(Error *error_ptr) {
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) {

View File

@ -12,6 +12,9 @@
// C Includes
// C++ Includes
#include <map>
#include <memory>
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/StoppointCallbackContext.h"

View File

@ -22,6 +22,8 @@
// C Includes
// C++ Includes
#include <map>
#include <memory>
#include <mutex>
class ObjectContainerBSDArchive : public lldb_private::ObjectContainer {

View File

@ -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>

View File

@ -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 {

View File

@ -11,6 +11,7 @@
#define SymbolFileDWARF_SymbolFileDWARFDebugMap_h_
#include <bitset>
#include <map>
#include <vector>
#include "lldb/Core/RangeMap.h"

View File

@ -12,6 +12,7 @@
// C Includes
// C++ Includes
#include <map>
#include <vector>
// Other libraries and framework includes