diff options
Diffstat (limited to 'src/zig_clang.cpp')
| -rw-r--r-- | src/zig_clang.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp index c5ea182e87..ca93634aab 100644 --- a/src/zig_clang.cpp +++ b/src/zig_clang.cpp @@ -1615,6 +1615,16 @@ unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, return 0; } +unsigned ZigClangFieldDecl_getAlignedAttribute(const struct ZigClangFieldDecl *self, const ZigClangASTContext* ctx) { + auto casted_self = reinterpret_cast<const clang::FieldDecl *>(self); + auto casted_ctx = const_cast<clang::ASTContext *>(reinterpret_cast<const clang::ASTContext *>(ctx)); + if (const clang::AlignedAttr *AA = casted_self->getAttr<clang::AlignedAttr>()) { + return AA->getAlignment(*casted_ctx); + } + // Zero means no explicit alignment factor was specified + return 0; +} + unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionDecl *self, const ZigClangASTContext* ctx) { auto casted_self = reinterpret_cast<const clang::FunctionDecl *>(self); auto casted_ctx = const_cast<clang::ASTContext *>(reinterpret_cast<const clang::ASTContext *>(ctx)); |
