llvm.org GIT mirror llvm / 2359e51
avoid undefined behavior negating minint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110117 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
734734 Code = bitc::CST_CODE_UNDEF;
735735 } else if (const ConstantInt *IV = dyn_cast(C)) {
736736 if (IV->getBitWidth() <= 64) {
737 int64_t V = IV->getSExtValue();
738 if (V >= 0)
737 uint64_t V = IV->getSExtValue();
738 if ((int64_t)V >= 0)
739739 Record.push_back(V << 1);
740740 else
741741 Record.push_back((-V << 1) | 1);