diff options
Diffstat (limited to 'include/llvm/TableGen')
-rw-r--r-- | include/llvm/TableGen/Record.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index 5bf4f4fc5d..e17cddd9af 100644 --- a/include/llvm/TableGen/Record.h +++ b/include/llvm/TableGen/Record.h @@ -1798,10 +1798,12 @@ struct LessRecordRegister { return LHSPart.second.size() < RHSPart.second.size(); unsigned LHSVal, RHSVal; - if (LHSPart.second.getAsInteger(10, LHSVal)) - assert(0 && "Unable to convert LHS to integer."); - if (RHSPart.second.getAsInteger(10, RHSVal)) - assert(0 && "Unable to convert RHS to integer."); + + bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed; + assert(!LHSFailed && "Unable to convert LHS to integer."); + bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed; + assert(!RHSFailed && "Unable to convert RHS to integer."); + if (LHSVal != RHSVal) return LHSVal < RHSVal; } |