mirror of git://gcc.gnu.org/git/gcc.git
macro.c (enter_macro_context): Call cb.used callback if defined.
* macro.c (enter_macro_context): Call cb.used callback if defined. * directives.c (do_idef, do_ifndef): Ditto. * include/cpplib.h (struct cpp_callbacks): Add used callback. From-SVN: r154359
This commit is contained in:
parent
9f29c05e32
commit
3de8a540d8
|
|
@ -1,3 +1,9 @@
|
||||||
|
2009-11-20 Arnaud Charlet <charlet@adacore.com>
|
||||||
|
|
||||||
|
* macro.c (enter_macro_context): Call cb.used callback if defined.
|
||||||
|
* directives.c (do_idef, do_ifndef): Ditto.
|
||||||
|
* include/cpplib.h (struct cpp_callbacks): Add used callback.
|
||||||
|
|
||||||
2009-11-11 Kai Tietz <kai.tietz@onevision.com>
|
2009-11-11 Kai Tietz <kai.tietz@onevision.com>
|
||||||
|
|
||||||
* directives.c (do_pragma_push_macro): New pragma handler.
|
* directives.c (do_pragma_push_macro): New pragma handler.
|
||||||
|
|
|
||||||
|
|
@ -1808,6 +1808,8 @@ do_ifdef (cpp_reader *pfile)
|
||||||
pfile->cb.used_undef (pfile, pfile->directive_line, node);
|
pfile->cb.used_undef (pfile, pfile->directive_line, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (pfile->cb.used)
|
||||||
|
pfile->cb.used (pfile, pfile->directive_line, node);
|
||||||
check_eol (pfile, false);
|
check_eol (pfile, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1844,6 +1846,8 @@ do_ifndef (cpp_reader *pfile)
|
||||||
pfile->cb.used_undef (pfile, pfile->directive_line, node);
|
pfile->cb.used_undef (pfile, pfile->directive_line, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (pfile->cb.used)
|
||||||
|
pfile->cb.used (pfile, pfile->directive_line, node);
|
||||||
check_eol (pfile, false);
|
check_eol (pfile, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -508,6 +508,9 @@ struct cpp_callbacks
|
||||||
/* Called before #define and #undef or other macro definition
|
/* Called before #define and #undef or other macro definition
|
||||||
changes are processed. */
|
changes are processed. */
|
||||||
void (*before_define) (cpp_reader *);
|
void (*before_define) (cpp_reader *);
|
||||||
|
/* Called whenever a macro is expanded or tested.
|
||||||
|
Second argument is the location of the start of the current expansion. */
|
||||||
|
void (*used) (cpp_reader *, source_location, cpp_hashnode *);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
|
|
|
||||||
|
|
@ -885,6 +885,9 @@ enter_macro_context (cpp_reader *pfile, cpp_hashnode *node,
|
||||||
pfile->cb.used_define (pfile, pfile->directive_line, node);
|
pfile->cb.used_define (pfile, pfile->directive_line, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pfile->cb.used)
|
||||||
|
pfile->cb.used (pfile, result->src_loc, node);
|
||||||
|
|
||||||
macro->used = 1;
|
macro->used = 1;
|
||||||
|
|
||||||
if (macro->paramc == 0)
|
if (macro->paramc == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue