This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix conditions of assert in PPCAsmPrinter
ClosedPublic

Authored by jsji on Sep 27 2019, 8:00 PM.

Details

Summary

g++ build emits warning:

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:667:77: error: suggest parentheses around ?&&? within ?||? [-Werror=parentheses]

assert(MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() &&
                                                    ~~~~~~~~~~~~~~~~~~~~^~
       "Unexpected operand type for LWZtoc pseudo.");

I believe the intension is to assert all different types,
so we should add a parentheses to include all '||'.

Diff Detail

Repository
rL LLVM

Event Timeline

jsji created this revision.Sep 27 2019, 8:00 PM
Xiangling_L accepted this revision.Sep 28 2019, 6:13 PM

LGTM. Thank you Jinsong for putting up this patch. I found this warning as well, and I was planning to fix it in one of my PR which is also related to Sean's lowering work and will be landed in the future. But it's certainly nice to have this fixed earlier.

This revision is now accepted and ready to land.Sep 28 2019, 6:13 PM
This revision was automatically updated to reflect the committed changes.