2012/12/5 Dmitri Gribenko <[email protected]>:
> Author: gribozavr
> Date: Tue Dec  4 09:13:46 2012
> New Revision: 169276
>
> URL: http://llvm.org/viewvc/llvm-project?rev=169276&view=rev
> Log:
> libclang: Add a function to libclang for retrieving the bit width value
>
> Patch by Jyun-Yan You.

> Modified: cfe/trunk/tools/c-index-test/c-index-test.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=169276&r1=169275&r2=169276&view=diff
> ==============================================================================
> --- cfe/trunk/tools/c-index-test/c-index-test.c (original)
> +++ cfe/trunk/tools/c-index-test/c-index-test.c Tue Dec  4 09:13:46 2012
> @@ -1134,6 +1134,23 @@
>    return CXChildVisit_Recurse;
>  }
>
> +/******************************************************************************/
> +/* Bitwidth testing.                                                         
>  */
> +/******************************************************************************/
> +
> +static enum CXChildVisitResult PrintBitWidth(CXCursor cursor, CXCursor p,
> +                                             CXClientData d) {
> +  if (clang_getCursorKind(cursor) != CXCursor_FieldDecl)
> +    return CXChildVisit_Recurse;
> +
> +  int Bitwidth = clang_getFieldDeclBitWidth(cursor);

It's not C89-compliant. Fixed in r169277

> +  if (Bitwidth >= 0) {
> +    PrintCursor(cursor, NULL);
> +    printf(" bitwidth=%d\n", Bitwidth);
> +  }
> +
> +  return CXChildVisit_Recurse;
> +}
>
>  
> /******************************************************************************/
>  /* Loading ASTs/source.                                                      
>  */
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to