This is an archive of the discontinued LLVM Phabricator instance.

[clang][ExprConst] Add RHS source range to div by zero diags
ClosedPublic

Authored by tbaeder on Aug 4 2023, 12:08 AM.

Diff Detail

Event Timeline

tbaeder created this revision.Aug 4 2023, 12:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2023, 12:08 AM
tbaeder requested review of this revision.Aug 4 2023, 12:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2023, 12:08 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin added inline comments.Aug 4 2023, 2:32 AM
clang/lib/AST/ExprConstant.cpp
2831–2832

Why not just use E->getRHS()->getSourceRange() here? It avoids an extra param

tbaeder updated this revision to Diff 547145.Aug 4 2023, 2:39 AM
tbaeder marked an inline comment as done.
tbaeder added inline comments.
clang/lib/AST/ExprConstant.cpp
2831–2832

I thought there are cases where E is not a BinaryOperator, but that was wrong, thanks.

aaron.ballman added inline comments.Aug 4 2023, 12:14 PM
clang/lib/AST/ExprConstant.cpp
2808–2811

I think we should remove that parameter because it'd be pretty weird to pass in a binary operator and a different binary operator kind than the one used by the binary operator, right?

tbaeder updated this revision to Diff 547660.Aug 7 2023, 12:18 AM
tbaeder marked an inline comment as done.
tbaeder marked an inline comment as done.
cor3ntin accepted this revision.Aug 7 2023, 2:55 AM

Thanks!

This revision is now accepted and ready to land.Aug 7 2023, 2:55 AM
This revision was landed with ongoing or failed builds.Aug 8 2023, 9:07 AM
This revision was automatically updated to reflect the committed changes.