1 //===--- FixIt.cpp - FixIt Hint utilities -----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains implementations of utitilies to ease source code rewriting
11 // by providing helper functions related to FixItHint.
13 //===----------------------------------------------------------------------===//
14 #include "clang/Tooling/FixIt.h"
15 #include "clang/Lex/Lexer.h"
22 StringRef getText(SourceRange Range, const ASTContext &Context) {
23 return Lexer::getSourceText(CharSourceRange::getTokenRange(Range),
24 Context.getSourceManager(),
25 Context.getLangOpts());
27 } // end namespace internal
29 } // end namespace fixit
30 } // end namespace tooling
31 } // end namespace clang