diff options
author | Siva Chandra Reddy <sivachandra@google.com> | 2022-11-01 06:18:12 +0000 |
---|---|---|
committer | Siva Chandra Reddy <sivachandra@google.com> | 2022-11-01 22:58:35 +0000 |
commit | 3b82b4fbd50ac15584ac88075f356f3ebf946515 (patch) | |
tree | 696ec354bdb5a6d0bb395ea9a4b6ba1d9154a917 /libc/spec | |
parent | eb877006a61733a87257c1c999f5a0b880ccf3cd (diff) | |
download | llvm-3b82b4fbd50ac15584ac88075f356f3ebf946515.tar.gz |
[libc] Add x86_64 implementation of setjmp and longjmp.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137147
Diffstat (limited to 'libc/spec')
-rw-r--r-- | libc/spec/stdc.td | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td index 1c0d7c2dd8d9..964b3e7c2733 100644 --- a/libc/spec/stdc.td +++ b/libc/spec/stdc.td @@ -9,6 +9,8 @@ def StdC : StandardSpec<"stdc"> { NamedType LDivTType = NamedType<"ldiv_t">; NamedType LLDivTType = NamedType<"lldiv_t">; + NamedType JmpBuf = NamedType<"jmp_buf">; + NamedType TssTType = NamedType<"tss_t">; PtrType TssTPtr = PtrType<TssTType>; NamedType TssDtorTType = NamedType<"tss_dtor_t">; @@ -988,6 +990,30 @@ def StdC : StandardSpec<"stdc"> { ] >; + HeaderSpec SetJmp = HeaderSpec< + "setjmp.h", + [], // Macros + [JmpBuf], + [], // Enumerations + [ + FunctionSpec< + "longjmp", + RetValSpec<NoReturn>, + [ArgSpec<JmpBuf>, ArgSpec<IntType>] + >, + FunctionSpec< + "setjmp", + RetValSpec<IntType>, + [ArgSpec<JmpBuf>] + >, + FunctionSpec< + "longjmp", + RetValSpec<VoidType>, + [ArgSpec<JmpBuf>, ArgSpec<IntType>] + >, + ] + >; + let Headers = [ Assert, CType, @@ -998,6 +1024,7 @@ def StdC : StandardSpec<"stdc"> { StdIO, StdLib, IntTypes, + SetJmp, Signal, Threads, Time, |