FixIt.cpp 1.0 KB

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