[llvm] 52e8679 - [IR] Remove unnecessary uint64_t casts (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 13:20:44 PDT 2020


Author: Nikita Popov
Date: 2020-06-23T22:20:15+02:00
New Revision: 52e86797ba687d89a2e9a85c135b7145a5f14739

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

LOG: [IR] Remove unnecessary uint64_t casts (NFC)

As pointed out by foad, it's not necessary to work on uint64_t
here. The values used here fit uint8_t.

Added: 
    

Modified: 
    llvm/lib/IR/AttributeImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h
index 6aca780e3e5d..390a6379dfc5 100644
--- a/llvm/lib/IR/AttributeImpl.h
+++ b/llvm/lib/IR/AttributeImpl.h
@@ -193,11 +193,11 @@ class AttributeBitSet {
 
 public:
   bool hasAttribute(Attribute::AttrKind Kind) const {
-    return AvailableAttrs[Kind / 8] & ((uint64_t)1) << (Kind % 8);
+    return AvailableAttrs[Kind / 8] & (1 << (Kind % 8));
   }
 
   void addAttribute(Attribute::AttrKind Kind) {
-    AvailableAttrs[Kind / 8] |= 1ULL << (Kind % 8);
+    AvailableAttrs[Kind / 8] |= 1 << (Kind % 8);
   }
 };
 


        


More information about the llvm-commits mailing list