diff options
| author | hryx <codroid@gmail.com> | 2019-05-27 14:38:09 -0700 |
|---|---|---|
| committer | hryx <codroid@gmail.com> | 2019-05-27 14:38:09 -0700 |
| commit | 3bbee1ba2e758d4bb5ea7d03b27133ffd6e4e9e2 (patch) | |
| tree | da67b9310923766c57b764b38c8325035e953991 /src | |
| parent | 9c437f90327880a195f1090f726118a8f6742bc6 (diff) | |
| download | zig-3bbee1ba2e758d4bb5ea7d03b27133ffd6e4e9e2.tar.gz zig-3bbee1ba2e758d4bb5ea7d03b27133ffd6e4e9e2.zip | |
expr: BitCast for ImplicitCastExpr
Diffstat (limited to 'src')
| -rw-r--r-- | src/zig_clang.cpp | 17 | ||||
| -rw-r--r-- | src/zig_clang.h | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp index 6077878b29..2edfda8efa 100644 --- a/src/zig_clang.cpp +++ b/src/zig_clang.cpp @@ -1920,7 +1920,22 @@ const struct ZigClangStringLiteral *ZigClangPredefinedExpr_getFunctionName( return reinterpret_cast<const struct ZigClangStringLiteral *>(result); } +ZigClangSourceLocation ZigClangImplicitCastExpr_getBeginLoc(const struct ZigClangImplicitCastExpr *self) { + auto casted = reinterpret_cast<const clang::ImplicitCastExpr *>(self); + return bitcast(casted->getBeginLoc()); +} + enum ZigClangCK ZigClangImplicitCastExpr_getCastKind(const struct ZigClangImplicitCastExpr *self) { - auto casted = reinterpret_cast<const clang::CastExpr *>(self); + auto casted = reinterpret_cast<const clang::ImplicitCastExpr *>(self); return (ZigClangCK)casted->getCastKind(); } + +const struct ZigClangExpr *ZigClangImplicitCastExpr_getSubExpr(const struct ZigClangImplicitCastExpr *self) { + auto casted = reinterpret_cast<const clang::ImplicitCastExpr *>(self); + return reinterpret_cast<const struct ZigClangExpr *>(casted->getSubExpr()); +} + +struct ZigClangQualType ZigClangArrayType_getElementType(const struct ZigClangArrayType *self) { + auto casted = reinterpret_cast<const clang::ArrayType *>(self); + return bitcast(casted->getElementType()); +} diff --git a/src/zig_clang.h b/src/zig_clang.h index d6d193223b..0afe30c474 100644 --- a/src/zig_clang.h +++ b/src/zig_clang.h @@ -870,6 +870,10 @@ ZIG_EXTERN_C const char *ZigClangStringLiteral_getString_bytes_begin_size(const ZIG_EXTERN_C const struct ZigClangStringLiteral *ZigClangPredefinedExpr_getFunctionName( const struct ZigClangPredefinedExpr *self); +ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangImplicitCastExpr_getBeginLoc(const struct ZigClangImplicitCastExpr *); ZIG_EXTERN_C enum ZigClangCK ZigClangImplicitCastExpr_getCastKind(const struct ZigClangImplicitCastExpr *); +ZIG_EXTERN_C const struct ZigClangExpr *ZigClangImplicitCastExpr_getSubExpr(const struct ZigClangImplicitCastExpr *); + +ZIG_EXTERN_C struct ZigClangQualType ZigClangArrayType_getElementType(const struct ZigClangArrayType *); #endif |
