[PATCH] D16012: Carry raw string literal information through to the AST StringLiteral representation

Richard via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 12:01:04 PST 2016

LegalizeAdulthood added a subscriber: LegalizeAdulthood.
LegalizeAdulthood added a comment.

In http://reviews.llvm.org/D16012#337208, @rsmith wrote:

> What's the benefit of storing this? You can get the same effect by
>  re-lexing. We don't guarantee that the pretty printed version of the AST
>  comprises the same sequence of tokens in general.

In writing clang-tidy checks, I've had to do re-lexing a number of times and personally I find it to be a complete PITA and very easy to get wrong, plus it results in many review iterations because of all the ways that StringRef enters the picture, whether you're using the plain lexer or the raw lexer, SourceRange or CharSourceRange, yadda yadda yadda.

I thought the whole point of the AST was to do this work **once** and store the results of the work for tools.


More information about the cfe-commits mailing list