[PATCH] Add support to read include/exclude path lists from file

Edwin Vane edwin.vane at intel.com
Wed Apr 17 12:22:17 PDT 2013


  By the way, where are the unit tests for reading from a file?


================
Comment at: cpp11-migrate/Core/IncludeExcludeInfo.h:26
@@ -24,2 +25,3 @@
 public:
-  /// \brief Determine if the given file is safe to transform.
+  /// \brief Read and parse a comma-seperated lists of filepaths from
+  /// \a IncludeString and \a ExcludeString.
----------------
Just say 'paths'. We don't want to imply that each file must be included/excluded individually. Whole directory subtrees should be able to be specified too. Apply this elsewhere where you say 'filepath'.

================
Comment at: cpp11-migrate/Core/IncludeExcludeInfo.cpp:66
@@ +65,3 @@
+    // Drop any trailing '\r' when parsing DOS files with CRLF line terminators.
+    if (AbsolutePath.str().back() == '\r')
+      AbsolutePath = AbsolutePath.str().drop_back();
----------------
Perhaps just say:

  SmallString<64> AbsolutePath = I->rtrim();

Then you don't need any special checks for \r or extra copies of the string.


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



More information about the cfe-commits mailing list