Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] move pthread macros to a dedicated header #88997

Open
nickdesaulniers opened this issue Apr 16, 2024 · 6 comments
Open

[libc] move pthread macros to a dedicated header #88997

nickdesaulniers opened this issue Apr 16, 2024 · 6 comments
Assignees

Comments

@nickdesaulniers
Copy link
Member

Forked from #88987 (comment)

The macros defined in libc/include/pthread.h.def should be moved to a corresponding libc/include/llvm-libc-macros/pthreads-macros.h (unless these values are linux specific, in which case perhaps they should go in a newly created libc/include/llvm-libc-macros/linux/pthreads-macros.h).

@nickdesaulniers nickdesaulniers added good first issue https://github.com/llvm/llvm-project/contribute code-cleanup libc labels Apr 16, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 16, 2024

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor has already been assigned to this issue. If you believe that no one is actually working on it despite an assignment, ping the person. After one week without a response, the assignee may be changed.
  2. In the comments of this issue, request for it to be assigned to you, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 16, 2024

@llvm/issue-subscribers-good-first-issue

Author: Nick Desaulniers (nickdesaulniers)

Forked from https://github.com//pull/88987#discussion_r1567968097

The macros defined in libc/include/pthread.h.def should be moved to a corresponding libc/include/llvm-libc-macros/pthreads-macros.h (unless these values are linux specific, in which case perhaps they should go in a newly created libc/include/llvm-libc-macros/linux/pthreads-macros.h).

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 16, 2024

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Forked from https://github.com//pull/88987#discussion_r1567968097

The macros defined in libc/include/pthread.h.def should be moved to a corresponding libc/include/llvm-libc-macros/pthreads-macros.h (unless these values are linux specific, in which case perhaps they should go in a newly created libc/include/llvm-libc-macros/linux/pthreads-macros.h).

nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Apr 16, 2024
@fabricerenard12
Copy link

Hi, if no one is working on this already I'd be glad to do it.

@nickdesaulniers
Copy link
Member Author

You can do it @fabricerenard12 !

So a convention we have throughout most of the codebase is that:

  • libc/include/stdbit.h.def doesn't declare any macros, but instead it includes
  • libc/include/llvm-libc-macros/stdbit-macros.h

This allows us to simply include include/llvm-libc-macros/stdbit-macros.h to test just the macros separate from the rest of the header. So in this case, the macros defined in libc/include/pthread.h.def should be moved to a new header libc/include/llvm-libc-macros/pthreads-macros.h. Don't forget to update:

  • libc/include/CMakeLists.txt
  • libc/include/llvm-libc-macros/CMakeLists.txt

@nickdesaulniers nickdesaulniers removed the good first issue https://github.com/llvm/llvm-project/contribute label Apr 17, 2024
nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Apr 18, 2024
- use namespaced identifiers
- add corresponding headers for namespaced declarations
- replace time.h and errno.h with finer grain includes
- update cmake

Fixes: llvm#88987
Fixes: llvm#89261
Link: llvm#88997
Link: llvm#89262
nickdesaulniers added a commit that referenced this issue Apr 19, 2024
- use namespaced identifiers
- add corresponding headers for namespaced declarations
- replace time.h and errno.h with finer grain includes
- update cmake

Fixes: #88987
Fixes: #89261
Link: #88997
Link: #89262
aniplcc pushed a commit to aniplcc/llvm-project that referenced this issue Apr 21, 2024
- use namespaced identifiers
- add corresponding headers for namespaced declarations
- replace time.h and errno.h with finer grain includes
- update cmake

Fixes: llvm#88987
Fixes: llvm#89261
Link: llvm#88997
Link: llvm#89262
@HendrikHuebner
Copy link
Contributor

@fabricerenard12 are you still working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants