plotfi added inline comments.
================ Comment at: clang/lib/Driver/Driver.cpp:2217 public: - typedef llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases> PhasesTy; + typedef const std::vector<phases::ID> PhasesTy; ---------------- aaron.ballman wrote: > Why are you changing this to an STL type? I changed it because it didn't look like you can return a SmallVector, but I just changed it back to the old SmallVector function calling style. ================ Comment at: clang/lib/Driver/Driver.cpp:3236 - PL.clear(); - types::getCompilationPhases(InputType, PL); + const std::vector<phases::ID> PL = types::getCompilationPhases(InputType); + LastPLSize = PL.size(); ---------------- aaron.ballman wrote: > You could use a `const &` here and avoid the copy. Either that, or drop the > `const` (it's not a common pattern in the code base). Going to keep the copy. I want to eventually merge getCompilationPhases and getFinalPhase into the same function. ================ Comment at: clang/lib/Driver/Types.cpp:301-303 + assert(Phases.size() == P.size() && "Invalid size."); + for (unsigned i = 0; i < Phases.size(); i++) + assert(Phases[i] == P[i] && "Invalid Phase"); ---------------- aaron.ballman wrote: > You can replace all three lines by: > `assert(std::equal(Phases.begin(), Phases.end(), P.begin(), P.end()) && > "Invalid phase or size");` Nice! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64098/new/ https://reviews.llvm.org/D64098 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits