diff options
| author | Evan Haas <evan@lagerdata.com> | 2021-06-18 17:36:50 -0700 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-06-23 08:44:25 +0300 |
| commit | 0e7897a9a2e8dff1ce869b78d5b6fda56f86bb05 (patch) | |
| tree | ee37a14f5b1d6a7a06eb5860d87d3eda9403035d /src/zig_clang.cpp | |
| parent | d1f99eabb745a3026b4bf0486ee542d38facee8b (diff) | |
| download | zig-0e7897a9a2e8dff1ce869b78d5b6fda56f86bb05.tar.gz zig-0e7897a9a2e8dff1ce869b78d5b6fda56f86bb05.zip | |
translate-c: Remove usage of `extern enum`
Translate enum types as the underlying integer type. Translate enum constants
as top-level integer constants of the correct type (which does not necessarily
match the enum integer type).
If an enum constant's type cannot be translated for some reason, omit it.
See discussion https://github.com/ziglang/zig/issues/2115#issuecomment-827968279
Fixes #9153
Diffstat (limited to 'src/zig_clang.cpp')
| -rw-r--r-- | src/zig_clang.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp index 8a60a1210e..7c923021d8 100644 --- a/src/zig_clang.cpp +++ b/src/zig_clang.cpp @@ -3228,12 +3228,6 @@ bool ZigClangEnumDecl_enumerator_iterator_neq( return casted_a != casted_b; } -const struct ZigClangExpr *ZigClangEnumConstantDecl_getInitExpr(const struct ZigClangEnumConstantDecl *self) { - auto casted = reinterpret_cast<const clang::EnumConstantDecl *>(self); - const clang::Expr *result = casted->getInitExpr(); - return reinterpret_cast<const ZigClangExpr *>(result); -} - const struct ZigClangAPSInt *ZigClangEnumConstantDecl_getInitVal(const struct ZigClangEnumConstantDecl *self) { auto casted = reinterpret_cast<const clang::EnumConstantDecl *>(self); const llvm::APSInt *result = &casted->getInitVal(); |
