summaryrefslogtreecommitdiffstats
path: root/lib/Index/CommentToXML.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Index/CommentToXML.cpp')
-rw-r--r--lib/Index/CommentToXML.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Index/CommentToXML.cpp b/lib/Index/CommentToXML.cpp
index a67c806..ef6aeef 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);
}
OpenPOWER on IntegriCloud