Diff Detail
Event Timeline
The code owners file says you are the owner of all parts that do not belong to somebody else. So i hope it is ok if i attach you as reviewer to this.
include/clang-c/Index.h | ||
---|---|---|
3815–3823 | It might be better to combine these into a single function (getLocalVarKind?) returning an enum { not local, non-static local, static local }. |
include/clang-c/Index.h | ||
---|---|---|
3815–3823 | Combining these into one function with an enum is much more work when porting to python (which is also den in this patch). Therefore unless there are reasons beyond stylistic ones i'd prefer to keep them separate. IMHO this also increases the friendliness as you can directly infer from the documentation at http://clang.llvm.org/doxygen/ what they should do as they just forward the calls.. |
Argyrios, I'd appreciate your thoughts here.
tools/libclang/CIndex.cpp | ||
---|---|---|
6670–6694 | I don't think the names of these are really specific enough for what they do. As members of VarDecl, they're good enough, but as operations on a general Cursor, it's less so. For instance, temporary objects in C++ might also have local storage or be static locals. Renaming isStaticLocal to isStaticLocalVar would help. hasLocalStorage is not really a very user-friendly name for this functionality, even though it currently matches our C++ API (the C API has long-term stability guarantees whereas the C++ API does not, so we need to take more care when naming C API functions, even though matching the C++ API does generally make the C API more user-friendly). isStaticLocalVar versus isNonStaticLocalVar might be better if you don't want to go the enum route. |
No longer export two functions but only one.
On further thought I only need the information is the variable was declared local or not. I don't really need the information where the storage ultimately is.
Added python and libclang tests.
It might be better to combine these into a single function (getLocalVarKind?) returning an enum { not local, non-static local, static local }.