Skip to content

Commit

Permalink
fix: resolve elaborated types
Browse files Browse the repository at this point in the history
  • Loading branch information
janvennemann committed Nov 18, 2023
1 parent 6e9eae7 commit 3f435e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/hyperloop-ios-metabase/src/def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ namespace hyperloop {
if (type.kind == CXType_Typedef) {
type = clang_getCanonicalType(type);
}
// resolve elaborated to named type
if (type.kind == CXType_Elaborated) {
type = clang_Type_getNamedType(type);
}
typeSpelling = CXStringToString(clang_getTypeSpelling(type));
setType(hyperloop::CXTypeToType(type));
if (this->type != "block") {
Expand All @@ -105,7 +109,7 @@ namespace hyperloop {
}

Type::Type (CXCursor cursor, ParserContext *context) : Type(resolveCursorType(cursor), context) {
auto type = clang_getCursorType(cursor);
auto type = resolveCursorType(cursor);
if (type.kind == CXType_Typedef && this->getType() == "record") {
auto tree = this->context->getParserTree();
// we blindly assume that all structs have a typedef name without underscore prefix
Expand Down

0 comments on commit 3f435e4

Please sign in to comment.