[cfe-commits] r64346 - in /cfe/trunk: clang.xcodeproj/project.pbxproj lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h

Chris Lattner clattner at apple.com
Thu Feb 12 21:02:48 PST 2009


On Feb 11, 2009, at 4:39 PM, Anders Carlsson wrote:
> Author: andersca
> Date: Wed Feb 11 18:39:25 2009
> New Revision: 64346
>
> URL: http://llvm.org/viewvc/llvm-project?rev=64346&view=rev
> Log:
> Add support for generating block call expressions.

nice!

> +static const llvm::Type *getBlockDescriptorType(CodeGenFunction  
> &CGF) {
> +  static const llvm::Type *Ty = 0;
> +
> +  if (!Ty) {

Please make this an instance variable in CGF (similar for other  
routines).  Global variables (including function statics) are  
verboten.  Also, please use early exit to avoid nesting:

   if (Ty) return Ty;

Thanks Anders!

-Chris



More information about the cfe-commits mailing list