Skip to content

Commit ed7d6c3

Browse files
[ADT] Deprecate a soft-deprecated APInt constructor (llvm#166314)
This patch deprecates an APInt constructor that has been soft-deprecated via comments since: commit 7a16288 Author: Jeffrey Yasskin <[email protected]> Date: Mon Jul 18 21:45:40 2011 +0000 This patch updates a small number of remaining uses.
1 parent 4749bf5 commit ed7d6c3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lldb/source/Utility/RegisterValue.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Status RegisterValue::SetValueFromData(const RegisterInfo &reg_info,
206206
int128.x[0] = data2;
207207
int128.x[1] = data1;
208208
}
209-
SetUInt128(llvm::APInt(128, 2, int128.x));
209+
SetUInt128(llvm::APInt(128, int128.x));
210210
}
211211
break;
212212
case eEncodingIEEE754:
@@ -596,8 +596,10 @@ llvm::APInt RegisterValue::GetAsUInt128(const llvm::APInt &fail_value,
596596
case 8:
597597
case 16:
598598
return llvm::APInt(
599-
BITWIDTH_INT128, NUM_OF_WORDS_INT128,
600-
(reinterpret_cast<const type128 *>(buffer.bytes.data()))->x);
599+
BITWIDTH_INT128,
600+
llvm::ArrayRef(
601+
(reinterpret_cast<const type128 *>(buffer.bytes.data()))->x,
602+
NUM_OF_WORDS_INT128));
601603
}
602604
} break;
603605
}

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class [[nodiscard]] APInt {
154154
/// Once all uses of this constructor are migrated to other constructors,
155155
/// consider marking this overload ""= delete" to prevent calls from being
156156
/// incorrectly bound to the APInt(unsigned, uint64_t, bool) constructor.
157+
[[deprecated("Use other constructors of APInt")]]
157158
LLVM_ABI APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
158159

159160
/// Construct an APInt from a string representation.

polly/lib/Support/GICHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ APInt polly::APIntFromVal(__isl_take isl_val *Val) {
5959
Data = (uint64_t *)malloc(NumChunks * ChunkSize);
6060
isl_val_get_abs_num_chunks(Val, ChunkSize, Data);
6161
int NumBits = CHAR_BIT * ChunkSize * NumChunks;
62-
APInt A(NumBits, NumChunks, Data);
62+
APInt A(NumBits, ArrayRef(Data, NumChunks));
6363

6464
// As isl provides only an interface to obtain data that describes the
6565
// absolute value of an isl_val, A at this point always contains a positive

0 commit comments

Comments
 (0)