This is an archive of the discontinued LLVM Phabricator instance.

[libc] Move public assert to macro printing

Authored by michaelrj on Jul 25 2023, 2:30 PM.



The previous assert patch only changed the internal LIBC_ASSERT macro.
The public assert function also needs to be moved since the previous
printing method was removed. This patch refactors the display code into
a separate file so that it can safely be included by external code. This
isn't ideal, but passing the macros to functions turns them from literal
strings to char*s, requiring manual concatenation.

Diff Detail

Event Timeline

michaelrj created this revision.Jul 25 2023, 2:30 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 25 2023, 2:30 PM
michaelrj requested review of this revision.Jul 25 2023, 2:30 PM
alfredfo accepted this revision.Jul 25 2023, 4:21 PM
This revision is now accepted and ready to land.Jul 25 2023, 4:21 PM

Delaying landing this patch since I discovered that assert is one of the last macros still in headergen. I need to do more digging to sort that out.