[Alignment] fix build
authorGuillaume Chatelet <gchatelet@google.com>
Mon, 23 Sep 2019 09:04:12 +0000 (09:04 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 23 Sep 2019 09:04:12 +0000 (09:04 +0000)
llvm-svn: 372562

clang/lib/CodeGen/CGCall.cpp

index 00180d9..7fa262c 100644 (file)
@@ -4132,11 +4132,12 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
         auto scalarAlign = CGM.getDataLayout().getPrefTypeAlignment(scalarType);
 
         // Materialize to a temporary.
-        addr = CreateTempAlloca(RV.getScalarVal()->getType(),
-                                CharUnits::fromQuantity(std::max(
-                                    layout->getAlignment(), scalarAlign)),
-                                "tmp",
-                                /*ArraySize=*/nullptr, &AllocaAddr);
+        addr = CreateTempAlloca(
+            RV.getScalarVal()->getType(),
+            CharUnits::fromQuantity(std::max(
+                (unsigned)layout->getAlignment().value(), scalarAlign)),
+            "tmp",
+            /*ArraySize=*/nullptr, &AllocaAddr);
         tempSize = EmitLifetimeStart(scalarSize, AllocaAddr.getPointer());
 
         Builder.CreateStore(RV.getScalarVal(), addr);