Skip to content

Commit 8bfd6b9

Browse files
[SSAUpdater] Use DenseMap::operator[] (NFC) (llvm#107179)
I'm planning to deprecate DenseMap::FindAndConstruct in favor of DenseMap::operator[]. I thought about renaming the variable to PredInfo, but the name is taken, so I am leaving the name as is.
1 parent 009184f commit 8bfd6b9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,16 @@ class SSAUpdaterImpl {
139139
for (unsigned p = 0; p != Info->NumPreds; ++p) {
140140
BlkT *Pred = Preds[p];
141141
// Check if BBMap already has a BBInfo for the predecessor block.
142-
typename BBMapTy::value_type &BBMapBucket =
143-
BBMap.FindAndConstruct(Pred);
144-
if (BBMapBucket.second) {
145-
Info->Preds[p] = BBMapBucket.second;
142+
BBInfo *&BBMapBucket = BBMap[Pred];
143+
if (BBMapBucket) {
144+
Info->Preds[p] = BBMapBucket;
146145
continue;
147146
}
148147

149148
// Create a new BBInfo for the predecessor.
150149
ValT PredVal = AvailableVals->lookup(Pred);
151150
BBInfo *PredInfo = new (Allocator) BBInfo(Pred, PredVal);
152-
BBMapBucket.second = PredInfo;
151+
BBMapBucket = PredInfo;
153152
Info->Preds[p] = PredInfo;
154153

155154
if (PredInfo->AvailableVal) {

0 commit comments

Comments
 (0)