[libc-commits] [PATCH] D153897: [libc][hdr-gen] Add special offloading handling for the GPU target
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Jun 27 18:52:07 PDT 2023
jhuber6 updated this revision to Diff 535212.
jhuber6 added a comment.
Herald added a subscriber: arphaman.
So, these headers need the ability to do some potentially ugly hacks. I have
added an extra field to the `PublicAPI` called `ExtraDefn`, which is currently a
simple string that we can use to inject some special-case handling for the
wrapper headers. In this case, we needed to define the `__atexithander_t` type
for the `atexit` function. In general this can be used as a general purpose shim
to address edge cases.
It's not pretty, but as I've stated I think this is the only sound solution to
this problem short of fully implementing the LLVM C library for both the host
and device.
The generated headers still pass the test suite as internally nothing has
changed. Externally, I can now safely include these headers inside OpenMP
without the prior errors.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153897/new/
https://reviews.llvm.org/D153897
Files:
libc/cmake/modules/LLVMLibCHeaderRules.cmake
libc/config/gpu/api.td
libc/config/public_api.td
libc/include/CMakeLists.txt
libc/include/llvm-libc-macros/CMakeLists.txt
libc/include/llvm-libc-macros/gpu-macros.h
libc/utils/HdrGen/BeginCommand.cpp
libc/utils/HdrGen/BeginCommand.h
libc/utils/HdrGen/EndCommand.cpp
libc/utils/HdrGen/EndCommand.h
libc/utils/HdrGen/Generator.cpp
libc/utils/HdrGen/Generator.h
libc/utils/HdrGen/Main.cpp
libc/utils/HdrGen/PublicAPICommand.cpp
libc/utils/HdrGen/PublicAPICommand.h
libc/utils/LibcTableGenUtil/APIIndexer.cpp
libc/utils/LibcTableGenUtil/APIIndexer.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153897.535212.patch
Type: text/x-patch
Size: 13337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230628/a0d6bfd9/attachment-0001.bin>
More information about the libc-commits
mailing list