[cfe-dev] Getting preprocessed text between two source location.

Chris Lattner clattner at apple.com
Thu Feb 19 14:27:31 PST 2009


On Feb 19, 2009, at 1:15 PM, Paolo Bolzoni wrote:

> On Mon, 16 Feb 2009 21:51:30 +0100
> Paolo Bolzoni <bolzoni at cs.unipr.it> wrote:
>> dear cfe list,
>>
>> I need to get the preprocessed text between two source locations in  
>> order to
>> Lex again and check for code proprieties (e.g., in a const int  
>> declaration
>> see if it was actually `int const' or `const int')
>>
>> Thanks,
>> pb
>
> I am really stuck with this issue, there is really no way to get the
> unadorned text between two source locations?

Take a look at the token rewriter. lib/Rewrite/TokenRewriter.cpp

-Chris



More information about the cfe-dev mailing list