[cfe-commits] [PATCH] Make PreprocessorLexer's ConditionalStack available to clients

Magnus Reftel magnus.reftel at gmail.com
Tue Oct 19 00:54:30 PDT 2010


On 18 October 2010 16:46, Douglas Gregor <dgregor at apple.com> wrote:
> On Oct 14, 2010, at 12:01 AM, Magnus Reftel wrote:
>> I recently needed to inspect the conditional stack of the preprocessor
>> for a small tool I wrote that annotates source code. I think the
>> ability to see why the preprocessor is including/excluding a line
>> could be useful for others. Attached, please find a trivial patch that
>> adds a public accessor function for ConditionalStack. I would much
>> appreciate if this could be applied to the trunk.
> I'd rather not force a copy to access this data; so, I've added an iterator-based interface to the conditional stack in Clang r116703.

I agree that that's a better solution. Thanks for putting it in!

Magnus Reftel

More information about the cfe-commits mailing list