[PATCH] Transform all files in a compilation database if no source files are provided.

Edwin Vane edwin.vane at intel.com
Fri Sep 6 07:11:40 PDT 2013



================
Comment at: clang-modernize/tool/ClangModernize.cpp:362
@@ +361,3 @@
+    llvm::report_fatal_error(
+        "No sources or compilation database were provided.");
+
----------------
I'd just say "Could not determine sources to transform".

================
Comment at: clang-modernize/tool/ClangModernize.cpp:353
@@ +352,3 @@
+      // if the file is included when include/exclude paths are specified.
+      if (GlobalOptions.ModifiableFiles.isIncludeListEmpty() ||
+          GlobalOptions.ModifiableFiles.isFileIncluded(*I))
----------------
As we talked about: until all transforms are smart enough to generate replacements only if they can make changes to all necessary files, we shouldn't transform all sources in the compilation database without an explicit -include. Otherwise none of the headers will transform and some (at least the use-auto_ptr transform) will produce broken code.

For now, exit with a message saying "Use -include to indicate which files of the compilation database to transform".


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



More information about the cfe-commits mailing list