[PATCH] D37179: [ARM] Tidy-up condition-code support functions

Javed Absar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 27 12:28:45 PDT 2017


javed.absar added inline comments.


================
Comment at: lib/Target/ARM/Utils/ARMBaseInfo.h:51
+  switch (CC) {
+  default: llvm_unreachable("Unknown condition code");
+  case EQ: return NE;
----------------
javed.absar wrote:
> fhahn wrote:
> > While you are at it, would it make sense to remove the default case there and add the llvm_unreachable after the switch like in ARMCondCodeToString?
> > 
> > This would give the compiler a better chance to warn about missing patterns, but that's only a minor point, as it's unlikely that CondCodes will change.
> Thanks. Will do so.
Looking at it again, that does not seem a good idea. There is no 'OppositCondition' for 'AL' (Always). Taking out the default will just trigger sprurious compilation warning -  enumeration value 'AL' not handled in switch


https://reviews.llvm.org/D37179





More information about the llvm-commits mailing list