Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem 2013-03-07 01:30:40 +00:00
parent 119003f2a2
commit 82e905aae4

View File

@ -1416,9 +1416,9 @@ static inline Constant *getFoldedCast(
LLVMContextImpl *pImpl = Ty->getContext().pImpl; LLVMContextImpl *pImpl = Ty->getContext().pImpl;
// Look up the constant in the table first to ensure uniqueness // Look up the constant in the table first to ensure uniqueness.
std::vector<Constant*> argVec(1, C); ArrayRef<Constant*> Ops(&C, 1);
ExprMapKeyType Key(opc, argVec); ExprMapKeyType Key(opc, Ops);
return pImpl->ExprConstants.getOrCreate(Ty, Key); return pImpl->ExprConstants.getOrCreate(Ty, Key);
} }