[PATCH] Introducing initial UseAuto transform

Edwin Vane edwin.vane at intel.com
Sun Feb 17 10:56:31 PST 2013



================
Comment at: test/cpp11-migrate/UseAuto/basic_std_iterator_tests.cpp:1-9
@@ +1,10 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: cpp11-migrate -use-auto %t.cpp -- --std=c++11 -I %S/Inputs
+// RUN: FileCheck -input-file=%t.cpp %s
+#include "my_std.h"
+
+int main(int argc, char **argv) {
+  {
+    std::array<int> C;
+    std::array<int>::iterator I = C.begin();
+    // CHECK: auto I = C.begin();
----------------
Sean Silva wrote:
> I don't really like the idea of committing generated code to source control.
> 
> Could we wire up the build system to generate these files as part of the build?
I could if that's preferred. I was modelling on the dump_ast_matchers.py tool in clang/docs/tools which generates LibASTMatchersReference.html that's committed to source control. Do we already have python scripts that run as part of the build?

================
Comment at: test/cpp11-migrate/UseAuto/gen_basic_std_iterator_tests.py:21-24
@@ +20,6 @@
+]
+print """// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: cpp11-migrate -use-auto %t.cpp -- --std=c++11 -I Inputs
+// RUN: FileCheck -input-file=%t.cpp %s
+#include "my_std.h"
+
----------------
Sean Silva wrote:
> Generated files should usually have a comment at the top saying "this is a generated file" so that people looking at the file are aware of the fact.
k


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

BRANCH
  iter

ARCANIST PROJECT
  clang-tools-extra



More information about the cfe-commits mailing list