Motivation: When setting breakpoints in certain projects line sequences are frequently being inserted out of order.
Rather than inserting sequences one at a time into a sorted line table, store all the line sequences as we're building them up and sort and flatten afterwards.
I wonder if this have to be std::stable_sort?
For std::sort the order of equal elements is not guaranteed to be preserved.
nit: you could also probably use the llvm::sort (it would be a bit shorter):
llvm::sort(sequences, less_than_bp);