Fix MSVC int64_t -> uint64_t "narrowing conversion" warning.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 10 Jun 2021 09:55:06 +0000 (10:55 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 10 Jun 2021 09:55:24 +0000 (10:55 +0100)
llvm/lib/Transforms/Utils/MemoryOpRemark.cpp

index 8ee7e0c..77f8a98 100644 (file)
@@ -295,7 +295,7 @@ void MemoryOpRemark::visitVariable(const Value *V,
                                    SmallVectorImpl<VariableInfo> &Result) {
   if (auto *GV = dyn_cast<GlobalVariable>(V)) {
     auto *Ty = cast<PointerType>(GV->getType())->getElementType();
-    int64_t Size = DL.getTypeSizeInBits(Ty).getFixedSize();
+    uint64_t Size = DL.getTypeSizeInBits(Ty).getFixedSize();
     VariableInfo Var{nameOrNone(GV), Size};
     if (!Var.isEmpty())
       Result.push_back(std::move(Var));