[PATCH] #assert becomes macro-like

Nathan Sidwell nathan@acm.org
Mon Aug 20 12:38:00 GMT 2018


The preprocessor has cpp-asserts, a deprecated extension.  They look 
like macros in that they have a tokenized body, but there's a chain of 
them hanging off an assert node, rather than having any parms.

This patch removes their 'answer' struct, and extends cpp_macro to 
represent them.  the enum macro_kind gains a value, and the parameter 
pointer is now held in a union keyed off the macro kind.

The hashnode value union still contains 'answer' and 'macro' fields, 
even though they have the same underlying type.  Clean up of that union 
will happen later.

The remaining changes are mechanical (the answer struct already used the 
trailing array hack for the tokens, so drops straight into the update 
cpp_macro representation).

booted & tested on x86_64-linux, committing to trunk.

nathan
-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mac-ass.diff
Type: text/x-patch
Size: 18539 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180820/ec9be6ec/attachment.bin>


More information about the Gcc-patches mailing list