Skip to content

Commit 7770ba8

Browse files
authored
Merge pull request #30138 from atrick/fix-build-warning
2 parents bd30df9 + 956948b commit 7770ba8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/IRGen/IRGen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ class Alignment {
263263

264264
explicit operator bool() const { return Value != 0; }
265265

266+
explicit operator llvm::MaybeAlign() const { return llvm::MaybeAlign(Value); }
267+
266268
friend bool operator< (Alignment L, Alignment R){ return L.Value < R.Value; }
267269
friend bool operator<=(Alignment L, Alignment R){ return L.Value <= R.Value; }
268270
friend bool operator> (Alignment L, Alignment R){ return L.Value > R.Value; }

lib/IRGen/TypeLayout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,8 +1270,8 @@ static void emitMemCpy(IRGenFunction &IGF, Address dest, Address src,
12701270
auto byteDestAddr = Builder.CreateBitOrPointerCast(dest.getAddress(), IGM.Int8PtrTy);
12711271
auto byteSrcAddr =
12721272
Builder.CreateBitOrPointerCast(src.getAddress(), IGM.Int8PtrTy);
1273-
Builder.CreateMemCpy(byteDestAddr, dest.getAlignment().getValue(),
1274-
byteSrcAddr, src.getAlignment().getValue(), size);
1273+
Builder.CreateMemCpy(byteDestAddr, llvm::MaybeAlign(dest.getAlignment()),
1274+
byteSrcAddr, llvm::MaybeAlign(src.getAlignment()), size);
12751275
}
12761276

12771277
llvm::BasicBlock *

0 commit comments

Comments
 (0)