[analyzer] Remove superquadratic behaviour from DataflowWorklist

The class DataflowWorklist internally maintains a sorted list of pointers to CFGBlock
and the method enqueuePredecessors has to call sortWorklist to maintain the invariant.
The implementation based on vector + sort works well for small sizes
but gets infeasible for relatively large sizes. In particular the issue takes place
for some cryptographic libraries which use code generation.
The diff replaces vector + sort with priority queue.
For one of the implementations of AES this patch reduces
the time for analysis from 204 seconds to 8 seconds.

Test plan: make -j8 check-clang

Differential revision: https://reviews.llvm.org/D25503

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284166 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 393458c0781d7d758493b87a47fbe086935323a7)
1 file changed