diff options
| author | Feix Weiglhofer <9267733+fweig@users.noreply.github.com> | 2020-01-24 21:32:32 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-01-24 15:32:32 -0500 |
| commit | a4a93306482c4f7c331a2e8b7ecd5a1e5c56bf69 (patch) | |
| tree | 8f98e53881d533d6d95978cdaaa090d1a3f059d8 /src | |
| parent | aa75df36df4a49557d5ea81b9bc256b227d6cd98 (diff) | |
| download | zig-a4a93306482c4f7c331a2e8b7ecd5a1e5c56bf69.tar.gz zig-a4a93306482c4f7c331a2e8b7ecd5a1e5c56bf69.zip | |
translate-c: Don't make const parameters mutable. (#4273)
* translate-c: Remove arg-prefix from const parameters.
* translate-c: Add unittest for const parameters.
Diffstat (limited to 'src')
| -rw-r--r-- | src/zig_clang.cpp | 4 | ||||
| -rw-r--r-- | src/zig_clang.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp index 348c85b87b..8a1baa2d49 100644 --- a/src/zig_clang.cpp +++ b/src/zig_clang.cpp @@ -1625,6 +1625,10 @@ unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionD return 0; } +ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self) { + return bitcast(reinterpret_cast<const clang::ParmVarDecl *>(self)->getOriginalType()); +} + const ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const ZigClangRecordDecl *zig_record_decl) { const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordDecl *>(zig_record_decl); const clang::RecordDecl *definition = record_decl->getDefinition(); diff --git a/src/zig_clang.h b/src/zig_clang.h index 6f8d786bf6..f7de9c2cee 100644 --- a/src/zig_clang.h +++ b/src/zig_clang.h @@ -866,6 +866,8 @@ ZIG_EXTERN_C const char* ZigClangVarDecl_getSectionAttribute(const struct ZigCla ZIG_EXTERN_C unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, const ZigClangASTContext* ctx); ZIG_EXTERN_C unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionDecl *self, const ZigClangASTContext* ctx); +ZIG_EXTERN_C struct ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self); + ZIG_EXTERN_C bool ZigClangRecordDecl_getPackedAttribute(const struct ZigClangRecordDecl *); ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const struct ZigClangRecordDecl *); ZIG_EXTERN_C const struct ZigClangEnumDecl *ZigClangEnumDecl_getDefinition(const struct ZigClangEnumDecl *); |
