[clang-tools-extra] Allow specifying pipe syntax for use-ranges checks (PR #98696)

Nathan James via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 13 03:31:24 PDT 2024


================
@@ -166,6 +166,15 @@ utils::UseRangesCheck::ReplacerMap UseRangesCheck::getReplacerMap() const {
   return Result;
 }
 
+UseRangesCheck::UseRangesCheck(StringRef Name, ClangTidyContext *Context)
+    : utils::UseRangesCheck(Name, Context),
+      UseReversePipe(Options.get("UseReversePipe", false)) {}
----------------
njames93 wrote:

The issue with that is a downstream user who wants to implement this check for their library may not be able to support the alternative syntax.
The other way to get this behaviour would be a runtime parameter on the base class constructor to enable/disable the option. But that didn't sit right with me.

https://github.com/llvm/llvm-project/pull/98696


More information about the cfe-commits mailing list