From: Mike Stump Date: Fri, 13 Feb 2009 16:01:35 +0000 (+0000) Subject: Fixup types, the runtime uses int, not int32. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cbb3608a7c28a7fb285fdc7f44060c5c175c8a0;p=clang Fixup types, the runtime uses int, not int32. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64456 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 9588e4df5e..7708df5b0e 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -58,6 +58,9 @@ CodeGenModule::getGenericBlockLiteralType() { const llvm::Type *BlockDescPtrTy = llvm::PointerType::getUnqual(getBlockDescriptorType()); + const llvm::IntegerType *IntTy = cast( + getTypes().ConvertType(getContext().IntTy)); + // struct __block_literal_generic { // void *isa; // int flags; @@ -66,8 +69,8 @@ CodeGenModule::getGenericBlockLiteralType() { // struct __block_descriptor *descriptor; // }; GenericBlockLiteralType = llvm::StructType::get(Int8PtrTy, - llvm::Type::Int32Ty, - llvm::Type::Int32Ty, + IntTy, + IntTy, Int8PtrTy, BlockDescPtrTy, NULL); @@ -156,6 +159,8 @@ llvm::Constant *CodeGenModule::GetAddrOfGlobalBlock(const BlockExpr *BE) { // Generate the block descriptor. const llvm::Type *UnsignedLongTy = Types.ConvertType(Context.UnsignedLongTy); + const llvm::IntegerType *IntTy = cast( + getTypes().ConvertType(getContext().IntTy)); llvm::Constant *DescriptorFields[2]; @@ -187,10 +192,10 @@ llvm::Constant *CodeGenModule::GetAddrOfGlobalBlock(const BlockExpr *BE) { LiteralFields[0] = NSConcreteGlobalBlock; // Flags - LiteralFields[1] = llvm::ConstantInt::get(llvm::Type::Int32Ty, IsGlobal); + LiteralFields[1] = llvm::ConstantInt::get(IntTy, IsGlobal); // Reserved - LiteralFields[2] = llvm::Constant::getNullValue(llvm::Type::Int32Ty); + LiteralFields[2] = llvm::Constant::getNullValue(IntTy); // Function LiteralFields[3] = Fn;