[clang] Support target names with dots in more utilities (PR #65812)

2023-10-30 Thread Dan McGregor via cfe-commits
dankm wrote: Sounds good. Everything I want is in the pull request, I'm going to create a new pull request to update some tests as we discussed above. I'll update the description to be a bit more clear. Thanks for all help. https://github.com/llvm/llvm-project/pull/65812

[clang] Support target names with dots in more utilities (PR #65812)

2023-10-23 Thread James Henderson via cfe-commits
jh7370 wrote: I can merge it for you, but first I just want to confirm that all 4 commits in this PR are intended to be for the PR? If not, you'll need to rebase and force push. There's no need for you to manually squash the fixups (although you might as well if you do end up rebasing). When

[clang] Support target names with dots in more utilities (PR #65812)

2023-10-20 Thread Dan McGregor via cfe-commits
dankm wrote: Hm. I have "fixup" commits in this branch, should I rebase those, or can we squash merge as-is? https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Support target names with dots in more utilities (PR #65812)

2023-10-20 Thread Dan McGregor via cfe-commits
dankm wrote: No _good_ particular reason. I got hung up on the formatting issues then ran out of steam, and busy with $job. I just ran clang-format on this change and it came up clean. And now that I've done that the only reason I have left is I'm unable to merge my own changes. Would you

[clang] Support target names with dots in more utilities (PR #65812)

2023-10-19 Thread James Henderson via cfe-commits
jh7370 wrote: @dankm, is there a particular reason you haven't merged this change in yet? FWIW, the formatter check failed for some reason, but I'm not sure it's related to any formatting issue. Please verify by running clang-format on your changes before merging.

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-28 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812 >From 5f5e57a5c01088e7f0b9276ed02dd436a3f9cc0a Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH 1/4] Support: hoist lld's executable name code to Path Instead of

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-28 Thread via cfe-commits
https://github.com/dankm resolved https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-28 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812 >From 5f5e57a5c01088e7f0b9276ed02dd436a3f9cc0a Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH 1/3] Support: hoist lld's executable name code to Path Instead of

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-27 Thread via cfe-commits
@@ -1696,6 +1696,40 @@ TEST(Support, ReplacePathPrefix) { EXPECT_EQ(Path, "C:\\old/foo\\bar"); } +TEST(Support, FindProgramName) { + StringRef WindowsProgName = + path::program_name("C:\\Test\\foo.exe", path::Style::windows); + EXPECT_EQ(WindowsProgName, "foo"); + +

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-19 Thread James Henderson via cfe-commits
@@ -5,11 +5,14 @@ # RUN: mkdir %t # RUN: ln -s llvm-ranlib %t/llvm-ranlib-9 # RUN: ln -s llvm-ranlib %t/ranlib.exe +# RUN: ln -s llvm-ranlib %t/x86_64-unknown-freebsd13.2-llvm-ranlib jh7370 wrote: Let's put the new test files and deletion of this old test in

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-19 Thread James Henderson via cfe-commits
@@ -1696,6 +1696,40 @@ TEST(Support, ReplacePathPrefix) { EXPECT_EQ(Path, "C:\\old/foo\\bar"); } +TEST(Support, FindProgramName) { + StringRef WindowsProgName = + path::program_name("C:\\Test\\foo.exe", path::Style::windows); + EXPECT_EQ(WindowsProgName, "foo"); + +

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-19 Thread James Henderson via cfe-commits
https://github.com/jh7370 edited https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
https://github.com/dankm resolved https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812 >From 5f5e57a5c01088e7f0b9276ed02dd436a3f9cc0a Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH 1/2] Support: hoist lld's executable name code to Path Instead of

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
https://github.com/dankm resolved https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812 >From 4a30a862b41aa6c570b0dc4d1eb82a7feef4ed8e Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH 1/2] Support: hoist lld's executable name code to Path Instead of

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
@@ -5,11 +5,14 @@ # RUN: mkdir %t # RUN: ln -s llvm-ranlib %t/llvm-ranlib-9 # RUN: ln -s llvm-ranlib %t/ranlib.exe +# RUN: ln -s llvm-ranlib %t/x86_64-unknown-freebsd13.2-llvm-ranlib dankm wrote: Yep, your second point is why I didn't bother making the second

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
@@ -1696,6 +1696,38 @@ TEST(Support, ReplacePathPrefix) { EXPECT_EQ(Path, "C:\\old/foo\\bar"); } +TEST(Support, FindProgramName) { + StringRef WindowsProgName = + path::program_name("C:\\Test\\foo.exe", path::Style::windows); + EXPECT_EQ(WindowsProgName, "foo"); + +

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
dankm wrote: > Do any others exist on other platforms? I don't know. I explicitly tested that `.sh` remains, but that was just because it's relatively common (in my experience) to see tools like clang wrapped in a shell script. On Windows there are several executable extensions but I think

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread via cfe-commits
dankm wrote: > Just making sure I follow: the problem with `stem` is that if a filename > includes a dot, but no ".exe" or equivalent suffix, it would drop the bit > from the last dot onwards, even though it might be part of the tool's actual > name. Is that correct? Yes, that's correct. The

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread James Henderson via cfe-commits
@@ -1696,6 +1696,38 @@ TEST(Support, ReplacePathPrefix) { EXPECT_EQ(Path, "C:\\old/foo\\bar"); } +TEST(Support, FindProgramName) { + StringRef WindowsProgName = + path::program_name("C:\\Test\\foo.exe", path::Style::windows); + EXPECT_EQ(WindowsProgName, "foo"); + +

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread James Henderson via cfe-commits
@@ -600,6 +600,14 @@ StringRef extension(StringRef path, Style style) { return fname.substr(pos); } +StringRef program_name(StringRef path, Style style) { + // In the future this may need to be extended to other + // program suffixes. jh7370 wrote:

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread James Henderson via cfe-commits
@@ -390,6 +390,21 @@ StringRef stem(StringRef path, Style style = Style::native); /// @result The extension of \a path. StringRef extension(StringRef path, Style style = Style::native); +/// Get the program's name +/// +/// If the path ends with the string .exe, returns the

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-18 Thread James Henderson via cfe-commits
@@ -5,16 +5,22 @@ # RUN: mkdir %t # RUN: ln -s llvm-ar %t/llvm-ar-9 # RUN: ln -s llvm-ar %t/ar.exe +# RUN: ln -s llvm-ar %t/x86_64-portbld-freebsd13.2-llvm-ar +# RUN: ln -s llvm-ar %t/x86_64-portbld-freebsd13.2-llvm-ar.exe # RUN: ln -s llvm-ar

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-15 Thread Fangrui Song via cfe-commits
@@ -390,6 +390,21 @@ StringRef stem(StringRef path, Style style = Style::native); /// @result The extension of \a path. StringRef extension(StringRef path, Style style = Style::native); +/// Get the program's name +/// +/// If the path ends with the string .exe, returns the

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM, but @jh7370 usually wants to have an eye on such changes. https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-14 Thread via cfe-commits
dankm wrote: Hm. I'm happy with this file, but I also discovered a bunch of other `tool-name` tests that can be updated. I'll add those too. https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-14 Thread via cfe-commits
https://github.com/llvmbot labeled https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-14 Thread via cfe-commits
https://github.com/llvmbot labeled https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-14 Thread via cfe-commits
https://github.com/llvmbot labeled https://github.com/llvm/llvm-project/pull/65812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-14 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812: >From 416d75e617cc87b6e497815ce6ad1da630eb14a1 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH 1/2] Support: hoist lld's executable name code to Path Instead of

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-13 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812: >From a42cbcc0731725929c60ba4c1fd5254ae5e46613 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH] Support: hoist lld's executable name code to Path Instead of

[clang] Support target names with dots in more utilities (PR #65812)

2023-09-13 Thread via cfe-commits
https://github.com/dankm updated https://github.com/llvm/llvm-project/pull/65812: >From a42cbcc0731725929c60ba4c1fd5254ae5e46613 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Mon, 14 Aug 2023 18:44:08 -0600 Subject: [PATCH] Support: hoist lld's executable name code to Path Instead of