[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-15 Thread Louis Dionne via cfe-commits
ldionne wrote: This seems reasonable. I read the discussion about the size of the member but I think this is unlikely to change much -- plus I think the compiler should be able to diagnose in case the string becomes smaller and we'd be copying from a past-the-end location into the data structu

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-13 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Alexander Richardson via cfe-commits
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { // Create a mock exception object for force unwinding. _Unwind_Exception ex; memset(&ex, '\0', sizeof(ex)); - strcpy((char *)&ex.exception_class, "CLNGUNW"); + memcpy(&ex.exception_class, "CLN

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
michael-kenzel wrote: I found another use of the same string copying in `tests/forceunwind.pass.cpp` and updated that to match. https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel updated https://github.com/llvm/llvm-project/pull/72043 >From d5adc242a9c52c7de2a860489a4292b7461b6164 Mon Sep 17 00:00:00 2001 From: Michael Kenzel Date: Sun, 12 Nov 2023 02:46:15 +0100 Subject: [PATCH] [libunwind] Remove unnecessary strcpy dependency --- li

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { // Create a mock exception object for force unwinding. _Unwind_Exception ex; memset(&ex, '\0', sizeof(ex)); - strcpy((char *)&ex.exception_class, "CLNGUNW"); + memcpy(&ex.exception_class, "CLN

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-12 Thread Michael Kenzel via cfe-commits
michael-kenzel wrote: > I would assume this is already transformed to memcpy but I guess it won't be > for -O0 [I did some testing on this](https://godbolt.org/z/YMEjbxYd9): it seems that gcc replaces the `strcpy` with a simple `mov` even under `-O0`, but not the `memcpy`. clang does the reve

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Alexander Richardson via cfe-commits
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { // Create a mock exception object for force unwinding. _Unwind_Exception ex; memset(&ex, '\0', sizeof(ex)); - strcpy((char *)&ex.exception_class, "CLNGUNW"); + memcpy(&ex.exception_class, "CLN

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. I would assume this is already transformed to memcpy but I guess it won't be for -O0 https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel updated https://github.com/llvm/llvm-project/pull/72043 >From c423c5bd51bd7aa093025b2892706b1968eba09d Mon Sep 17 00:00:00 2001 From: Michael Kenzel Date: Sun, 12 Nov 2023 02:46:15 +0100 Subject: [PATCH] [libunwind] Remove unnecessary strcpy dependency --- li

[libunwind] [libunwind] remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libunwind Author: Michael Kenzel (michael-kenzel) Changes libunwind uses a minimum set of necessary standard library functions, basically just `memset` and `memcpy`. There is a single use of `strcpy` to copy the bytes `"CLNGUNW"` into a `uint64_t` obje

[libunwind] [libunwind] remove unnecessary strcpy dependency (PR #72043)

2023-11-11 Thread Michael Kenzel via cfe-commits
https://github.com/michael-kenzel created https://github.com/llvm/llvm-project/pull/72043 libunwind uses a minimum set of necessary standard library functions, basically just `memset` and `memcpy`. There is a single use of `strcpy` to copy the bytes `"CLNGUNW"` into a `uint64_t` object. This i