From 41e0ee30748f021dba3e0ea039dee50ad0e97f9a Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Wed, 13 May 2015 01:12:16 +0000 Subject: Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&. The array passed to LoadAndStorePromoter's constructor was a constant reference to a SmallVectorImpl, which is just the same as passing an ArrayRef. Also, the data in the array can be 'const Instruction*' instead of 'Instruction*'. Its not possible to convert a SmallVectorImpl to SmallVectorImpl, but ArrayRef does provide such a method. Currently this added calls to makeArrayRef which should be a nop, but i'm going to kick off a discussion about improving ArrayRef to not need these. llvm-svn: 237226 --- llvm/lib/Transforms/Utils/SSAUpdater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils/SSAUpdater.cpp') diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp index 955ce30ed3d..88b39dd7f66 100644 --- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp +++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp @@ -322,12 +322,12 @@ Value *SSAUpdater::GetValueAtEndOfBlockInternal(BasicBlock *BB) { //===----------------------------------------------------------------------===// LoadAndStorePromoter:: -LoadAndStorePromoter(const SmallVectorImpl &Insts, +LoadAndStorePromoter(ArrayRef Insts, SSAUpdater &S, StringRef BaseName) : SSA(S) { if (Insts.empty()) return; - Value *SomeVal; - if (LoadInst *LI = dyn_cast(Insts[0])) + const Value *SomeVal; + if (const LoadInst *LI = dyn_cast(Insts[0])) SomeVal = LI; else SomeVal = cast(Insts[0])->getOperand(0); -- cgit v1.2.3