1*0b57cec5SDimitry Andric //===--- FixIt.cpp - FixIt Hint utilities -----------------------*- C++ -*-===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric // 9*0b57cec5SDimitry Andric // This file contains implementations of utitilies to ease source code rewriting 10*0b57cec5SDimitry Andric // by providing helper functions related to FixItHint. 11*0b57cec5SDimitry Andric // 12*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 13*0b57cec5SDimitry Andric #include "clang/Tooling/FixIt.h" 14*0b57cec5SDimitry Andric #include "clang/Lex/Lexer.h" 15*0b57cec5SDimitry Andric 16*0b57cec5SDimitry Andric namespace clang { 17*0b57cec5SDimitry Andric namespace tooling { 18*0b57cec5SDimitry Andric namespace fixit { 19*0b57cec5SDimitry Andric 20*0b57cec5SDimitry Andric namespace internal { getText(CharSourceRange Range,const ASTContext & Context)21*0b57cec5SDimitry AndricStringRef getText(CharSourceRange Range, const ASTContext &Context) { 22*0b57cec5SDimitry Andric return Lexer::getSourceText(Range, Context.getSourceManager(), 23*0b57cec5SDimitry Andric Context.getLangOpts()); 24*0b57cec5SDimitry Andric } 25*0b57cec5SDimitry Andric } // namespace internal 26*0b57cec5SDimitry Andric 27*0b57cec5SDimitry Andric } // end namespace fixit 28*0b57cec5SDimitry Andric } // end namespace tooling 29*0b57cec5SDimitry Andric } // end namespace clang 30