[llvm] 786b491 - [Utils] Fix clang-tidy warning: Use boolean false, not 0 (NFC) (#99828)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 22:53:48 PDT 2024


Author: AtariDreams
Date: 2024-07-22T22:53:45-07:00
New Revision: 786b491ef40629ee6ccd9bf848710a38d734da8b

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

LOG: [Utils] Fix clang-tidy warning: Use boolean false, not 0 (NFC) (#99828)

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/DXILResource.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/DXILResource.cpp b/llvm/lib/Transforms/Utils/DXILResource.cpp
index bf45654a591b5..de2b6512a6d1c 100644
--- a/llvm/lib/Transforms/Utils/DXILResource.cpp
+++ b/llvm/lib/Transforms/Utils/DXILResource.cpp
@@ -329,8 +329,8 @@ std::pair<uint32_t, uint32_t> ResourceInfo::getAnnotateProps() const {
   uint32_t ResourceKind = llvm::to_underlying(Kind);
   uint32_t AlignLog2 = isStruct() ? Log2(Struct.Alignment) : 0;
   bool IsUAV = isUAV();
-  bool IsROV = IsUAV ? UAVFlags.IsROV : 0;
-  bool IsGloballyCoherent = IsUAV ? UAVFlags.GloballyCoherent : 0;
+  bool IsROV = IsUAV && UAVFlags.IsROV;
+  bool IsGloballyCoherent = IsUAV && UAVFlags.GloballyCoherent;
   uint8_t SamplerCmpOrHasCounter = 0;
   if (IsUAV)
     SamplerCmpOrHasCounter = UAVFlags.HasCounter;


        


More information about the llvm-commits mailing list