[cfe-commits] [PATCH] [cindex.py] Allow to configure the path of libclang

Gregory Szorc gregory.szorc at gmail.com
Mon Sep 3 10:29:30 PDT 2012


I like it! This is much needed.

My initial thoughts were that the Config class is a bit heavyweight. IMO 
a module-level function to force reload the global lib instance to point 
to a different library would be sufficient. But, thinking it through, 
I'm not sure how this could be done without making things weird. The 
best I can think of is that at module load time it would attempt to find 
a library. If it doesn't, lib is None and the first use of functionality 
results in an opaque message about None not having some attribute. If 
someone wished to point to a non-default path, they could import the 
module and call a function which replaced the module variable "lib." 
But, this is essentially what you have coded in the Config class. So, I 
guess the extra complexity is warranted. That being said, I'm not 
convinced a class is needed (a few module-level functions and variable 
would suffice, IMO). But, I don't feel too strongly, so LGTM.

On 8/31/2012 4:18 AM, Tobias Grosser wrote:
> Hi,
>
> I would like to commit the following patch:
>
> ---------------------------------------------------------------------
> [cindex.py] Allow to configure the path of libclang
>
> By calling cindex.Config.set_library_path(path) or 
> cindex.Config.set_library_file(file) it is possible to specify from 
> where we load libclang. This fixes an open FIXME.
> ---
>  bindings/python/clang/cindex.py |  315 
> +++++++++++++++++++++++----------------
>  1 file changed, 183 insertions(+), 132 deletions(-)
> ---------------------------------------------------------------------
>
> Any comments or concerns?
>
> Tobi
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

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


More information about the cfe-commits mailing list