[PATCH] D11797: [libclang] Expose the ElaboratedType
Brian Gesiak via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 7 16:34:56 PDT 2015
modocache added a subscriber: modocache.
================
Comment at: bindings/python/clang/cindex.py:1875
@@ -1873,1 +1874,3 @@
+ def getElabaratedTypeUnderlyingType(self):
+ """
----------------
Awesome, thanks for updating the Python bindings as well!
As with the C function, I believe this is a typo--shouldn't it be `getElaboratedTypeUnderlyingType`?
Furthermore, the convention in Python (and in this file) is to use snake_case, so this should probably be `get_elaborated_type_underlying_type`.
================
Comment at: include/clang-c/Index.h:2859
@@ -2859,1 +2858,3 @@
+ CXType_MemberPointer = 117,
+ CXType_Elaborated = 118
};
----------------
Tangential to this diff, but is there a reason these `CXTypeKind` enum values are undocumented? I can see how many would be familiar to most users, but I don't think "elaborated" is something that many users would immediately recognize. Should these be documented?
================
Comment at: include/clang-c/Index.h:3224
@@ -3222,1 +3223,3 @@
/**
+ * \brief Return the inner type of elaborated type
+ *
----------------
nit: Other `\brief` documentation in this file uses periods at the end of sentences. For example, `clang_getArraySize`, the function immediately prior to this newly added function, has the brief `-\brief Return the array size of a constant array.`--notice the trailing period.
================
Comment at: include/clang-c/Index.h:3226
@@ +3225,3 @@
+ *
+ * If a non-elaborated type passed, CXType_Invalid type returned
+ */
----------------
nit: Rather than reference the `CXType_Invalid` type directly, most of the other documentation in this file states `"an invalid type is returned."`
================
Comment at: include/clang-c/Index.h:3228
@@ +3227,3 @@
+ */
+CXType clang_getElabaratedTypeUnderlyingType(CXType T);
+
----------------
I believe this is a typo--shouldn't it be `clang_getElaboratedTypeUnderlyingType`?
================
Comment at: tools/libclang/CXType.cpp:987
@@ +986,3 @@
+ if (TP && TP->getTypeClass() == Type::Elaborated)
+ return MakeCXType(cast<ElaboratedType>(TP)->getNamedType(), GetTU(CT));
+
----------------
The documentation of `getNamedType()` itself states `"Retrieve the type named by the qualified-id."`. As such, would it make sense to call this function `clang_getNamedTypeUnderlyingElaboratedType`, instead of `clang_getElaboratedTypeUnderlyingType`?
http://reviews.llvm.org/D11797
More information about the cfe-commits
mailing list