Skip to content

Commit 06ed5d7

Browse files
committed
[NFC] Removed spurious templating.
Now that StackAllocationPromoter::initializationPoints maps to either a StoreInst or a StoreBorrowInst, there is no longer a subtype of SILInstruction * at which the BlockToInstMap could be specialized, so just eliminate the template argument and erase some angle brackets.
1 parent f68647a commit 06ed5d7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ namespace {
485485
/// Promotes a single AllocStackInst into registers..
486486
class StackAllocationPromoter {
487487
using BlockSetVector = BasicBlockSetVector;
488-
template <typename Inst = SILInstruction>
489-
using BlockToInstMap = llvm::DenseMap<SILBasicBlock *, Inst *>;
488+
using BlockToInstMap = llvm::DenseMap<SILBasicBlock *, SILInstruction *>;
490489

491490
// Use a priority queue keyed on dominator tree level so that inserted nodes
492491
// are handled from the bottom of the dom tree upwards.
@@ -534,7 +533,7 @@ class StackAllocationPromoter {
534533
/// value stored into the StoreInst and a CopyValueInst of the result of the
535534
/// BeginBorrowInst or a StoreBorrowInst, and a BeginBorrowInst of the stored
536535
/// value if it did not have a guaranteed lexical scope.
537-
BlockToInstMap<> initializationPoints;
536+
BlockToInstMap initializationPoints;
538537

539538
/// The first instruction in each block that deinitializes the storage that is
540539
/// not preceded by an instruction that initializes it.
@@ -548,7 +547,7 @@ class StackAllocationPromoter {
548547
/// Ending lexical lifetimes before these instructions is one way that the
549548
/// cross-block lexical lifetimes of initializationPoints can be ended in
550549
/// StackAllocationPromoter::endLexicalLifetime.
551-
BlockToInstMap<> deinitializationPoints;
550+
BlockToInstMap deinitializationPoints;
552551

553552
public:
554553
/// C'tor.
@@ -894,7 +893,7 @@ StackAllocationPromoter::getLiveOutValues(BlockSetVector &phiBlocks,
894893
SILBasicBlock *domBlock = domNode->getBlock();
895894

896895
// If there is a store (that must come after the phi), use its value.
897-
BlockToInstMap<>::iterator it = initializationPoints.find(domBlock);
896+
BlockToInstMap::iterator it = initializationPoints.find(domBlock);
898897
if (it != initializationPoints.end()) {
899898
auto *inst = it->second;
900899
assert(isa<StoreInst>(inst) || isa<StoreBorrowInst>(inst));

0 commit comments

Comments
 (0)