From 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 18 Jan 2015 16:23:48 +0000 Subject: Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102 --- lib/Index/CommentToXML.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/Index/CommentToXML.cpp') 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 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); } -- cgit v1.2.3