@@ -737,7 +737,7 @@ class LifetimeDataflow {
737
737
struct ExpiredLattice {
738
738
LoanSet Expired;
739
739
740
- ExpiredLattice () = default ;
740
+ ExpiredLattice () : Expired( nullptr ) {} ;
741
741
explicit ExpiredLattice (LoanSet S) : Expired(S) {}
742
742
743
743
bool operator ==(const ExpiredLattice &Other) const {
@@ -814,10 +814,10 @@ class ExpiredLoansAnalysis {
814
814
: Cfg(C), AC(AC), Xfer(FS, SetFactory) {}
815
815
816
816
void run () {
817
- llvm::TimeTraceScope TimeProfile (" Expired Loans Analysis " );
817
+ llvm::TimeTraceScope TimeProfile (" ExpiredLoansAnalysis " );
818
818
ForwardDataflowWorklist Worklist (Cfg, AC);
819
819
const CFGBlock *Entry = &Cfg.getEntry ();
820
- BlockEntryStates[Entry] = ExpiredLattice (SetFactory. getEmptySet ()) ;
820
+ BlockEntryStates[Entry] = ExpiredLattice{} ;
821
821
Worklist.enqueueBlock (Entry);
822
822
while (const CFGBlock *B = Worklist.dequeue ()) {
823
823
ExpiredLattice EntryState = getEntryState (B);
@@ -849,24 +849,16 @@ class ExpiredLoansAnalysis {
849
849
}
850
850
851
851
ExpiredLattice getEntryState (const CFGBlock *B) const {
852
- auto It = BlockEntryStates.find (B);
853
- if (It != BlockEntryStates.end ()) {
854
- return It->second ;
855
- }
856
- return ExpiredLattice (SetFactory.getEmptySet ());
852
+ return BlockEntryStates.lookup (B);
857
853
}
858
854
859
855
ExpiredLattice getExitState (const CFGBlock *B) const {
860
- auto It = BlockExitStates.find (B);
861
- if (It != BlockExitStates.end ()) {
862
- return It->second ;
863
- }
864
- return ExpiredLattice (SetFactory.getEmptySet ());
856
+ return BlockExitStates.lookup (B);
865
857
}
866
858
};
867
859
868
860
// ========================================================================= //
869
- // TODO: Analysing dataflow results and error reporting.
861
+ // TODO: Liveness analysis, analysing dataflow results and error reporting.
870
862
// ========================================================================= //
871
863
} // anonymous namespace
872
864
@@ -895,6 +887,6 @@ void runLifetimeSafetyAnalysis(const DeclContext &DC, const CFG &Cfg,
895
887
896
888
ExpiredLoansAnalysis ExpiredAnalysis (Cfg, FactMgr, AC);
897
889
ExpiredAnalysis.run ();
898
- DEBUG_WITH_TYPE (" ExpiredLoans " , ExpiredAnalysis.dump ());
890
+ DEBUG_WITH_TYPE (" LifetimeExpiredLoans " , ExpiredAnalysis.dump ());
899
891
}
900
892
} // namespace clang
0 commit comments