aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-04-16 01:03:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-04-16 01:03:33 +0000
commit10c8d9e63bcc96d55f788e7c08b72ce626c8aeec (patch)
tree724a8d54f22542ca0116eb3837f221a9ad5b57a8 /include/clang
parentb6385e84ab94550b9ccb458bf58746e1ed7413ac (diff)
Introduce Rewriter::IncreaseIndentation() which increase indentations for the lines between the given source range.
To determine what the indentation should be, a SourceLocation 'parentIndent' parameter is used that should be at a source location with an indentation one degree lower than the given range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Rewrite/Rewriter.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/clang/Rewrite/Rewriter.h b/include/clang/Rewrite/Rewriter.h
index 9513e67464..4ef5820ee3 100644
--- a/include/clang/Rewrite/Rewriter.h
+++ b/include/clang/Rewrite/Rewriter.h
@@ -246,7 +246,17 @@ public:
/// printer to generate the replacement code. This returns true if the input
/// could not be rewritten, or false if successful.
bool ReplaceStmt(Stmt *From, Stmt *To);
-
+
+ /// \brief Increase indentation for the lines between the given source range.
+ /// To determine what the indentation should be, 'parentIndent' is used
+ /// that should be at a source location with an indentation one degree
+ /// lower than the given range.
+ bool IncreaseIndentation(CharSourceRange range, SourceLocation parentIndent);
+ bool IncreaseIndentation(SourceRange range, SourceLocation parentIndent) {
+ return IncreaseIndentation(CharSourceRange::getTokenRange(range),
+ parentIndent);
+ }
+
/// ConvertToString converts statement 'From' to a string using the
/// pretty printer.
std::string ConvertToString(Stmt *From);