CGBuiltin.cpp: Fix abuse of ArrayRef in EmitOverflowIntrinsic().
In ArrayRef<T>(X), X should not be temporary value. It could be rewritten more redundantly; llvm::Type *XTy = X->getType(); ArrayRef<llvm::Type *> Ty(XTy); llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, Ty); Since it is safe if both XTy and Ty are temporary value in one statement, it could be shorten; llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, ArrayRef<llvm::Type*>(X->getType())); ArrayRef<T> has an implicit constructor to create uni-entry of T; llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, X->getType()); MSVC-generated clang.exe crashed. llvm-svn: 172352
Loading
Please register or sign in to comment