[cfe-commits] PATCH: Update the python bindings with MACRO_EXPANSION "enum"

Douglas Gregor dgregor at apple.com
Fri Jul 15 07:47:58 PDT 2011


On Jul 14, 2011, at 11:58 PM, Chandler Carruth wrote:

> On Thu, Jul 14, 2011 at 11:55 PM, Tobias Grosser <tobias at grosser.es> wrote:
> On 07/15/2011 08:47 AM, Chandler Carruth wrote:
> It helps to attach the patch....
> 
> On Thu, Jul 14, 2011 at 10:52 PM, Chandler Carruth <chandlerc at google.com
> <mailto:chandlerc at google.com>> wrote:
> 
>    I know next to nothing about the python bindings or how to test
>    them, but I think this is the right patch. If someone who
>    understands how this works can confirm, I'll commit...
> 
> 
> 
> python-cindex-expansion.patch
> 
> 
> diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
> index 8cadcaa..a8d6ec6 100644
> --- a/bindings/python/clang/cindex.py
> +++ b/bindings/python/clang/cindex.py
> @@ -558,6 +558,7 @@ CursorKind.IB_OUTLET_COLLECTION_ATTR = CursorKind(403)
>  # Preprocessing
>  CursorKind.PREPROCESSING_DIRECTIVE = CursorKind(500)
>  CursorKind.MACRO_DEFINITION = CursorKind(501)
> +CursorKind.MACRO_EXPANSION = CursorKind(502)
>  CursorKind.MACRO_INSTANTIATION = CursorKind(502)
> 
> This does not seem correct to me. MACRO_EXPENSION and MACRO_INSTANTIATION have both the number 502.
> 
> That's correct. INSTANTIATION is becoming EXPANSION. See my patch to libclang. There, we retain the old enum name (MACRO_INSTANTIATION) with the same value as a compatibility alias. That way existing code won't break.
> 
> If that approach isn't appropriate for the Python bindings, I'll just nuke the old name... wasn't sure what the best approach was here.

It's fine just to nuke the old name in the Python bindings. Nobody depends on them, as far as I know.

Patch looks good, thanks for being thorough!

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110715/86c874d8/attachment.html>


More information about the cfe-commits mailing list