[PATCH] clang-c: Add clang_getTypeSpelling()

Dmitri Gribenko gribozavr at gmail.com
Fri Feb 15 11:47:36 PST 2013


  Could you rename `test/Index/print-typekind.c` and `test/Index/print-typekind.m` to `print-type.c` and `print-type.m`?  Also, please merge `test/Index/vector-types.c` to `test/Index/print-typekind.c` -- vector-types is a very small test.

  LGTM with all that.


================
Comment at: tools/c-index-test/c-index-test.c:1091-1094
@@ +1090,6 @@
+
+static void PrintTypeForMode(
+  CXType T,
+  PrintTypeMode mode,
+  const char *fmt) {
+  CXString S;
----------------
There is a bit too much abstraction, IMHO.  It could be simplified to:

```static void PrintTypeAndTypeKind(CXType T, const char *Fmt)```

and call it like this:

```PrintTypeAndTypeKind(T, "[type=%s] [typekind=%s]")```

================
Comment at: test/Index/print-type.c:3
@@ +2,3 @@
+int *p;
+int *f(int *p, char *x, FooType z) {
+  const FooType w = z;
----------------
Adding `int p[5], void y(int)` as parameters would make a more interesting test.


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



More information about the cfe-commits mailing list