[llvm] 9e415db - [CodeGen][DWARF][NFC] Add casts to a few asserts to avoid msvc warning. (#218386)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 04:17:18 PDT 2026
Author: Matt Davis
Date: 2026-08-26T07:17:13-04:00
New Revision: 9e415db40298b8735a9886389c85aedb49d2e5cd
URL: https://github.com/llvm/llvm-project/commit/9e415db40298b8735a9886389c85aedb49d2e5cd
DIFF: https://github.com/llvm/llvm-project/commit/9e415db40298b8735a9886389c85aedb49d2e5cd.diff
LOG: [CodeGen][DWARF][NFC] Add casts to a few asserts to avoid msvc warning. (#218386)
Fix some comparisons to correct the msvc warning: C4805: '==': unsafe
mix of type 'IntType' and type 'bool' in operation
Assisted-by: LLM.
Added:
Modified:
llvm/include/llvm/CodeGen/DIE.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/DIE.h b/llvm/include/llvm/CodeGen/DIE.h
index c01ea4cfedbae..bddbf9277cfbd 100644
--- a/llvm/include/llvm/CodeGen/DIE.h
+++ b/llvm/include/llvm/CodeGen/DIE.h
@@ -547,7 +547,8 @@ struct IntrusiveBackListBase {
void push_back(Node &N) {
assert(N.Next.getPointer() == &N && "Expected unlinked node");
- assert(N.Next.getInt() == true && "Expected unlinked node");
+ assert(static_cast<bool>(N.Next.getInt()) == true &&
+ "Expected unlinked node");
if (Last) {
N.Next = Last->Next;
@@ -558,7 +559,8 @@ struct IntrusiveBackListBase {
void push_front(Node &N) {
assert(N.Next.getPointer() == &N && "Expected unlinked node");
- assert(N.Next.getInt() == true && "Expected unlinked node");
+ assert(static_cast<bool>(N.Next.getInt()) == true &&
+ "Expected unlinked node");
if (Last) {
N.Next.setPointerAndInt(Last->Next.getPointer(), false);
More information about the llvm-commits
mailing list