summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-02-13 16:01:35 +0000
committerMike Stump <mrs@apple.com>2009-02-13 16:01:35 +0000
commit92bbd6d4350253f802fc296b7eb99d7c1034878b (patch)
tree0379a174a19597c13a0b323e8f0f7482ddabdf1e /clang
parent57d73546351c10532138084d9323fe200732acf1 (diff)
downloadbcm5719-llvm-92bbd6d4350253f802fc296b7eb99d7c1034878b.tar.gz
bcm5719-llvm-92bbd6d4350253f802fc296b7eb99d7c1034878b.zip
Fixup types, the runtime uses int, not int32.
llvm-svn: 64456
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 9588e4df5ed..7708df5b0e9 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -58,6 +58,9 @@ CodeGenModule::getGenericBlockLiteralType() {
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 @@ 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<llvm::IntegerType>(
+ 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;
OpenPOWER on IntegriCloud