Skip to content

Commit e3b22dc

Browse files
authored
[clang][RISCV] Extend intrinsic size check variable from 16 -> 32 bits. NFC (#111481)
We currently have over 67000 intrinsics, uint16_t will overflow.
1 parent 170dab9 commit e3b22dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Sema/SemaRISCV.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct RVVIntrinsicDef {
5050

5151
struct RVVOverloadIntrinsicDef {
5252
// Indexes of RISCVIntrinsicManagerImpl::IntrinsicList.
53-
SmallVector<uint16_t, 8> Indexes;
53+
SmallVector<uint32_t, 8> Indexes;
5454
};
5555

5656
} // namespace
@@ -169,7 +169,7 @@ class RISCVIntrinsicManagerImpl : public sema::RISCVIntrinsicManager {
169169
// List of all RVV intrinsic.
170170
std::vector<RVVIntrinsicDef> IntrinsicList;
171171
// Mapping function name to index of IntrinsicList.
172-
StringMap<uint16_t> Intrinsics;
172+
StringMap<uint32_t> Intrinsics;
173173
// Mapping function name to RVVOverloadIntrinsicDef.
174174
StringMap<RVVOverloadIntrinsicDef> OverloadIntrinsics;
175175

@@ -399,7 +399,7 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
399399
Record.HasFRMRoundModeOp);
400400

401401
// Put into IntrinsicList.
402-
uint16_t Index = IntrinsicList.size();
402+
uint32_t Index = IntrinsicList.size();
403403
assert(IntrinsicList.size() == (size_t)Index &&
404404
"Intrinsics indices overflow.");
405405
IntrinsicList.push_back({BuiltinName, Signature});

0 commit comments

Comments
 (0)