Attached is a revised version of the patch that addresses the issues raised by Argyrios. This version of the patch is against SVN revision 145776. How does this version look? Is there anything I need to sign off on in order to get this patch integrated upstream? Thanks again for the feedback.<br>
<br>-Joe<br><br><div class="gmail_quote">On Wed, Nov 30, 2011 at 4:28 PM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:kyrtzidis@apple.com">kyrtzidis@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div>Looks great!</div><div><br></div><div>Some nitpicking:</div><div><br></div><div><blockquote type="cite"><div><font color="#000000">+  QualType T = GetQualType(X);</font></div><div>
<font color="#000000">+  if (!T.getTypePtrOrNull())</font></div><div><font color="#000000">+    return 0;</font></div><div><font color="#000000">+</font></div></blockquote><br></div><div>Why not "if (T.isNull())" ? This applies to the other uses as well.</div>
<div><br></div><div><blockquote type="cite"><div><font color="#000000">+CINDEX_LINKAGE CXType clang_getArgType(CXType T, long long i);</font></div></blockquote><br></div><div>Any reason not making this "unsigned i" ?</div>
<div><br></div><div>Could you also add tests in test/Index, to make sure the new cursors are created correctly ?</div><div><br></div><div>-Argyrios</div><div><div class="h5"><div><br></div><div>On Nov 20, 2011, at 12:27 PM, Joe Groff wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5">Hi everyone. Here's a patch that adds some more functionality to libclang to query various types. I'd like to get some feedback. The patch is against svn revision 145002. It adds the following features:<div>
<br></div>


<div>- Exposes a CXType_Vector type kind for vector types.</div><div>- Adds generalized versions of the clang_getArrayElementType and clang_getArraySize functions, named clang_getElementType and clang_getNumElements, which work on array, vector, or complex types. This was the API change recommended in an earlier thread: <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110926/046899.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110926/046899.html</a> . I left the clang_getArray* functions for source compatibility.</div>


<div>- Adds additional functions for querying function types. clang_isFunctionTypeVariadic returns true if a function type is variadic. clang_getFunctionCallingConv returns an enumeration value indicating the calling convention of the function type. clang_getNumArgTypes returns the number of static argument types, and clang_getArgType gets the type of an argument.</div>

<div>- Adds a clang_getTypedefDeclUnderlyingType function to get the underlying type from a TypedefDecl cursor.</div><div>- Adds a clang_getEnumDeclIntegerType function to get the integer type from an EnumDecl cursor.</div>

<div>- Adds clang_getEnumConstantDeclValue and clang_getEnumConstantDeclUnsignedValue functions to get the value of an EnumConstantDecl as a signed or unsigned long long, respectively.</div><div>- Exposes a CXCursor_AsmLabelAttr cursor kind for __asm__("label") attributes.</div>

<div>- Alters clang_getCursorSpelling to return the label value for AsmLabelAttr-kind cursors.</div><div><br></div><div>Let me know if there are any API or functionality changes I should make. Thanks for the feedback.</div>

<div><br></div><div>-Joe</div>
</div></div><span><145002-libclang-complex-vector-function-enum-type-information.diff></span>_______________________________________________<div class="im"><br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></div></blockquote></div><br></div></blockquote></div><br>