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

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 17:05:12 PDT 2024


Author: SevenIsSeven
Date: 2024-03-26T17:05:08-07:00
New Revision: c43932ebdc407ed9633f7468dcb061b635e99a8d

URL: https://github.com/llvm/llvm-project/commit/c43932ebdc407ed9633f7468dcb061b635e99a8d
DIFF: https://github.com/llvm/llvm-project/commit/c43932ebdc407ed9633f7468dcb061b635e99a8d.diff

LOG: fix build error in MSVC build (#86622)

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"

---------

Co-authored-by: Seven <Seven.Li at amd.com>

Added: 
    

Modified: 
    llvm/include/llvm/IR/BasicBlock.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 0eea4cdccca5bb..0c5a07bde4ecf0 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();
+           (unsigned)It.getHeadBit();
   }
 
   static bool isEqual(const BasicBlock::iterator &LHS,


        


More information about the llvm-commits mailing list