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
diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp
index 8093a09..dafca98 100644
--- a/lib/IR/Constants.cpp
+++ b/lib/IR/Constants.cpp
@@ -1416,9 +1416,9 @@
LLVMContextImpl *pImpl = Ty->getContext().pImpl;
- // Look up the constant in the table first to ensure uniqueness
- std::vector<Constant*> argVec(1, C);
- ExprMapKeyType Key(opc, argVec);
+ // Look up the constant in the table first to ensure uniqueness.
+ ArrayRef<Constant*> Ops(&C, 1);
+ ExprMapKeyType Key(opc, Ops);
return pImpl->ExprConstants.getOrCreate(Ty, Key);
}