diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-13 11:26:44 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-13 11:26:44 +0000 |
commit | 563fb903fab15972e2d9c66b0ae046a94be86a71 (patch) | |
tree | 061c418796450d93d1bad8d6cce2444e384c0f8d /include/clang/Basic/SourceManager.h | |
parent | 4e9008ac62b4c403c5c30724953664dcbb03d02e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
0 files changed, 0 insertions, 0 deletions