deadlocklogic
9071cd2a59
Implement ClassTemplatePartialSpecialization::Parameters ( #1809 )
...
* Implement ClassTemplatePartialSpecialization::Parameters
* Template.cs: Implement ClassTemplatePartialSpecialization.Parameters
* GeneratorKind: fix bug introduced while migrating from enum to class
* Implement native ClassTemplatePartialSpecialization.Parameters + ASTConverter
* regenerated bindings (#1813 )
* regenerated bindings
* regenerated bindings after rebase
* Directory.Build.props: support C# 10.0
* Implement native ClassTemplatePartialSpecialization.Parameters + ASTConverter
* Regenerated bindings
* TestAST.cs: add TestASTClassTemplatePartialSpecialization
2 years ago
deadlocklogic
e068f2a14a
Typemap cleanup ( #1802 )
...
* TypeMap: prepare refactoring into a modular design
* TypeMap: refactor C++ backend into common methods
* TypeMap: refactor CLI backend into common methods
* CLI.Gen.cs: fix omitted typemap from previous commit
* Common.Gen.cs: fixed silly modification while testing
* GeneratorKind: add FindGeneratorKindByID method
* TypeMapDatabase: heavy refactor: group typemaps by GeneratorKind
* TypeMap: refactor CSharp backend into common methods + migration
* TypeMap: cleanup patches from previous commits
* TypeMapDatabase: fix passing GeneratorKind to FindTypeMap calls
* Stdlib.CSharp.cs: move std::map typemap from Stdlib.CLI.cs
* TypeMapDatabase: improve parameter name
2 years ago
Stefan
b14038ab07
Value types may generate `Dispose` ( #1787 )
2 years ago
Stefan
a5afda8603
Fix parameterless constructors not being generated for structs ( #1783 )
...
* Fix parameterless constructors not being generated for structs
* Fix implicit non-trivial default ctor
* Adjust `Ignore` linked issue
2 years ago
Stefan
b16e809b9e
Introduce `GenerateFreeStandingFunctionsClassName` option ( #1782 )
...
* Introduce `GenerateFreeStandingFunctionsClassName` option
* Support CLI and fixes
2 years ago
Stefan
03874e743f
Fix Value Type String Member Invalid Codegen ( #1778 )
...
* Fix code generation
* Generate exception on broken struct set op
* Remove redundant usings
2 years ago
Salvage
28000a14b4
Fix #1251 three parameter equality operator
...
- Operators in generic classes do not attempt to generate as extension methods anymore
- Empty `...Extensions` classes are no longer generated
- `string` as a template argument is correctly cast
- `MarshalCharAsManagedChar` option also generates correct casts
- Suppress warning regarding returning struct field by ref
- Eliminate some tabs that snuck into the test C++ header
2 years ago
Salvage
7f567b604b
Fix non-void returning functions with value-type out parameters
...
Also fixes indentation
2 years ago
Salvage
20950c5a34
More stringent test; Fix indentation (of the code itself, not in the generator)
2 years ago
Salvage
ebe6b8a415
Fix value type out parameters
2 years ago
Joao Matos
17102021cc
Add Method.IsVolatile property.
...
Fixes https://github.com/mono/CppSharp/issues/1761
2 years ago
Trung Nguyen
ce3d04abd7
CSharpSources: Dereference pointer variables ( #1753 )
...
Dereference pointers when generating getters for pointer variables.
Otherwise, the managed instance would point to the pointer itself
rather than the object at the native instance's address.
2 years ago
Trung Nguyen
add3aba684
CSharp: More default parameter fixes ( #1747 )
...
- Expression generation for `ConstructorReference` now also recursively
calls `VisitExpression` for the argument if only one argument is
detected. This allows correct overload generation for functions taking
a variable as the default parameter value.
- Default parameters of pointer-to-enumeration types are now correctly
generated similar to primitive types.
2 years ago
Trung Nguyen
1ce9cb7e7f
CSharpExpressionPrinter: Recurse into operands ( #1745 )
...
* CSharpExpressionPrinter: Recurse into operands
Recursively call `VisitExpression` on the LHS and RHS of a binary
operator expression. This fixes the generation for complex default
parameters involving things other than two enumeration members.
* CSharpSources: Use `const` when possible
Generate `const` instead of `static` members when possible.
This allows generated members to be used when compile-time constants are
required, such as default parameters.
2 years ago
Trung Nguyen
169f8686a9
CSharpExpressionPrinter: Wrap expression in parenthesis ( #1741 )
...
Wrap default parameter expressions in parentheses to ensure whole expressions are casted instead of only the first operand.
2 years ago
João Matos
4417dd987a
Code cleanups and improvements ( #1713 )
...
* Code cleanups.
* Run GetterSetterToPropertyPass for more generators.
* Fixed compile warning when compiling parser bindings.
* Cleanup driver code.
* Remove dead 32-bit code.
* Reduce verbosity when Options.Quiet is set.
* Remove test compile-time warnings.
* Move .NET tests to tests/dotnet.
* Remove unused AST viewer code and premake-qt submodule.
* Move tests2/ contents to tests/.
2 years ago
josetr
567a0df8c7
Fix FunctionToInstanceMethod
3 years ago
josetr
fd058db061
Rename tests
3 years ago
josetr
e160b3a296
Add generate function template specializations whitelist
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
060afd53fc
Add partial `ref` param support
3 years ago
josetr
17f69fdf64
Add test for function templates
3 years ago
josetr
0d92eaef16
Use TemplatedDecl.Parameters cuz Class.TemplateParameters may not be available at this point
3 years ago
josetr
06d311dc89
Fix anonymous unions inside template classes
3 years ago
josetr
37bd7e0155
Add `GenerateNativeToManaged` per-class option
3 years ago
josetr
3414294ab8
Fix FunctionToStaticMethod bug
3 years ago
josetr
eb5031bf4c
Format files
3 years ago
Joe Hull
1edd5ee5ee
Avoid ArgumentOutOfRangeException in ExpressionHelper.CheckForString ( #1649 )
3 years ago
Joe Hull
81351632d5
Use WeakReference<T> in NativeToManagedMap to allow finalizers to run. ( #1648 )
3 years ago
Dimitar Dobrev
1acb23813d
Generate valid C# for independent specialisations with nested fields
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
f1915b3066
Generate valid C# for templates with external specializations only
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
9b90f1c77b
Generate valid C# for nested in external specializations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
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
3b0eb1800c
Generate valid C# for nested 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
Dimitar Dobrev
69e766be5d
Generate valid C# for classes with dependent fields nested in templates with independent fields
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
a69f6d1d6d
Generate valid C++ for specialisations with void
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
5552f2b484
Generate valid C# for pure functions returning or taking dependent pointers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Ahmed Elsayed
caaf89d34a
Fix a crash when processing templates with variable arguments ( #1641 )
4 years ago
Dimitar Dobrev
0d84877068
Simplify code by not specially handling void**
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
634c231853
Generate valid C# for unions in templates with non-type args
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
540c16576f
Fix a test for the new msvc in vs 2022
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
0b8f252d1b
Generate valid C# for fields with types system template specializations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
ad6557792f
Simplify handling of initialisation of variables
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
132ed7e25b
Generate valid C# for variables which use float
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
ac5001ddca
Generate valid C# for variables with > 1 arg
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
9a17dbee1b
Generate valid C++ for variadic functions
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
5e328da9e7
Fix C# layouts for classes with nameless unions
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
5a21a7facd
Generate valid C# for copy ctors with extra args
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
50cba5552c
Generate valid C# for destructors of templates with dependent fields
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago