Page MenuHomePhabricator

[LIBC][NFC] Rename errno and assert files to match other files with functions
ClosedPublic

Authored by michaelrj on Nov 2 2020, 3:33 PM.

Details

Summary

Rename the files containing the __errno_location function
to __errno_location.h/cpp to match the other files and move
the llvmlibc_errno macro to its own file.

Split assert.h into __assert_fail.h (contains the function prototype)
and assert.h (contains the assert macro).

Diff Detail

Event Timeline

michaelrj created this revision.Nov 2 2020, 3:33 PM
michaelrj requested review of this revision.Nov 2 2020, 3:33 PM
michaelrj updated this revision to Diff 302612.Nov 3 2020, 10:26 AM

update the assert files to also match

michaelrj retitled this revision from [LIBC][NFC] Rename errno files to match other files with functions to [LIBC][NFC] Rename errno and assert files to match other files with functions.Nov 3 2020, 10:39 AM
michaelrj edited the summary of this revision. (Show Details)
michaelrj updated this revision to Diff 302629.Nov 3 2020, 10:57 AM

move the errno macro to its own file to match assert.

michaelrj edited the summary of this revision. (Show Details)Nov 3 2020, 10:58 AM
michaelrj updated this revision to Diff 302631.Nov 3 2020, 11:04 AM

fix missing newline at the end of a file.

sivachandra accepted this revision.Nov 3 2020, 11:05 AM
sivachandra added inline comments.
libc/src/assert/assert.h
8–11

Missing header guard.

libc/src/errno/llvmlibc_errno.h
8–11

Missing header guard.

19

Please fix.

This revision is now accepted and ready to land.Nov 3 2020, 11:05 AM
abrachet added inline comments.
libc/src/assert/assert.h
8–11

This is the intended behavior for assert.h which can be included multiple times with NDEBUG redefined.

sivachandra added inline comments.Nov 3 2020, 12:45 PM
libc/src/assert/assert.h
8–11

Ah, thanks for reminding. Ignore my comment then.

sivachandra added inline comments.Nov 3 2020, 12:51 PM
libc/src/assert/assert.h
8–11

@michaelrj, can you please add a comment explaining what @abrachet said?

michaelrj updated this revision to Diff 302673.Nov 3 2020, 1:27 PM
michaelrj marked 5 inline comments as done.

added header guard to llvmlibc_errno.h, and a comment on assert.h explaining the lack of header guard (thank you to abrachet).

This revision was landed with ongoing or failed builds.Nov 3 2020, 1:29 PM
This revision was automatically updated to reflect the committed changes.