diff options
Diffstat (limited to 'src/zig_clang.cpp')
| -rw-r--r-- | src/zig_clang.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp index 223dc29067..bd06ead4b0 100644 --- a/src/zig_clang.cpp +++ b/src/zig_clang.cpp @@ -1941,10 +1941,7 @@ const char* ZigClangVarDecl_getSectionAttribute(const struct ZigClangVarDecl *se bool ZigClangRecordDecl_getPackedAttribute(const ZigClangRecordDecl *zig_record_decl) { const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordDecl *>(zig_record_decl); - if (record_decl->getAttr<clang::PackedAttr>()) { - return true; - } - return false; + return record_decl->hasAttr<clang::PackedAttr>(); } unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, const ZigClangASTContext* ctx) { @@ -1985,6 +1982,16 @@ unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionD return 0; } +bool ZigClangVarDecl_getPackedAttribute(const struct ZigClangVarDecl *self) { + auto casted_self = reinterpret_cast<const clang::VarDecl *>(self); + return casted_self->hasAttr<clang::PackedAttr>(); +} + +bool ZigClangFieldDecl_getPackedAttribute(const struct ZigClangFieldDecl *self) { + auto casted_self = reinterpret_cast<const clang::FieldDecl *>(self); + return casted_self->hasAttr<clang::PackedAttr>(); +} + ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self) { return bitcast(reinterpret_cast<const clang::ParmVarDecl *>(self)->getOriginalType()); } |
