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