More changes to std::vector usage.

Replace with std::vector with static array, llvm::SmallVector or add code to reserve space.