clang 20.0.0git
|
Determines which semicolons should be inserted during extraction. More...
#include "clang/Tooling/Refactoring/Extract/SourceExtraction.h"
Public Member Functions | |
bool | isNeededInExtractedFunction () const |
bool | isNeededInOriginalFunction () const |
Static Public Member Functions | |
static ExtractionSemicolonPolicy | compute (const Stmt *S, SourceRange &ExtractedRange, const SourceManager &SM, const LangOptions &LangOpts) |
Returns the semicolon insertion policy that is needed for extraction of the given statement from the given source range. | |
Determines which semicolons should be inserted during extraction.
Definition at line 24 of file SourceExtraction.h.
|
static |
Returns the semicolon insertion policy that is needed for extraction of the given statement from the given source range.
The extracted expression should be terminated with a ';'. The call to the extracted function will replace this expression, so it won't need a terminating ';'.
Some statements don't need to be terminated with ';'. The call to the extracted function will be a standalone statement, so it should be terminated with a ';'.
Some statements might end at ';'. The extraction will move that ';', so the call to the extracted function should be terminated with a ';'.
Other statements should generally have a trailing ';'. We can try to find it and move it together it with the extracted code.
Otherwise insert semicolons in both places.
Definition at line 73 of file SourceExtraction.cpp.
References clang::Lexer::findNextToken(), clang::SourceRange::getEnd(), clang::SourceRange::setEnd(), and SM.
|
inline |
Definition at line 26 of file SourceExtraction.h.
|
inline |
Definition at line 30 of file SourceExtraction.h.