[cfe-commits] r68865 - in /cfe/trunk: lib/CodeGen/CGBlocks.cpp test/CodeGen/kr-style-block.c

Fariborz Jahanian fjahanian at apple.com
Sat Apr 11 11:55:50 PDT 2009


On Apr 11, 2009, at 11:38 AM, Chris Lattner wrote:

> On Apr 11, 2009, at 10:55 AM, Fariborz Jahanian wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=68865&view=rev
>> Log:
>> Fixes a ir-gen crash for K&R style blocks.
>
> Cool, one minor nit:
>
>> +  const FunctionType *BlockFunctionType = BExpr->getFunctionType();
>> +  QualType ResultType;
>> +  bool IsVariadic;
>> +  if (!isa<FunctionNoProtoType>(BlockFunctionType)) {
>> +    const FunctionProtoType *FTy =  
>> cast<FunctionProtoType>(BlockFunctionType);
>
> Instead of the if(!) + cast, how about using dyn_cast:
>
>> +  if (const FunctionProtoType *FTy =
>           dyn_cast<FunctionProtoType>(BlockFunctionType))) {

Done.
http://llvm.org/viewvc/llvm-project?view=rev&revision=68870

- Fariborz

>
>
> -Chris




More information about the cfe-commits mailing list