[llvm] r215243 - Remove dead code. Fixes pr20544.
Yaron Keren
yaron.keren at gmail.com
Sun Aug 10 05:00:26 PDT 2014
Hi Rafael,
Please see
http://llvm.org/viewvc/llvm-project?view=revision&revision=215290
If you can test on Linux without NormalizedPath logic, the whole code
section may be deleted.
Yaron
2014-08-09 0:35 GMT+03:00 Rafael Espindola <rafael.espindola at gmail.com>:
> Author: rafael
> Date: Fri Aug 8 16:35:52 2014
> New Revision: 215243
>
> URL: http://llvm.org/viewvc/llvm-project?rev=215243&view=rev
> Log:
> Remove dead code. Fixes pr20544.
>
> Modified:
> llvm/trunk/include/llvm/Support/FileSystem.h
> llvm/trunk/lib/Support/Unix/Path.inc
> llvm/trunk/lib/Support/Windows/Path.inc
> llvm/trunk/unittests/Support/Path.cpp
>
> Modified: llvm/trunk/include/llvm/Support/FileSystem.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=215243&r1=215242&r2=215243&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/FileSystem.h (original)
> +++ llvm/trunk/include/llvm/Support/FileSystem.h Fri Aug 8 16:35:52 2014
> @@ -276,14 +276,6 @@ private:
> /// platform-specific error_code.
> std::error_code make_absolute(SmallVectorImpl<char> &path);
>
> -/// @brief Normalize path separators in \a Path
> -///
> -/// If the path contains any '\' separators, they are transformed into
> '/'.
> -/// This is particularly useful when cross-compiling Windows on Linux,
> but is
> -/// safe to invoke on Windows, which accepts both characters as a path
> -/// separator.
> -std::error_code normalize_separators(SmallVectorImpl<char> &Path);
> -
> /// @brief Create all the non-existent directories in path.
> ///
> /// @param path Directories to create.
>
> Modified: llvm/trunk/lib/Support/Unix/Path.inc
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=215243&r1=215242&r2=215243&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Support/Unix/Path.inc (original)
> +++ llvm/trunk/lib/Support/Unix/Path.inc Fri Aug 8 16:35:52 2014
> @@ -272,19 +272,6 @@ std::error_code create_directory(const T
> return std::error_code();
> }
>
> -std::error_code normalize_separators(SmallVectorImpl<char> &Path) {
> - for (auto PI = Path.begin(), PE = Path.end(); PI < PE; ++PI) {
> - if (*PI == '\\') {
> - auto PN = PI + 1;
> - if (PN < PE && *PN == '\\')
> - ++PI; // increment once, the for loop will move over the escaped
> slash
> - else
> - *PI = '/';
> - }
> - }
> - return std::error_code();
> -}
> -
> // Note that we are using symbolic link because hard links are not
> supported by
> // all filesystems (SMB doesn't).
> std::error_code create_link(const Twine &to, const Twine &from) {
>
> Modified: llvm/trunk/lib/Support/Windows/Path.inc
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=215243&r1=215242&r2=215243&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Support/Windows/Path.inc (original)
> +++ llvm/trunk/lib/Support/Windows/Path.inc Fri Aug 8 16:35:52 2014
> @@ -163,11 +163,6 @@ std::error_code create_directory(const T
> return std::error_code();
> }
>
> -std::error_code normalize_separators(SmallVectorImpl<char> &Path) {
> - (void) Path;
> - return std::error_code();
> -}
> -
> // We can't use symbolic links for windows.
> std::error_code create_link(const Twine &to, const Twine &from) {
> // Get arguments.
>
> Modified: llvm/trunk/unittests/Support/Path.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=215243&r1=215242&r2=215243&view=diff
>
> ==============================================================================
> --- llvm/trunk/unittests/Support/Path.cpp (original)
> +++ llvm/trunk/unittests/Support/Path.cpp Fri Aug 8 16:35:52 2014
> @@ -640,22 +640,22 @@ TEST(Support, NormalizePath) {
> SmallString<64> Path5("\\a");
> SmallString<64> Path6("a\\");
>
> - ASSERT_NO_ERROR(fs::normalize_separators(Path1));
> + path::native(Path1);
> EXPECT_PATH_IS(Path1, "a", "a");
>
> - ASSERT_NO_ERROR(fs::normalize_separators(Path2));
> + path::native(Path2);
> EXPECT_PATH_IS(Path2, "a/b", "a/b");
>
> - ASSERT_NO_ERROR(fs::normalize_separators(Path3));
> + path::native(Path3);
> EXPECT_PATH_IS(Path3, "a\\b", "a/b");
>
> - ASSERT_NO_ERROR(fs::normalize_separators(Path4));
> + path::native(Path4);
> EXPECT_PATH_IS(Path4, "a\\\\b", "a\\\\b");
>
> - ASSERT_NO_ERROR(fs::normalize_separators(Path5));
> + path::native(Path5);
> EXPECT_PATH_IS(Path5, "\\a", "/a");
>
> - ASSERT_NO_ERROR(fs::normalize_separators(Path6));
> + path::native(Path6);
> EXPECT_PATH_IS(Path6, "a\\", "a/");
>
> #undef EXPECT_PATH_IS
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140810/8f6dd68d/attachment.html>
More information about the llvm-commits
mailing list