aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/StackMaps.cpp
diff options
context:
space:
mode:
authorDanila Malyutin <danilaml@users.noreply.github.com>2024-01-20 01:44:00 +0400
committerGitHub <noreply@github.com>2024-01-20 00:44:00 +0300
commit0388ab3e29de843dea823b6ef0c6d0ccc56b0a16 (patch)
tree0c41946c81228267f6bd3da14948e61debc71075 /llvm/lib/CodeGen/StackMaps.cpp
parent5954b9dca21bb0c69b9e991b2ddb84c8b05ecba3 (diff)
downloadllvm-0388ab3e29de843dea823b6ef0c6d0ccc56b0a16.zip
llvm-0388ab3e29de843dea823b6ef0c6d0ccc56b0a16.tar.gz
llvm-0388ab3e29de843dea823b6ef0c6d0ccc56b0a16.tar.bz2
[Statepoint][NFC] Use uint16_t and add an assert (#78717)
Use a fixed width integer type and assert that DwarRegNum fits the 16 bits. This is a follow up to review comments on #78600.
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r--llvm/lib/CodeGen/StackMaps.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp
index f45bcaf..90aa93e 100644
--- a/llvm/lib/CodeGen/StackMaps.cpp
+++ b/llvm/lib/CodeGen/StackMaps.cpp
@@ -200,7 +200,7 @@ static unsigned getDwarfRegNum(unsigned Reg, const TargetRegisterInfo *TRI) {
break;
}
- assert(RegNum >= 0 && "Invalid Dwarf register number.");
+ assert(RegNum >= 0 && isUInt<16>(RegNum) && "Invalid Dwarf register number.");
return (unsigned)RegNum;
}