[llvm] ae5d3e8 - Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 03:10:20 PST 2020
Author: Simon Pilgrim
Date: 2020-02-03T11:09:08Z
New Revision: ae5d3e8c5115695fe2b1f7f652a696b0b0069551
URL: https://github.com/llvm/llvm-project/commit/ae5d3e8c5115695fe2b1f7f652a696b0b0069551
DIFF: https://github.com/llvm/llvm-project/commit/ae5d3e8c5115695fe2b1f7f652a696b0b0069551.diff
LOG: Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Added:
Modified:
llvm/lib/Frontend/OpenMP/OMPContext.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Frontend/OpenMP/OMPContext.cpp b/llvm/lib/Frontend/OpenMP/OMPContext.cpp
index 61981a059f88..7bdc16af9014 100644
--- a/llvm/lib/Frontend/OpenMP/OMPContext.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPContext.cpp
@@ -214,13 +214,13 @@ static APInt getVariantMatchScore(const VariantMatchInfo &VMI,
switch (getOpenMPContextTraitSelectorForProperty(Property)) {
case TraitSelector::device_kind:
- Score += (1 << (NoConstructTraits + 0));
+ Score += (1ULL << (NoConstructTraits + 0));
continue;
case TraitSelector::device_arch:
- Score += (1 << (NoConstructTraits + 1));
+ Score += (1ULL << (NoConstructTraits + 1));
continue;
case TraitSelector::device_isa:
- Score += (1 << (NoConstructTraits + 2));
+ Score += (1ULL << (NoConstructTraits + 2));
continue;
default:
continue;
@@ -236,7 +236,7 @@ static APInt getVariantMatchScore(const VariantMatchInfo &VMI,
"Ill-formed variant match info!");
(void)Property;
// ConstructMatches is the position p - 1 and we need 2^(p-1).
- Score += (1 << ConstructMatches[ConstructIdx++]);
+ Score += (1ULL << ConstructMatches[ConstructIdx++]);
}
LLVM_DEBUG(dbgs() << "[" << DEBUG_TYPE << "] Variant has a score of " << Score
More information about the llvm-commits
mailing list