[PATCH] cpp11-migrate: Write header replacements to disk

Tareq A. Siraj tareq.a.siraj at intel.com
Mon Jul 15 13:53:13 PDT 2013


  The order of replacements is possibly not being saved since Replacements is a sorted set. There is a TODO in there to change this into a vector but not sure why it wasn't done on the first place. Have to think about this one a bit.


================
Comment at: cpp11-migrate/Core/ReplacementsYaml.h:31
@@ +30,3 @@
+    llvm::StringRef TransformID = R.TransformID;
+      llvm::StringRef ReplacementText = R.ReplacementText;
+    Io.mapRequired("TransformID", TransformID);
----------------
Guillaume Papin wrote:
> Extra spaces.
Will fix.

================
Comment at: cpp11-migrate/tool/Cpp11Migrate.cpp:210
@@ -208,3 +209,3 @@
     // written to disk for testing purposes.
-    for (HeaderOverrides::const_iterator HeaderI = Overrides.headers_begin(),
+    for (HeaderOverrides::iterator HeaderI = Overrides.headers_begin(),
                                          HeaderE = Overrides.headers_end();
----------------
Guillaume Papin wrote:
> Is this non-const iterator really necessary? Seems to me that the HeaderOverrides is not really modified, just read.
> 
Writing vector<MigratorReplacements> to YAML requires the vector to be non-const (not entirely sure why they did it like that) and thus the HeaderOverrides need to be non-const.


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



More information about the cfe-commits mailing list