Skip to content

Commit 514fc83

Browse files
committed
Fix missing template member in SmallVector
The ubuntu 18.04 Linux builder fails to build when the SmallVector does not include the number of elements. This is a known issue and is incorrect, but that is the version of clang on that OS. The definition of SmallVector is already available transitively since there are values of that type, I've just made it explicit. llvm::SmallVector has a default parameter for the number of elements while swift::SmallVector doesn't. I've gone ahead and made it explicitly use the llvm::SmallVector to receive that.
1 parent 8252a56 commit 514fc83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/ADT/DenseSet.h"
4242
#include "llvm/ADT/STLExtras.h"
4343
#include "llvm/ADT/Statistic.h"
44+
#include "llvm/ADT/SmallVector.h"
4445
#include "llvm/Support/Debug.h"
4546
#include <algorithm>
4647
#include <queue>
@@ -402,11 +403,11 @@ class StackAllocationPromoter {
402403
DeallocStackInst *dsi;
403404

404405
/// All the dealloc_stack instructions.
405-
SmallVector<DeallocStackInst *> dsis;
406+
llvm::SmallVector<DeallocStackInst *> dsis;
406407

407408
/// The lexical begin_borrow instructions that were created to track the
408409
/// lexical lifetimes introduced by the alloc_stack, if it is lexical.
409-
SmallVector<SILBasicBlock *> lexicalBBIBlocks;
410+
llvm::SmallVector<SILBasicBlock *> lexicalBBIBlocks;
410411

411412
/// Dominator info.
412413
DominanceInfo *domInfo;
@@ -792,7 +793,7 @@ void StackAllocationPromoter::fixPhiPredBlock(BlockSetVector &phiBlocks,
792793

793794
LLVM_DEBUG(llvm::dbgs() << "*** Found the definition: " << *def.copy);
794795

795-
SmallVector<SILValue> vals;
796+
llvm::SmallVector<SILValue> vals;
796797
vals.push_back(def.stored);
797798
if (shouldAddLexicalLifetime(asi)) {
798799
vals.push_back(def.borrow);

0 commit comments

Comments
 (0)