[PATCH] clang-replace: Afford applying replacements in memory

Edwin Vane edwin.vane at intel.com
Mon Aug 26 12:14:05 PDT 2013



================
Comment at: clang-replace/ApplyReplacements.h:87
@@ -84,1 +86,3 @@
+                       clang::SourceManager &SM,
+                       llvm::StringMap<std::string> *OutputState = 0);
 
----------------
Manuel Klimek wrote:
> I'd rather split up this function into one that does the applyAllReplacments (which is in-memory) and one that then saves all the buffers.
This design occurred to me first except I didn't like the overhead it incurred. the `applyAllReplacements()` which writes to an in-memory location will always need to construct and populate an auxiliary data structure (the new `StringMap`) which isn't necessary if you're writing directly to file. If you don't feel this is a problem I'll change it back.


http://llvm-reviews.chandlerc.com/D1519



More information about the cfe-commits mailing list