X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FPathV1.h;h=643ee8c6c1d0aa8b83775cfeaad2d462a020a3be;hb=5df15c692b944b6c46ec6d532fc286b7e0000d5d;hp=818b32964eea173b1229fa29071850990540de08;hpb=b3127bb06a9b2a95a587bbe555c2ea0d83e4eaba;p=oota-llvm.git diff --git a/include/llvm/Support/PathV1.h b/include/llvm/Support/PathV1.h index 818b32964ee..643ee8c6c1d 100644 --- a/include/llvm/Support/PathV1.h +++ b/include/llvm/Support/PathV1.h @@ -21,8 +21,10 @@ #include #include -#define LLVMV_PATH_DEPRECATED_MSG \ - "PathV1 is being deprecated, please use the PathV2 API." +#define LLVM_PATH_DEPRECATED_MSG(replacement) \ + "PathV1 has been deprecated and will be removed as soon as all LLVM and" \ + " Clang clients have been moved over to PathV2. Please use `" #replacement \ + "` from PathV2 instead." namespace llvm { namespace sys { @@ -96,7 +98,8 @@ namespace sys { /// it is file:///. Other operating systems may have different notions of /// what the root directory is or none at all. In that case, a consistent /// default root directory will be used. - static Path GetRootDirectory(); + LLVM_ATTRIBUTE_DEPRECATED(static Path GetRootDirectory(), + LLVM_PATH_DEPRECATED_MSG(NOTHING)); /// Construct a path to a unique temporary directory that is created in /// a "standard" place for the operating system. The directory is @@ -104,7 +107,7 @@ namespace sys { /// cannot be created, the function will throw an exception. /// @returns an invalid path (empty) on error /// @param ErrMsg Optional place for an error message if an error occurs - /// @brief Constrct a path to an new, unique, existing temporary + /// @brief Construct a path to an new, unique, existing temporary /// directory. static Path GetTemporaryDirectory(std::string* ErrMsg = 0); @@ -128,20 +131,6 @@ namespace sys { /// @brief Find a library. static Path FindLibrary(std::string& short_name); - /// Construct a path to the default LLVM configuration directory. The - /// implementation must ensure that this is a well-known (same on many - /// systems) directory in which llvm configuration files exist. For - /// example, on Unix, the /etc/llvm directory has been selected. - /// @brief Construct a path to the default LLVM configuration directory - static Path GetLLVMDefaultConfigDir(); - - /// Construct a path to the LLVM installed configuration directory. The - /// implementation must ensure that this refers to the "etc" directory of - /// the LLVM installation. This is the location where configuration files - /// will be located for a particular installation of LLVM on a machine. - /// @brief Construct a path to the LLVM installed configuration directory - static Path GetLLVMConfigDir(); - /// Construct a path to the current user's home directory. The /// implementation must use an operating system specific mechanism for /// determining the user's home directory. For example, the environment @@ -258,25 +247,27 @@ namespace sys { bool isEmpty() const { return path.empty(); } /// This function returns the last component of the path name. The last - /// component is the file or directory name occuring after the last + /// component is the file or directory name occurring after the last /// directory separator. If no directory separator is present, the entire /// path name is returned (i.e. same as toString). /// @returns StringRef containing the last component of the path name. /// @brief Returns the last component of the path name. LLVM_ATTRIBUTE_DEPRECATED( StringRef getLast() const, - LLVMV_PATH_DEPRECATED_MSG); + LLVM_PATH_DEPRECATED_MSG(path::filename)); /// This function strips off the path and suffix of the file or directory /// name and returns just the basename. For example /a/foo.bar would cause /// this function to return "foo". /// @returns StringRef containing the basename of the path /// @brief Get the base name of the path - StringRef getBasename() const; + LLVM_ATTRIBUTE_DEPRECATED(StringRef getBasename() const, + LLVM_PATH_DEPRECATED_MSG(path::stem)); /// This function strips off the suffix of the path beginning with the /// path separator ('/' on Unix, '\' on Windows) and returns the result. - StringRef getDirname() const; + LLVM_ATTRIBUTE_DEPRECATED(StringRef getDirname() const, + LLVM_PATH_DEPRECATED_MSG(path::parent_path)); /// This function strips off the path and basename(up to and /// including the last dot) of the file or directory name and @@ -284,7 +275,8 @@ namespace sys { /// this function to return "bar". /// @returns StringRef containing the suffix of the path /// @brief Get the suffix of the path - StringRef getSuffix() const; + LLVM_ATTRIBUTE_DEPRECATED(StringRef getSuffix() const, + LLVM_PATH_DEPRECATED_MSG(path::extension)); /// Obtain a 'C' string for the path name. /// @returns a 'C' string containing the path name. @@ -308,14 +300,14 @@ namespace sys { /// @brief Determine if the path is absolute. LLVM_ATTRIBUTE_DEPRECATED( bool isAbsolute() const, - LLVMV_PATH_DEPRECATED_MSG); + LLVM_PATH_DEPRECATED_MSG(path::is_absolute)); /// This function determines if the path name is absolute, as opposed to /// relative. /// @brief Determine if the path is absolute. LLVM_ATTRIBUTE_DEPRECATED( static bool isAbsolute(const char *NameStart, unsigned NameLen), - LLVMV_PATH_DEPRECATED_MSG); + LLVM_PATH_DEPRECATED_MSG(path::is_absolute)); /// This function opens the file associated with the path name provided by /// the Path object and reads its magic number. If the magic number at the @@ -323,7 +315,8 @@ namespace sys { /// cases (file not found, file not accessible, etc.) it returns false. /// @returns true if the magic number of the file matches \p magic. /// @brief Determine if file has a specific magic number - bool hasMagicNumber(StringRef magic) const; + LLVM_ATTRIBUTE_DEPRECATED(bool hasMagicNumber(StringRef magic) const, + LLVM_PATH_DEPRECATED_MSG(fs::has_magic)); /// This function retrieves the first \p len bytes of the file associated /// with \p this. These bytes are returned as the "magic number" in the @@ -373,19 +366,22 @@ namespace sys { /// directory. /// @brief Determines if the path is a file or directory in /// the file system. - bool exists() const; + LLVM_ATTRIBUTE_DEPRECATED(bool exists() const, + LLVM_PATH_DEPRECATED_MSG(fs::exists)); /// This function determines if the path name references an /// existing directory. /// @returns true if the pathname references an existing directory. /// @brief Determines if the path is a directory in the file system. - bool isDirectory() const; + LLVM_ATTRIBUTE_DEPRECATED(bool isDirectory() const, + LLVM_PATH_DEPRECATED_MSG(fs::is_directory)); /// This function determines if the path name references an /// existing symbolic link. /// @returns true if the pathname references an existing symlink. /// @brief Determines if the path is a symlink in the file system. - bool isSymLink() const; + LLVM_ATTRIBUTE_DEPRECATED(bool isSymLink() const, + LLVM_PATH_DEPRECATED_MSG(fs::is_symlink)); /// This function determines if the path name references a readable file /// or directory in the file system. This function checks for @@ -489,7 +485,9 @@ namespace sys { /// The current Path name is made absolute by prepending the /// current working directory if necessary. - void makeAbsolute(); + LLVM_ATTRIBUTE_DEPRECATED( + void makeAbsolute(), + LLVM_PATH_DEPRECATED_MSG(fs::make_absolute)); /// @} /// @name Disk Mutators @@ -596,14 +594,15 @@ namespace sys { /// /// This API is not intended for general use, clients should use /// MemoryBuffer::getFile instead. - static const char *MapInFilePages(int FD, uint64_t FileSize); + static const char *MapInFilePages(int FD, size_t FileSize, + off_t Offset); /// UnMapFilePages - Free pages mapped into the current process by /// MapInFilePages. /// /// This API is not intended for general use, clients should use /// MemoryBuffer::getFile instead. - static void UnMapFilePages(const char *Base, uint64_t FileSize); + static void UnMapFilePages(const char *Base, size_t FileSize); /// @} /// @name Data @@ -621,7 +620,7 @@ namespace sys { /// efficiency. First, the file status requires additional space and the space /// is incorporated directly into PathWithStatus without an additional malloc. /// Second, obtaining status information is an expensive operation on most - /// operating systems so we want to be careful and explicity about where we + /// operating systems so we want to be careful and explicit about where we /// allow this operation in LLVM. /// @brief Path with file status class. class PathWithStatus : public Path { @@ -684,8 +683,8 @@ namespace sys { /// This function returns status information about the file. The type of /// path (file or directory) is updated to reflect the actual contents /// of the file system. - /// @returns 0 on failure, with Error explaining why (if non-zero) - /// @returns a pointer to a FileStatus structure on success. + /// @returns 0 on failure, with Error explaining why (if non-zero), + /// otherwise returns a pointer to a FileStatus structure on success. /// @brief Get file status. const FileStatus *getFileStatus( bool forceUpdate = false, ///< Force an update from the file system @@ -720,6 +719,7 @@ namespace sys { Mach_O_DynamicLinker_FileType, ///< The Mach-O dynamic linker Mach_O_Bundle_FileType, ///< Mach-O Bundle file Mach_O_DynamicallyLinkedSharedLibStub_FileType, ///< Mach-O Shared lib stub + Mach_O_DSYMCompanion_FileType, ///< Mach-O dSYM companion file COFF_FileType ///< COFF object file or lib };