diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-24 23:12:02 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-24 23:12:02 +0000 |
commit | eed707b1e6097aac2bb6b3d47271f6300ace7f2e (patch) | |
tree | c7390f63d90fc0c0ac483a90275863f41b69c085 /lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | e8530a3d8c940fb7710be7e25098b5c3b2c2de19 (diff) |
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
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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<IntegerType>(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<IntegerType>(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<IntegerType>(CurTy)->getBitWidth(), - NumWords, &Words[0])); + V = ConstantInt::get(Context, + APInt(cast<IntegerType>(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<Constant*> 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<Constant*> 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; |