[llvm] [Support] Implement getMainExecutable for OpenBSD with getexecpath() (PR #220141)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 19:03:20 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions inc -- llvm/lib/Support/Unix/Path.inc --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 309bfb736..0da715279 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -125,11 +125,13 @@ namespace fs {
 
 const file_t kInvalidFile = -1;
 
-#if defined(__FreeBSD__) || defined(__NetBSD__) || (defined(__OpenBSD__) &&    \
-    !defined(HAVE_GETEXECPATH)) || defined(__FreeBSD_kernel__) ||              \
-    defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__) ||     \
-    defined(_AIX) || defined(__GNU__) || (defined(__sun__) &&                  \
-    defined(__svr4__) || defined(__HAIKU__)) || defined(__managarm__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) ||                             \
+    (defined(__OpenBSD__) && !defined(HAVE_GETEXECPATH)) ||                    \
+    defined(__FreeBSD_kernel__) || defined(__linux__) ||                       \
+    defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) ||          \
+    defined(__GNU__) ||                                                        \
+    (defined(__sun__) && defined(__svr4__) || defined(__HAIKU__)) ||           \
+    defined(__managarm__)
 static int test_dir(char ret[PATH_MAX], const char *dir, const char *bin) {
   struct stat sb;
   char fullpath[PATH_MAX];

``````````

</details>


https://github.com/llvm/llvm-project/pull/220141


More information about the llvm-commits mailing list