|
18 | 18 | #include "llvm/ADT/ImmutableMap.h"
|
19 | 19 | #include "llvm/ADT/ImmutableSet.h"
|
20 | 20 | #include "llvm/ADT/PointerUnion.h"
|
| 21 | +#include "llvm/ADT/SmallBitVector.h" |
21 | 22 | #include "llvm/ADT/SmallVector.h"
|
22 | 23 | #include "llvm/Support/Debug.h"
|
23 | 24 | #include "llvm/Support/TimeProfiler.h"
|
@@ -647,8 +648,10 @@ join(llvm::ImmutableMap<K, V> A, llvm::ImmutableMap<K, V> B,
|
647 | 648 | for (const auto &Entry : B) {
|
648 | 649 | const K &Key = Entry.first;
|
649 | 650 | 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); |
652 | 655 | }
|
653 | 656 | return A;
|
654 | 657 | }
|
@@ -723,7 +726,7 @@ class LoanPropagationAnalysis
|
723 | 726 |
|
724 | 727 | using DataflowAnalysis<LoanPropagationAnalysis, Lattice>::transfer;
|
725 | 728 |
|
726 |
| - const char *getAnalysisName() const { return "Loan Propagation"; } |
| 729 | + StringRef getAnalysisName() const { return "LoanPropagation"; } |
727 | 730 |
|
728 | 731 | Lattice getInitialState() { return Lattice{}; }
|
729 | 732 |
|
|
0 commit comments