瀏覽代碼

[Alignment] fix build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372562 91177308-0d34-0410-b5e6-96231b3b80d8
Guillaume Chatelet 6 年之前
父節點
當前提交
12e1859fa2
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      lib/CodeGen/CGCall.cpp

+ 6 - 5
lib/CodeGen/CGCall.cpp

@@ -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);