mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Do not let GCC emit a warning for INT64_MIN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18398 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
33ce43e8a8
commit
40e7c35a2f
@ -536,13 +536,16 @@ void CWriter::printConstant(Constant *CPV) {
|
||||
Out << cast<ConstantSInt>(CPV)->getValue(); break;
|
||||
case Type::IntTyID:
|
||||
if ((int)cast<ConstantSInt>(CPV)->getValue() == (int)0x80000000)
|
||||
Out << "((int)0x80000000)"; // Handle MININT specially to avoid warning
|
||||
Out << "((int)0x80000000U)"; // Handle MININT specially to avoid warning
|
||||
else
|
||||
Out << cast<ConstantSInt>(CPV)->getValue();
|
||||
break;
|
||||
|
||||
case Type::LongTyID:
|
||||
Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; break;
|
||||
if (cast<ConstantSInt>(CPV)->isMinValue())
|
||||
Out << "(/*INT64_MIN*/(-9223372036854775807LL)-1)";
|
||||
else
|
||||
Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; break;
|
||||
|
||||
case Type::UByteTyID:
|
||||
case Type::UShortTyID:
|
||||
|
@ -536,13 +536,16 @@ void CWriter::printConstant(Constant *CPV) {
|
||||
Out << cast<ConstantSInt>(CPV)->getValue(); break;
|
||||
case Type::IntTyID:
|
||||
if ((int)cast<ConstantSInt>(CPV)->getValue() == (int)0x80000000)
|
||||
Out << "((int)0x80000000)"; // Handle MININT specially to avoid warning
|
||||
Out << "((int)0x80000000U)"; // Handle MININT specially to avoid warning
|
||||
else
|
||||
Out << cast<ConstantSInt>(CPV)->getValue();
|
||||
break;
|
||||
|
||||
case Type::LongTyID:
|
||||
Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; break;
|
||||
if (cast<ConstantSInt>(CPV)->isMinValue())
|
||||
Out << "(/*INT64_MIN*/(-9223372036854775807LL)-1)";
|
||||
else
|
||||
Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; break;
|
||||
|
||||
case Type::UByteTyID:
|
||||
case Type::UShortTyID:
|
||||
|
Loading…
Reference in New Issue
Block a user