[clang] [libclang] Add API to query more information about base classes. (PR #120300)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 10 05:59:09 PST 2025
================
@@ -3771,6 +3771,12 @@ CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T);
*/
CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor);
+/**
+ * Returns the offset in bits of a CX_CXXBaseSpecifier relative to the parent
+ * class.
+ */
+CINDEX_LINKAGE long long clang_getOffsetOfBase(CXCursor Parent, CXCursor Base);
----------------
AaronBallman wrote:
Naively, I would have expected this to return a `size_t`. But I see you return `-1` to mean there's an error; you should document that. But should we return a `size_t` regardless and say that `~0U` is returned on error?
https://github.com/llvm/llvm-project/pull/120300
More information about the cfe-commits
mailing list