[C++] support native_inline attribute for vector of tables (#7479)

This commit is contained in:
sssooonnnggg
2022-08-30 03:48:10 +08:00
committed by GitHub
parent 694add668b
commit 6a87427540
8 changed files with 347 additions and 24 deletions

View File

@@ -464,6 +464,10 @@ inline bool IsStruct(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && type.struct_def->fixed;
}
inline bool IsTable(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && !type.struct_def->fixed;
}
inline bool IsUnion(const Type &type) {
return type.enum_def != nullptr && type.enum_def->is_union;
}
@@ -476,6 +480,14 @@ inline bool IsVector(const Type &type) {
return type.base_type == BASE_TYPE_VECTOR;
}
inline bool IsVectorOfStruct(const Type& type) {
return IsVector(type) && IsStruct(type.VectorType());
}
inline bool IsVectorOfTable(const Type& type) {
return IsVector(type) && IsTable(type.VectorType());
}
inline bool IsArray(const Type &type) {
return type.base_type == BASE_TYPE_ARRAY;
}