This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add x86_64 implementation of setjmp and longjmp.
ClosedPublic

Authored by sivachandra on Nov 1 2022, 12:51 AM.

Diff Detail

Event Timeline

sivachandra created this revision.Nov 1 2022, 12:51 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 1 2022, 12:51 AM
sivachandra requested review of this revision.Nov 1 2022, 12:51 AM

overall LGTM with a few nits

libc/include/llvm-libc-types/jmp_buf.h
24

nit: "your"

libc/src/setjmp/longjmp.cpp
18

this function should be marked noreturn

29

nit: "stored"

sivachandra marked 2 inline comments as done.

Fix typos and improve the test.

libc/src/setjmp/longjmp.cpp
18

As far as the compiler frontend is concerned, it does not know that this function is actually noreturn. So, putting the noreturn attribute actually generates an error.

michaelrj accepted this revision.Nov 1 2022, 3:11 PM
This revision is now accepted and ready to land.Nov 1 2022, 3:11 PM