================ Comment at: clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp:79 @@ +78,3 @@ +/// +/// \param[in] Replacements Replacements to apply +/// \param[in] Rewrites Rewriter to use to apply replacements. ---------------- Daniel Jasper wrote: > Is there a reason for this precondition. Why not just have the first > statement: > > if (Replacements.empty()) return; > > ? > > Like this all the callsites need to worry about that .. No reason than for preference. This function had (accidentally) unwritten post-condition that `Result` would have file contents in it upon return. But since at least one Replacement is required to get the file name, this function would be unable to even put unmodified data in `Result`. Whether the function is left as is or just returns an empty string in the case of no replacements, some caller still needs to worry about there being no replacements.
http://llvm-reviews.chandlerc.com/D1730 BRANCH mv-reformat ARCANIST PROJECT clang-tools-extra _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
