[PATCH] D42623: [clang-tidy] Add a Lexer util to get the source text of a statement

2018-02-13 Thread Tristan Bourvon via Phabricator via cfe-commits
tbourvon abandoned this revision. tbourvon added inline comments. Comment at: clang-tidy/utils/LexerUtils.h:26 +/// Get source code text for statement. +Optional getStmtText(const Stmt* Statement, const SourceManager& SM); + alexfh wrote: > aaron.ballman wrote:

[PATCH] D42623: [clang-tidy] Add a Lexer util to get the source text of a statement

2018-01-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/utils/LexerUtils.h:26 +/// Get source code text for statement. +Optional getStmtText(const Stmt* Statement, const SourceManager& SM); +

[PATCH] D42623: [clang-tidy] Add a Lexer util to get the source text of a statement

2018-01-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/utils/LexerUtils.cpp:39 +Optional getStmtText(const Stmt* Statement, const SourceManager& SM) { + if (!Statement) { +return llvm::NoneType(); You should elide the curly braces here. =

[PATCH] D42623: [clang-tidy] Add a Lexer util to get the source text of a statement

2018-01-28 Thread Tristan Bourvon via Phabricator via cfe-commits
tbourvon created this revision. tbourvon added a reviewer: lebedev.ri. tbourvon added a project: clang-tools-extra. Herald added subscribers: hintonda, xazax.hun, mgorny. This is a simple Lexer util to get the source text of a statement given as parameter. This is needed for https://reviews.llvm.