[cfe-dev] Missing service for CommentHandlers

Abramo Bagnara abramo.bagnara at gmail.com
Wed Jan 27 03:43:52 CST 2010


(Resent using another subscription, the other address seems to not find
its way to the list. Sorry for possible duplicates).

Recently it has been commited a patch to allow comment handlers to enter
token in the preprocessed stream, but AFAICT we lack the possibility for
handlers to know if the preprocessor is currently skipping an excluded
block.

Currently if the comment handler enter tokens also when preprocessor is
skipping, these token are not consumed by SkipExcludedConditionalBlock
and then will be read on exit of this function (obviously this is wrong).

We have some alternative way to cope with this problem:

1) make SkipExcludedConditionalBlock to consume also the tokens from
CurTokenLexer

2) set a flag in SkipExcludedConditionalBlock available in public
interface to make it know that currently Preprocessor is skipping an
excluded block

3) add a public method to PreprocessorLexer to consult conditional stack
and say if we are currently skipping an excluded block

I'm willing to write the patch, but I'd like to know which is the way
that clang gurus prefers before to contribute something unacceptable ;-)



More information about the cfe-dev mailing list