Move condition code support functions to Utils and remove code duplication.
Details
Diff Detail
Event Timeline
Thanks, LGTM.
This looks like a NFC to me and removes some unnecessary code duplication.
| lib/Target/ARM/Utils/ARMBaseInfo.h | ||
|---|---|---|
| 51 | 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. | |
| lib/Target/ARM/Utils/ARMBaseInfo.h | ||
|---|---|---|
| 51 | Thanks. Will do so. | |
| lib/Target/ARM/Utils/ARMBaseInfo.h | ||
|---|---|---|
| 51 | 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 | |
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.