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 | 7ab4fbf5c2981af166e651c84556073daa12008f (patch) | |
tree | 14be402d133b413c67fe429a050abe6420b39a5f /llvm/lib/Support/DynamicLibrary.cpp | |
parent | 48cb3b97c7d319b44ecbdd028472c9ef38df6631 (diff) | |
download | llvm-7ab4fbf5c2981af166e651c84556073daa12008f.zip llvm-7ab4fbf5c2981af166e651c84556073daa12008f.tar.gz llvm-7ab4fbf5c2981af166e651c84556073daa12008f.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/Support/DynamicLibrary.cpp')
0 files changed, 0 insertions, 0 deletions