From 82e905aae4fe815fc57f50663467cb03e4c9e9e1 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Thu, 7 Mar 2013 01:30:40 +0000 Subject: 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 --- lib/IR/Constants.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 @@ static inline Constant *getFoldedCast( LLVMContextImpl *pImpl = Ty->getContext().pImpl; - // Look up the constant in the table first to ensure uniqueness - std::vector argVec(1, C); - ExprMapKeyType Key(opc, argVec); + // Look up the constant in the table first to ensure uniqueness. + ArrayRef Ops(&C, 1); + ExprMapKeyType Key(opc, Ops); return pImpl->ExprConstants.getOrCreate(Ty, Key); } -- cgit v1.1