aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-03-07 01:30:40 +0000
committerNadav Rotem <nrotem@apple.com>2013-03-07 01:30:40 +0000
commit82e905aae4fe815fc57f50663467cb03e4c9e9e1 (patch)
treef7907ea8dafc4965e1bfa7f2307b52402c4e9a21 /lib/IR/Constants.cpp
parent119003f2a22ee7c4f78fed5710f98edb36b237b5 (diff)
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
Diffstat (limited to 'lib/IR/Constants.cpp')
-rw-r--r--lib/IR/Constants.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp
index 8093a09749..dafca987fe 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<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);
}