[cfe-commits] r64456 - /cfe/trunk/lib/CodeGen/CGBlocks.cpp
Mike Stump
mrs at apple.com
Fri Feb 13 08:01:36 PST 2009
Author: mrs
Date: Fri Feb 13 10:01:35 2009
New Revision: 64456
URL: http://llvm.org/viewvc/llvm-project?rev=64456&view=rev
Log:
Fixup types, the runtime uses int, not int32.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=64456&r1=64455&r2=64456&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Fri Feb 13 10:01:35 2009
@@ -58,6 +58,9 @@
const llvm::Type *BlockDescPtrTy =
llvm::PointerType::getUnqual(getBlockDescriptorType());
+ const llvm::IntegerType *IntTy = cast<llvm::IntegerType>(
+ getTypes().ConvertType(getContext().IntTy));
+
// struct __block_literal_generic {
// void *isa;
// int flags;
@@ -66,8 +69,8 @@
// struct __block_descriptor *descriptor;
// };
GenericBlockLiteralType = llvm::StructType::get(Int8PtrTy,
- llvm::Type::Int32Ty,
- llvm::Type::Int32Ty,
+ IntTy,
+ IntTy,
Int8PtrTy,
BlockDescPtrTy,
NULL);
@@ -156,6 +159,8 @@
// Generate the block descriptor.
const llvm::Type *UnsignedLongTy = Types.ConvertType(Context.UnsignedLongTy);
+ const llvm::IntegerType *IntTy = cast<llvm::IntegerType>(
+ getTypes().ConvertType(getContext().IntTy));
llvm::Constant *DescriptorFields[2];
@@ -187,10 +192,10 @@
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;
More information about the cfe-commits
mailing list