[cfe-commits] [PATCH] Write transform results to disk only once
Edwin Vane
edwin.vane at intel.com
Mon Jan 14 09:27:17 PST 2013
================
Comment at: cpp11-migrate/RefactoringResults.h:34
@@ +33,3 @@
+public:
+ typedef std::pair<char*, std::string> ResultEntry;
+ typedef std::vector<ResultEntry> ResultVec;
----------------
Manuel Klimek wrote:
> why not pair<string, string>?
I'm not sure why I chose char*. Possibly a holdover from before the reviewer-recommended changes were made to the refactoring patch in clang. It's fixed now. As a result, got rid of RefactoringResults class completely.
================
Comment at: cpp11-migrate/RefactoringResults.cpp:54
@@ +53,3 @@
+ // This would be a little less wonky using move semantics. The goal is to
+ // avoid potentially expensive copies of ResultEntry.
+ Data.resize(Data.size() + 1);
----------------
Manuel Klimek wrote:
> This looks very much like a premature optimization. If we don't have a benchmark, I would not make the code more convoluted to "avoid copies".
I put a FIXME here to get some benchmark data or at least use move semantics when we can.
http://llvm-reviews.chandlerc.com/D288
More information about the cfe-commits
mailing list