annotate clang/lib/Tooling/FixIt.cpp @ 176:de4ac79aef9d

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 17:13:11 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===--- FixIt.cpp - FixIt Hint utilities -----------------------*- C++ -*-===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8 //
anatofuz
parents:
diff changeset
9 // This file contains implementations of utitilies to ease source code rewriting
anatofuz
parents:
diff changeset
10 // by providing helper functions related to FixItHint.
anatofuz
parents:
diff changeset
11 //
anatofuz
parents:
diff changeset
12 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
13 #include "clang/Tooling/FixIt.h"
anatofuz
parents:
diff changeset
14 #include "clang/Lex/Lexer.h"
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 namespace clang {
anatofuz
parents:
diff changeset
17 namespace tooling {
anatofuz
parents:
diff changeset
18 namespace fixit {
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 namespace internal {
anatofuz
parents:
diff changeset
21 StringRef getText(CharSourceRange Range, const ASTContext &Context) {
anatofuz
parents:
diff changeset
22 return Lexer::getSourceText(Range, Context.getSourceManager(),
anatofuz
parents:
diff changeset
23 Context.getLangOpts());
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25 } // namespace internal
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 } // end namespace fixit
anatofuz
parents:
diff changeset
28 } // end namespace tooling
anatofuz
parents:
diff changeset
29 } // end namespace clang