llvm-svn: 185152
Factor out code to be reused in LSan. Also switch from linked list to vector. llvm-svn: 184957