[all-commits] [llvm/llvm-project] 7d0cdb: [libTooling] Add `getFileRange` as an alternative ...

Eric Li via All-commits all-commits at lists.llvm.org
Thu Jan 12 14:44:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d0cdbf69edf5b14101d9c11fe9ca4cf5228e81d
      https://github.com/llvm/llvm-project/commit/7d0cdbf69edf5b14101d9c11fe9ca4cf5228e81d
  Author: Eric Li <li.zhe.hua at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M clang/include/clang/Tooling/Transformer/SourceCode.h
    M clang/lib/Tooling/Transformer/SourceCode.cpp

  Log Message:
  -----------
  [libTooling] Add `getFileRange` as an alternative to `getRangeForEdit`

Add a `getFileRange` function alongside the existing `getRangeForEdit`
as a way to get a contiguous range within a single file (similar to
`getRangeForEdit`) but without the restriction that it cannot be in a
system header.

This can be used where a tool may want to use the range to extract the
source text. In such cases, we don't want to restrict this from
pulling from system headers.

Differential Revision: https://reviews.llvm.org/D141634




More information about the All-commits mailing list