summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2018-08-17 16:07:19 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2018-08-17 16:07:19 +0000
commit10f04917abbc42e3717d33d9b5079aa4f9eb9ac5 (patch)
treed1b399c099142510b8abea59d95c27a5dd4ecf58 /gcc
parentc5d725c0a8da3b2227d119871e881d8a6e1bf600 (diff)
downloadgcc-10f04917abbc42e3717d33d9b5079aa4f9eb9ac5.tar.gz
[PATCH] Macro body is trailing array
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01037.html * include/cpplib.h (enum cpp_macro_kind): New. (struct cpp_macro): Make body trailing array. Add kind field, delete traditional flag. * internal.h (_cpp_new_macro): Declare. (_cpp_reserve_room): New inline. (_cpp_commit_buf): Declare. (_cpp_create_trad_definition): Return new macro. * lex.c (_cpp_commit_buff): New. * macro.c (macro_real_token_count): Count backwards. (replace_args): Pointer equality not orderedness. (_cpp_save_parameter): Use _cpp_reserve_room. (alloc_expansion_token): Delete. (lex_expansion_token): Return macro pointer. Use _cpp_reserve_room. (create_iso_definition): Allocate macro itself. Adjust for different allocation ordering. (_cpp_new_macro): New. (_cpp_create_definition): Adjust for API changes. * traditional.c (push_replacement_text): Don't set traditional flag. (save_replacement_text): Likewise. (_cpp_create_trad_definition): Allocate macro itself, Adjust for different allocation ordering. From-SVN: r263622
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog2
-rw-r--r--gcc/c-family/c-ada-spec.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 93b1ba1478d..6ad2fe0122d 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,7 @@
2018-08-17 Nathan Sidwell <nathan@acm.org>
+ * c-ada-spec.c (macro_length, dump_ada_macros): Constify.
+
* c-ada-spec.c: Don't #include "cpp-id-data.h"
* c-cppbuiltin.c: Likewise.
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 0352932c039..4b21d71345a 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -88,7 +88,7 @@ macro_length (const cpp_macro *macro, int *supported, int *buffer_len,
for (j = 0; j < macro->count; j++)
{
- cpp_token *token = &macro->exp.tokens[j];
+ const cpp_token *token = &macro->exp.tokens[j];
if (token->flags & PREV_WHITE)
(*buffer_len)++;
@@ -274,7 +274,7 @@ dump_ada_macros (pretty_printer *pp, const char* file)
for (i = 0; supported && i < macro->count; i++)
{
- cpp_token *token = &macro->exp.tokens[i];
+ const cpp_token *token = &macro->exp.tokens[i];
int is_one = 0;
if (token->flags & PREV_WHITE)