This is an archive of the discontinued LLVM Phabricator instance.

Fix int to bool errors exposed due to r372612
ClosedPublic

Authored by rdhindsa on Sep 23 2019, 3:33 PM.

Details

Summary

Fix int to bool conversions exposed by r372612. ( Warn if '<<' in bool context with -Wint-in-bool-context (GCC compatibility))

Diff Detail

Event Timeline

rdhindsa created this revision.Sep 23 2019, 3:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 3:33 PM
xbolva00 accepted this revision.Sep 23 2019, 3:58 PM
This revision is now accepted and ready to land.Sep 23 2019, 3:58 PM
rupprecht added inline comments.Sep 23 2019, 4:00 PM
compiler-rt/lib/builtins/fp_add_impl.inc
97

nit: I think there is an extra unnecessary set of parens, e.g.

const bool sticky = (bSignificand << (typeWidth - align)) != 0;

(same for the other cases)

xbolva00 added inline comments.Sep 23 2019, 4:11 PM
compiler-rt/lib/builtins/fp_add_impl.inc
97

+1, yes, please fix them

rdhindsa updated this revision to Diff 221441.Sep 23 2019, 4:58 PM

Removed the extra parenthesis.

rdhindsa marked 2 inline comments as done.Sep 23 2019, 4:59 PM
Closed by commit rL372684 (authored by rdhindsa). · Explain WhySep 23 2019, 7:58 PM
This revision was automatically updated to reflect the committed changes.