[clang] [clang][RISCV] Extend intrinsic size check variable from 16 -> 32 bits. NFC (PR #111481)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 22:05:33 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Brandon Wu (4vtomat)

<details>
<summary>Changes</summary>

We currently have over 67000 intrinsics, uint16_t will overflow.


---
Full diff: https://github.com/llvm/llvm-project/pull/111481.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaRISCV.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/Sema/SemaRISCV.cpp b/clang/lib/Sema/SemaRISCV.cpp
index 3da4b515b1b114..f49c2088ef4776 100644
--- a/clang/lib/Sema/SemaRISCV.cpp
+++ b/clang/lib/Sema/SemaRISCV.cpp
@@ -399,7 +399,7 @@ void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
                                      Record.HasFRMRoundModeOp);
 
   // Put into IntrinsicList.
-  uint16_t Index = IntrinsicList.size();
+  uint32_t Index = IntrinsicList.size();
   assert(IntrinsicList.size() == (size_t)Index &&
          "Intrinsics indices overflow.");
   IntrinsicList.push_back({BuiltinName, Signature});

``````````

</details>


https://github.com/llvm/llvm-project/pull/111481


More information about the cfe-commits mailing list