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

Richard via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 10:02:16 PST 2016


LegalizeAdulthood added a comment.

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

> I'm definitely sympathetic to making `StringLiteralParser` expose information [...]


I was unaware of this class; so far I have only studied the classes appearing in the AST.

I did notice that the AST shows string literals after concatenation (which makes perfect sense) and sometimes for refactoring you want to treat the individual string literal chunks separately.  My clang-tidy check for raw string literals is probably confused by literal concatenation in the AST, so I will go add some tests for those cases.

One area of clang-tidy/refactoring tooling code development that is pretty opaque at the moment is when you should dip down to relexing/reparsing the source text and when you use the AST.  So far most (all?) of the documentation on guiding developers to writing such tools talks almost exclusively about the AST.  Anything we can do to simplify lexing/parsing tasks when you need to dip lower than the AST would be most welcome.


http://reviews.llvm.org/D16012





More information about the cfe-commits mailing list