From eed707b1e6097aac2bb6b3d47271f6300ace7f2e Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 24 Jul 2009 23:12:02 +0000 Subject: Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 01b3eb3bce..cf90c64ac6 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -877,7 +877,7 @@ bool BitcodeReader::ParseConstants() { case bitc::CST_CODE_INTEGER: // INTEGER: [intval] if (!isa(CurTy) || Record.empty()) return Error("Invalid CST_INTEGER record"); - V = Context.getConstantInt(CurTy, DecodeSignRotatedValue(Record[0])); + V = ConstantInt::get(CurTy, DecodeSignRotatedValue(Record[0])); break; case bitc::CST_CODE_WIDE_INTEGER: {// WIDE_INTEGER: [n x intval] if (!isa(CurTy) || Record.empty()) @@ -888,8 +888,9 @@ bool BitcodeReader::ParseConstants() { Words.resize(NumWords); for (unsigned i = 0; i != NumWords; ++i) Words[i] = DecodeSignRotatedValue(Record[i]); - V = Context.getConstantInt(APInt(cast(CurTy)->getBitWidth(), - NumWords, &Words[0])); + V = ConstantInt::get(Context, + APInt(cast(CurTy)->getBitWidth(), + NumWords, &Words[0])); break; } case bitc::CST_CODE_FLOAT: { // FLOAT: [fpval] @@ -951,7 +952,7 @@ bool BitcodeReader::ParseConstants() { unsigned Size = Record.size(); std::vector Elts; for (unsigned i = 0; i != Size; ++i) - Elts.push_back(Context.getConstantInt(EltTy, Record[i])); + Elts.push_back(ConstantInt::get(EltTy, Record[i])); V = Context.getConstantArray(ATy, Elts); break; } @@ -965,7 +966,7 @@ bool BitcodeReader::ParseConstants() { unsigned Size = Record.size(); std::vector Elts; for (unsigned i = 0; i != Size; ++i) - Elts.push_back(Context.getConstantInt(EltTy, Record[i])); + Elts.push_back(ConstantInt::get(EltTy, Record[i])); Elts.push_back(Context.getNullValue(EltTy)); V = Context.getConstantArray(ATy, Elts); break; -- cgit v1.2.3-18-g5258