Remove more uses of sys::Path.
llvm-svn: 184328
diff --git a/llvm/tools/llvm-ar/Archive.h b/llvm/tools/llvm-ar/Archive.h
index 469a3b4..79933ef 100644
--- a/llvm/tools/llvm-ar/Archive.h
+++ b/llvm/tools/llvm-ar/Archive.h
@@ -152,7 +152,7 @@
/// be readable on entry to this method.
/// @returns true if an error occurred, false otherwise
/// @brief Replace contents of archive member with a new file.
- bool replaceWith(const sys::Path &aFile, std::string* ErrMsg);
+ bool replaceWith(StringRef aFile, std::string* ErrMsg);
/// @}
/// @name Data
@@ -266,10 +266,10 @@
/// the returned Archive object has at that time.
/// @returns An Archive* that represents the new archive file.
/// @brief Create an empty Archive.
- static Archive* CreateEmpty(
- const sys::Path& Filename,///< Name of the archive to (eventually) create.
- LLVMContext& C ///< Context to use for global information
- );
+ static Archive *CreateEmpty(
+ StringRef Filename, ///< Name of the archive to (eventually) create.
+ LLVMContext &C ///< Context to use for global information
+ );
/// Open an existing archive and load its contents in preparation for
/// editing. After this call, the member ilist is completely populated based
@@ -277,11 +277,11 @@
/// you intend to modify the archive or traverse its contents (e.g. for
/// printing).
/// @brief Open and load an archive file
- static Archive* OpenAndLoad(
- const sys::Path& filePath, ///< The file path to open and load
- LLVMContext& C, ///< The context to use for global information
- std::string* ErrorMessage ///< An optional error string
- );
+ static Archive *OpenAndLoad(
+ StringRef filePath, ///< The file path to open and load
+ LLVMContext &C, ///< The context to use for global information
+ std::string *ErrorMessage ///< An optional error string
+ );
/// This destructor cleans up the Archive object, releases all memory, and
/// closes files. It does nothing with the archive file on disk. If you
@@ -296,7 +296,7 @@
public:
/// @returns the path to the archive file.
/// @brief Get the archive path.
- const sys::Path& getPath() { return archPath; }
+ StringRef getPath() { return archPath; }
/// This method is provided so that editing methods can be invoked directly
/// on the Archive's iplist of ArchiveMember. However, it is recommended
@@ -405,11 +405,10 @@
/// given by \p where.
/// @returns true if an error occurred, false otherwise
/// @brief Add a file to the archive.
- bool addFileBefore(
- const sys::Path& filename, ///< The file to be added
- iterator where, ///< Insertion point
- std::string* ErrMsg ///< Optional error message location
- );
+ bool addFileBefore(StringRef filename, ///< The file to be added
+ iterator where, ///< Insertion point
+ std::string *ErrMsg ///< Optional error message location
+ );
/// @}
/// @name Implementation
@@ -417,7 +416,7 @@
protected:
/// @brief Construct an Archive for \p filename and optionally map it
/// into memory.
- explicit Archive(const sys::Path& filename, LLVMContext& C);
+ explicit Archive(StringRef filename, LLVMContext& C);
/// @returns A fully populated ArchiveMember or 0 if an error occurred.
/// @brief Parse the header of a member starting at \p At
@@ -477,7 +476,7 @@
/// @name Data
/// @{
protected:
- sys::Path archPath; ///< Path to the archive file we read/write
+ std::string archPath; ///< Path to the archive file we read/write
MembersList members; ///< The ilist of ArchiveMember
MemoryBuffer *mapfile; ///< Raw Archive contents mapped into memory
const char* base; ///< Base of the memory mapped file data