[llvm] fix build error in MSVC build (PR #86622)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 20:11:00 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: None (SevenIsSeven)

<details>
<summary>Changes</summary>

This commit(https://github.com/llvm/llvm-project/pull/84738) introduced following compile warning then treated-as-error in MSVC build.

>>>"'^': unsafe mix of type 'unsigned int' and type 'bool' in operation"

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


1 Files Affected:

- (modified) llvm/include/llvm/IR/BasicBlock.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 0eea4cdccca5bb..ca87e40727c71d 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -791,7 +791,7 @@ template <> struct DenseMapInfo<BasicBlock::iterator> {
   static unsigned getHashValue(const BasicBlock::iterator &It) {
     return DenseMapInfo<void *>::getHashValue(
                reinterpret_cast<void *>(It.getNodePtr())) ^
-           It.getHeadBit();
+           (int) It.getHeadBit();
   }
 
   static bool isEqual(const BasicBlock::iterator &LHS,

``````````

</details>


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


More information about the llvm-commits mailing list