[llvm] 53ce850 - [Bitcode] Use ConstantInt::getSigned()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 07:05:50 PST 2025


Author: Nikita Popov
Date: 2025-12-09T16:02:47+01:00
New Revision: 53ce8502c6cfb7058c89f9e38f75934cab765eea

URL: https://github.com/llvm/llvm-project/commit/53ce8502c6cfb7058c89f9e38f75934cab765eea
DIFF: https://github.com/llvm/llvm-project/commit/53ce8502c6cfb7058c89f9e38f75934cab765eea.diff

LOG: [Bitcode] Use ConstantInt::getSigned()

This is encoded as a signed value, so use getSigned().

Added: 
    

Modified: 
    llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 90e6ffbf8992b..9dd993f0dc173 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3302,7 +3302,7 @@ Error BitcodeReader::parseConstants() {
     case bitc::CST_CODE_INTEGER:   // INTEGER: [intval]
       if (!CurTy->isIntOrIntVectorTy() || Record.empty())
         return error("Invalid integer const record");
-      V = ConstantInt::get(CurTy, decodeSignRotatedValue(Record[0]));
+      V = ConstantInt::getSigned(CurTy, decodeSignRotatedValue(Record[0]));
       break;
     case bitc::CST_CODE_WIDE_INTEGER: {// WIDE_INTEGER: [n x intval]
       if (!CurTy->isIntOrIntVectorTy() || Record.empty())


        


More information about the llvm-commits mailing list