diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /lib/Index/CommentToXML.cpp | |
parent | 30d791273d07fac9c0c1641a0731191bca6e8606 (diff) |
Notes
Diffstat (limited to 'lib/Index/CommentToXML.cpp')
-rw-r--r-- | lib/Index/CommentToXML.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Index/CommentToXML.cpp b/lib/Index/CommentToXML.cpp index a67c806550d83..ef6aeefa65261 100644 --- a/lib/Index/CommentToXML.cpp +++ b/lib/Index/CommentToXML.cpp @@ -15,7 +15,6 @@ #include "clang/AST/CommentVisitor.h" #include "clang/Format/Format.h" #include "clang/Index/USRGeneration.h" -#include "clang/Lex/Lexer.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/raw_ostream.h" @@ -609,14 +608,9 @@ void CommentASTToXMLConverter::formatTextOfDeclaration( .getLocWithOffset(0); unsigned Length = Declaration.size(); - std::vector<CharSourceRange> Ranges( - 1, CharSourceRange::getCharRange(Start, Start.getLocWithOffset(Length))); - ASTContext &Context = DI->CurrentDecl->getASTContext(); - const LangOptions &LangOpts = Context.getLangOpts(); - Lexer Lex(ID, FormatRewriterContext.Sources.getBuffer(ID), - FormatRewriterContext.Sources, LangOpts); tooling::Replacements Replace = reformat( - format::getLLVMStyle(), Lex, FormatRewriterContext.Sources, Ranges); + format::getLLVMStyle(), FormatRewriterContext.Sources, ID, + CharSourceRange::getCharRange(Start, Start.getLocWithOffset(Length))); applyAllReplacements(Replace, FormatRewriterContext.Rewrite); Declaration = FormatRewriterContext.getRewrittenText(ID); } |