[libc-commits] [PATCH] D148069: [LIBC] Implement remainder of posix 'sched.h' minus `SCHED_SPORADIC`

Noah Goldstein via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 20 12:42:50 PDT 2023


goldstein.w.n marked 4 inline comments as done.
goldstein.w.n added inline comments.


================
Comment at: libc/spec/posix.td:646
             RetValSpec<IntType>,
             []
         >,
----------------
michaelrj wrote:
> goldstein.w.n wrote:
> > michaelrj wrote:
> > > not relevant for this patch, but in a future patch it would be good to add the argument `ArgSpect<VoidType>` here. In C a function with no arguments is interpreted as having unspecified parameters, whereas a function with an argument of `void` has no arguments.
> > +1, is there an issue we add it now (not supported), or just leave it as todo?
> > 
> > As an side, what are these files for? I've had bugs in them but libc compiled fine /tests ran.
> You can fix it now or leave a TODO and fix it in a followup patch, either works.
> 
> These files are used to generate the header files in fullbuild mode. We have a TableGen based utility called HeaderGen that takes in the `api.td` file for the platform you're building for. Then the `api.td` file includes these files in the `spec` folder. These files tell HeaderGen what the function prototypes for each function are, and which header file they go in. Then the `entrypoints.txt` and `headers.txt` files determine which functions and headers should be built for this specific platform. If you want to see the header files then build `libc-headers` and look in `build/projects/libc/include`, though make sure you've set `LLVM_LIBC_FULL_BUILD` to `ON` in your cmake. If you want to test that these work, then run the `libc-api-test` which uses the `PrototypeTestGen` (in `libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp`) to **generate** the **prototypes** for each function, then **test** that they match the implementation.
> not relevant for this patch, but in a future patch it would be good to add the argument `ArgSpect<VoidType>` here. In C a function with no arguments is interpreted as having unspecified parameters, whereas a function with an argument of `void` has no arguments.

Done for yield. Will do in the future.


================
Comment at: libc/spec/posix.td:646
             RetValSpec<IntType>,
             []
         >,
----------------
goldstein.w.n wrote:
> michaelrj wrote:
> > goldstein.w.n wrote:
> > > michaelrj wrote:
> > > > not relevant for this patch, but in a future patch it would be good to add the argument `ArgSpect<VoidType>` here. In C a function with no arguments is interpreted as having unspecified parameters, whereas a function with an argument of `void` has no arguments.
> > > +1, is there an issue we add it now (not supported), or just leave it as todo?
> > > 
> > > As an side, what are these files for? I've had bugs in them but libc compiled fine /tests ran.
> > You can fix it now or leave a TODO and fix it in a followup patch, either works.
> > 
> > These files are used to generate the header files in fullbuild mode. We have a TableGen based utility called HeaderGen that takes in the `api.td` file for the platform you're building for. Then the `api.td` file includes these files in the `spec` folder. These files tell HeaderGen what the function prototypes for each function are, and which header file they go in. Then the `entrypoints.txt` and `headers.txt` files determine which functions and headers should be built for this specific platform. If you want to see the header files then build `libc-headers` and look in `build/projects/libc/include`, though make sure you've set `LLVM_LIBC_FULL_BUILD` to `ON` in your cmake. If you want to test that these work, then run the `libc-api-test` which uses the `PrototypeTestGen` (in `libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp`) to **generate** the **prototypes** for each function, then **test** that they match the implementation.
> > not relevant for this patch, but in a future patch it would be good to add the argument `ArgSpect<VoidType>` here. In C a function with no arguments is interpreted as having unspecified parameters, whereas a function with an argument of `void` has no arguments.
> 
> Done for yield. Will do in the future.
> You can fix it now or leave a TODO and fix it in a followup patch, either works.
> 
> These files are used to generate the header files in fullbuild mode. We have a TableGen based utility called HeaderGen that takes in the `api.td` file for the platform you're building for. Then the `api.td` file includes these files in the `spec` folder. These files tell HeaderGen what the function prototypes for each function are, and which header file they go in. Then the `entrypoints.txt` and `headers.txt` files determine which functions and headers should be built for this specific platform. If you want to see the header files then build `libc-headers` and look in `build/projects/libc/include`, though make sure you've set `LLVM_LIBC_FULL_BUILD` to `ON` in your cmake. If you want to test that these work, then run the `libc-api-test` which uses the `PrototypeTestGen` (in `libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp`) to **generate** the **prototypes** for each function, then **test** that they match the implementation.

Ahh makes sense. Thanks :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148069



More information about the libc-commits mailing list