Joao Matos
aa4d445c20
Minor code refactoring for re-use.
3 years ago
Fabio Anderegg
a642691348
Call destructor on copied arguments when calling C# method from C++ (MS ABIs only) ( #1685 )
...
* on MS abi call destructor on copy-by-value arguments after call to c# function
* add tests for destructor call on call by value from c++ to c#
* copy-by-value destructor call using Dispose() instead of Internal.dtor to handle destructors in base class
3 years ago
josetr
eb5031bf4c
Format files
3 years ago
Joe Hull
81351632d5
Use WeakReference<T> in NativeToManagedMap to allow finalizers to run. ( #1648 )
4 years ago
Dimitar Dobrev
c84a6c606e
Generate valid C# for independent external specializations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
aab63d0aa3
Generate valid C# for unresolvable base templates
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Joe Hull
eb0d4c15f1
bug fix: When generating the get accessor for a field composed of an embedded array of structs use __GetOrCreateInstance to initialize the managed array wrapper rather than __CreateInstance so that __Instance holds a pointer to the memory allocated for the array in the outer struct rather than an independent copy of that memory.
...
Added a test.
TODO: once allocated, we may want to cache the managed array. Does this
issue exist in other generators as well?
4 years ago
Joao Matos
6671f56803
Add C code generator GenerateClassEvents for common event handling.
5 years ago
Joao Matos
bcc6fd887d
Improve visiting options implementation in CodeGenerator.
5 years ago
Joao Matos
94fffda145
Implement basic visiting behavior in some CodeGenerator overloads.
5 years ago
Joao Matos
5cb683a199
Normalize visiting overloads to be virtual.
5 years ago
Joao Matos
f98829e700
Big update to NAPI generator with initial support for basic examples.
5 years ago
Dimitar Dobrev
0e38947e07
Convert the visiting options to an enum
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Joao Matos
6b53f5828a
Add new VisitQualifiedType overload to visitors.
5 years ago
Joao Matos
11d9f3ba50
Rework Generator interface and add GenerationOutputMode option.
5 years ago
João Matos
9ba53acc11
Refactor CodeGenerator.GenerateMethodSpecifier to allow explicit specifier kind.
5 years ago
Dimitar Dobrev
4e30a41ee8
Correctly align printed information for debugging
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
João Matos
283ba0ea3b
Overall fixes to C++ generation.
5 years ago
Dimitar Dobrev
6fe81fddcc
Remove needless pointer offsets from generated C#
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Joao Matos
c5bcb48cc2
Implement UnresolvedUsingType and UnresolvedUsingTypename.
...
Fixes https://github.com/mono/CppSharp/issues/1235 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
c6ffa9ddf2
Fix the regressed indentation of printed comments
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
6b3cdaffb7
Optimize renaming of declarations named after keywords
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
02955f913d
Added statement visiting to IAstVisitor.
7 years ago
Joao Matos
1eb3b77d42
Fixed extraneous new lines when generating multi-line comments.
7 years ago
Joao Matos
e991a8d3d6
Skip generation of ignored enum items in `CodeGenerator`.
7 years ago
Joao Matos
a0c5dc8349
Added a `CCodeGenerator` class and move `Include` class as `CInclude`.
7 years ago
Dimitar Dobrev
6602841a3c
Fixed the generated C# for const void*& in parameters.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
1ebf418e18
Considered dependent fields when generating internals for types nested in templates.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Rokas Kupstys
9ea1821cb3
Fix debug output not being generated when AST element had no comment.
...
Also debug text cleaning moved to CodeGenerator.cs and is done when printing bindings. New lines are not stripped out, instead each line is prepended with "// DEBUG: ". Now debug info is properly formatted, easy to read and full.
8 years ago
Rokas Kupstys
1165b3020e
Fix debug output breaking generated binding code.
8 years ago
Rokas Kupstys
9c64e443f8
Always generate formatted code.
8 years ago
Joao Matos
f334e447be
Added optional visiting of property accessors.
8 years ago
Joao Matos
09199381c9
CodeGenerator is now an IAstVisitor.
8 years ago
Dimitar Dobrev
5ca93458a2
Fixed the generation of internals for template specialisations.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Joao Matos
61b0cc6d8b
Re-order usings.
8 years ago
Joao Matos
043aeb534b
[generator] Do not generated unformatted code if debug mode is enabled.
8 years ago
Kimon Topouzidis
910304b702
Removed leftovers in the comments from unsupported custom xml tags. ( #912 )
8 years ago
Kimon Topouzidis
d7c8a61ecc
Manipulated comments to avoid duplication of summary block. ( #876 )
...
Fixes #759 Works around: https://bugs.llvm.org/show_bug.cgi?id=33333
8 years ago
Joao Matos
2670d47eb1
Added IAstVisited implementation to code generator.
8 years ago
Joao Matos
9b277c15b4
Added generator name parameter to file preamble generation.
8 years ago
Dimitar Dobrev
e0c397d709
Collected internal functions of class template specialisations.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
c7040fc242
Fixed a crash when generating C# for empty enums.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
ec6ddb62cf
Restored the new line after the last generated item of an enum.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Joao Matos
8b2b260d16
Fixed visitor regression when visiting declaration contexts.
9 years ago
Joao Matos
f70d1d0165
Unify class method specifier code generation.
9 years ago
Joao Matos
157da89ed5
Unify class specifier code generation.
9 years ago
Joao Matos
9a42bbecf5
Added CodeGenerator.AccessIdentifier instance method.
9 years ago
Joao Matos
8203515c5b
Move C# code generation helpers to base code generator.
9 years ago
Joao Matos
a5728225d8
Do not use blocks for enum items as NewLineKind.Never is buggy.
9 years ago
Joao Matos
76d1145ed4
Use object initializer syntax instead of explicit adds.
9 years ago