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

Guillaume Papin guillaume.papin at epitech.eu
Mon Jul 15 13:29:12 PDT 2013


  At a quick glance it looks good, one thing I'm not sure is if the order the transforms were applied is tracked?
  Because the replacements depend on each others, things like:

    for (std::vector<int>::iterator I = V.begin(), E = V.end(); I != E; ++I)
      std::cout << *I << std::endl;

  With `-use-auto` and `-loop-convert` it gives:

    for (auto & elem : V)
      std::cout << elem << std::endl;

  But the replacement data will be different depending on the order they are applied.


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

================
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();
----------------
Is this non-const iterator really necessary? Seems to me that the HeaderOverrides is not really modified, just read.



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



More information about the cfe-commits mailing list