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

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 12 14:28:26 PST 2023


ymandel accepted this revision.
ymandel added a comment.
This revision is now accepted and ready to land.

Can you add a test? probably valuable even if its nearly identical to the test for `getRangeForEdit`.



================
Comment at: clang/include/clang/Tooling/Transformer/SourceCode.h:120-126
+/// locations in macro expansions is supported. For example, if we're looking to
+/// rewrite the int literal 3 to 6, and we have the following definition:
+///    #define DO_NOTHING(x) x
+/// then
+///    foo(DO_NOTHING(3))
+/// will be rewritten to
+///    foo(6)
----------------
This description seems a bit out of place for this function, since it's explicitly *not* focused on the case of edits. Can this be rephrased?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141634/new/

https://reviews.llvm.org/D141634



More information about the cfe-commits mailing list