Skip to content

Commit 7b26a72

Browse files
committed
fix tests
1 parent b63cb4b commit 7b26a72

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/lib/Analysis/LifetimeSafety.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/ADT/ImmutableMap.h"
1919
#include "llvm/ADT/ImmutableSet.h"
2020
#include "llvm/ADT/PointerUnion.h"
21+
#include "llvm/ADT/SmallBitVector.h"
2122
#include "llvm/ADT/SmallVector.h"
2223
#include "llvm/Support/Debug.h"
2324
#include "llvm/Support/TimeProfiler.h"
@@ -647,8 +648,10 @@ join(llvm::ImmutableMap<K, V> A, llvm::ImmutableMap<K, V> B,
647648
for (const auto &Entry : B) {
648649
const K &Key = Entry.first;
649650
const V &ValB = Entry.second;
650-
const V &ValA = *A.lookup(Key);
651-
A = F.add(A, Key, joinValues(ValA, ValB));
651+
if (const V *ValA = A.lookup(Key))
652+
A = F.add(A, Key, joinValues(*ValA, ValB));
653+
else
654+
A = F.add(A, Key, ValB);
652655
}
653656
return A;
654657
}
@@ -723,7 +726,7 @@ class LoanPropagationAnalysis
723726

724727
using DataflowAnalysis<LoanPropagationAnalysis, Lattice>::transfer;
725728

726-
const char *getAnalysisName() const { return "Loan Propagation"; }
729+
StringRef getAnalysisName() const { return "LoanPropagation"; }
727730

728731
Lattice getInitialState() { return Lattice{}; }
729732

0 commit comments

Comments
 (0)