[PATCH] D141634: [libTooling] Add `getFileRange` as an alternative to `getRangeForEdit`

Eric Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 12 14:16:58 PST 2023


li.zhe.hua created this revision.
li.zhe.hua added a reviewer: ymandel.
Herald added a project: All.
li.zhe.hua requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141634

Files:
  clang/include/clang/Tooling/Transformer/SourceCode.h
  clang/lib/Tooling/Transformer/SourceCode.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141634.488772.patch
Type: text/x-patch
Size: 6333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230112/3397708d/attachment.bin>


More information about the cfe-commits mailing list