[PATCH] D131678: hicpp-signed-bitwise - Return location of the operand (and not of the operator beginning)

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 07:22:31 PDT 2022


njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp:100
                  "%select{binary|unary}0 bitwise operator")
-      << IsUnary << SignedOperand->getSourceRange();
+      << IsUnary << Location;
 }
----------------
Seems pretty useless to pass the begin location of the Unary/Binary operator here.
The only source locations that are of interest is the operator location and the whole range of the SignedOperand.
Based on the issues with jetbrains rendering, I also imagine clangd would have the same issue, We'd likely want to have the diag locations as the SignedOperand begin(like this patch). Then pass the whole source range of the signed operand(like it currently is).
I'm either way on whether we would need to pass the location of the operator `(BinaryOp|UnaryOp)->getOperatorLoc()`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131678



More information about the cfe-commits mailing list