[libc-commits] [PATCH] D153794: [libc][hdr-gen] Add a new 'include_header' command to control headers

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 27 05:33:44 PDT 2023


jhuber6 planned changes to this revision.
jhuber6 added a comment.

I'm realizing that a better but more invasive solution would be to have something like the following:

  %%begin()
  #include <__llvm_libc_common.h>
  %%end()
  
  %%public_api()

After trying to base my offloading support off of this I realized that several headers have non-trivial constructions, so what I really need is a hook to wrap around these and insert some GPU headers at the start. So it would look more like

  #include <llvm-libc-macros/gpu-macros.h>
  
  #ifdef __OFFLOADING
  #include_next <stdheader.h>
  #else
  #include <__llvm_libc_common.h>
  #endif
  
  #ifndef __OFFLOADING
  extern SomeType;
  #endif
  
  void some_entrypoint.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153794/new/

https://reviews.llvm.org/D153794



More information about the libc-commits mailing list