Mike, Please at the beginning of each function which builds a specific block type, add comments, including the type declaration being built.
- Fariborz On Feb 13, 2009, at 8:55 AM, Mike Stump wrote: > Author: mrs > Date: Fri Feb 13 10:55:51 2009 > New Revision: 64458 > > URL: http://llvm.org/viewvc/llvm-project?rev=64458&view=rev > Log: > Size should be unsigned. > > 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=64458&r1=64457&r2=64458&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original) > +++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Fri Feb 13 10:55:51 2009 > @@ -36,29 +36,28 @@ > > const llvm::PointerType *PtrToInt8Ty > = llvm::PointerType::getUnqual(llvm::Type::Int8Ty); > + const llvm::Type *UnsignedLongTy > + = CGM.getTypes().ConvertType(getContext().UnsignedLongTy); > llvm::Constant *C; > std::vector<llvm::Constant*> Elts; > > // reserved > - const llvm::IntegerType *LongTy > - = cast<llvm::IntegerType>( > - CGM.getTypes().ConvertType(CGM.getContext().LongTy)); > - C = llvm::ConstantInt::get(LongTy, 0); > + C = llvm::ConstantInt::get(UnsignedLongTy, 0); > Elts.push_back(C); > > // Size > // FIXME: This should be the size of BlockStructType > - C = llvm::ConstantInt::get(LongTy, 20); > + C = llvm::ConstantInt::get(UnsignedLongTy, 20); > Elts.push_back(C); > > if (BlockHasCopyDispose) { > // copy_func_helper_decl > - C = llvm::ConstantInt::get(LongTy, 0); > + C = llvm::ConstantInt::get(UnsignedLongTy, 0); > C = llvm::ConstantExpr::getBitCast(C, PtrToInt8Ty); > Elts.push_back(C); > > // destroy_func_decl > - C = llvm::ConstantInt::get(LongTy, 0); > + C = llvm::ConstantInt::get(UnsignedLongTy, 0); > C = llvm::ConstantExpr::getBitCast(C, PtrToInt8Ty); > Elts.push_back(C); > } > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
