[cfe-commits] r91498 - in /cfe/trunk/lib/CodeGen: CGExpr.cpp CGExprScalar.cpp CodeGenFunction.h

Chris Lattner clattner at apple.com
Tue Dec 15 22:29:42 PST 2009


On Dec 15, 2009, at 6:57 PM, Mike Stump wrote:

> Author: mrs
> Date: Tue Dec 15 20:57:00 2009
> New Revision: 91498
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=91498&view=rev
> Log:
> Implement additional undefined checks for additional loads and stores.  WIP.

Nifty, one minor tweak:

> +  const llvm::IntegerType *Size_tTy
> +    = llvm::IntegerType::get(VMContext, LLVMPointerWidth);
> +  Address = Builder.CreateBitCast(Address, PtrToInt8Ty);
> +
> +  const llvm::Type *ResType[] = {
> +    Size_tTy
> +  };
> +  llvm::Value *F = CGM.getIntrinsic(llvm::Intrinsic::objectsize, ResType, 1);

No need to define an array here (and other similar places), just do:

> +  llvm::Value *F = CGM.getIntrinsic(llvm::Intrinsic::objectsize, &Size_tTy, 1);

-Chris



More information about the cfe-commits mailing list