[PATCH] clang-modernize: Add SubprocessCompilationDatabase

Guillaume Papin guillaume.papin at epitech.eu
Thu Oct 10 14:46:38 PDT 2013


  Looks nice.
  I'm wondering, any reason not to use the fixed compilation database to pass the flags?

  Using
  ```
  clang-modernize -loop-convert %t.cpp -d %T -- /opt/clang-3.3/bin/clang++ -g -o output %/t.cpp -std=c++11 -DDOOUTPUT
  ```

  instead of
  ```
  clang-modernize -loop-convert %t.cpp -d %T -c /opt/clang-3.3/bin/clang++ -c -g -c -o -c output -c %/t.cpp -c -std=c++11 -c -DDOOUTPUT
  ```


================
Comment at: test/clang-modernize/Core/SubprocessCompilationDatabaseTest.cpp:2
@@ +1,3 @@
+// First pass using a compilation database is a base line. The next pass using
+// -compile-command and -compile-dir, which should provide the same information
+// as provided with the compilation database, is the real test.
----------------
`-c` and `-d` instead of `-compile-command` and `-compile-dir`.

================
Comment at: test/clang-modernize/Core/SubprocessCompilationDatabaseTest.cpp:10
@@ +9,3 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: clang-modernize -loop-convert %t.cpp -d %T -c /opt/clang-3.3/bin/clang++ -c -g -c -o -c output -c %/t.cpp -c -std=c++11 -c -DDOOUTPUT
+// RUN: FileCheck -input-file=%t.cpp %s
----------------
Did you try when `-c` is also a flag from the compilation database?



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



More information about the cfe-commits mailing list