Dimitar Dobrev
9880ff9799
Ported the C# generator to Roslyn.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
f7b4d6ce83
Fixed the wrapping of operators for non-equality to handle null.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
477dd914cb
Fixed setters of indexers when the key is type-mapped.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
1c52e67bb8
Fixed the wrapping of indexers returning value types.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
a18479e1db
Generated valid code for wrapping char arrays.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
5dde771d77
Removed a redundant field in the generated code.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
c2a569e24d
Only patched the v-table entries for non-dtors in user-derived classes.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
2885200732
Changed the native ctor to only patch the v-table entry of the virtual dtor, if any.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
8ebefa1f37
Added support for call expressions in default args.
...
The conversion of an expression to a string has been moved to the generator because a function may have been renamed or converted to a property.
However, since that string is language-specific, it should be created in the generator anyway. Therefore we should (over time):
1. Move any string manipulation from the pass for default args to the printer for expressions which is in turn used only by the generator;
2. Remove the Statement.String property (when 1. is entirely complete).
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
8a68d2d16c
Fixed the generation of overrides of virtuals from secondary bases.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
53074cca58
Simplified the fix for calling the dtor of an abstract type with MinGW.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
e4a40d0eed
Revert "Fixed a crash when calling the dtor of an abstract type with MinGW."
...
This reverts commit 67e6e1204c
.
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
176262c700
Clarified the handling of dtor calls when abstract classes are involved.
...
Thanks to tritao for his remarks.
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
67e6e1204c
Fixed a crash when calling the dtor of an abstract type with MinGW.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
05a44565bd
Ensured a virtual dtor is called even if the base dtor is not virtual.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
fbb2f941c4
Based on Abhinav Tripathi's work: extracted delegates in order to reuse them.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
0f8474893c
Removed 3 redundant fields from the C# generator.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
3cb44dcef0
Split the creation of internal parameters from their string representation.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
0950b869a1
Fixed the offsets of fields when using multiple inheritance.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
6380e5d7ea
Called Marshal.FreeHGlobal only if the instance was created by Marshal.AllocHGlobal.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
6f8c942b0a
Adjusted pointers when calling functions from secondary or non-dynamic bases.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
7d66303ed1
Extracted a constant and deleted a no longer used method.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
81e6ba5ea8
Ensured managed v-tables remain with no empty entries.
...
This doesn't fix any bug that I know of.
However, the patching was obviously wrong for v-tables with repetitive function pointers.
Their managed counterparts ended up with "holes" where the repetions were.
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
324e241c25
Fixed the internal abstract impls with default params of a pointer type.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
54e8a16fd1
Reverted the representation of Booleans as managed Booleans except in internal structs.
...
Managed booleans are more CPU-efficient than bytes, and some problems with code generation are fixed.
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
a20e3aca91
Properly set virtual tables up in the internal ctor by pointer.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
287ad2394d
Properly printed complex comments.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
4cc60bed2a
Fixed the pass for multiple inheritance to keep original functions.
...
This would be useful in many situations where the original function is required, for example when looking for indices in v-tables.
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
912248b5da
Skipped patching of v-tables for objects not put in the native-managed map.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
87845ad51d
Fixed a regression with abstract types with the same property as a base type.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
b9e3efbf0c
Removed the option for copy ctors and prevented usage of ignored ones.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
bb59ca17fb
Fixed a crash when a C++ ctor indirectly calls a virtual function on the object being constructed.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
55bc99bc3f
Fixed a bug when overriding a function located in a dependency.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
62a0857613
Copied all entries to the patched Itanium v-table.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
784a939c66
Ensured generated overridden properties are as simple as possible.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
dcb70b6ad0
Removed the now useless internal declarations for virtual non-operators.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
4e981a80e6
Fixed a bug when wrapping virtual properties overridden in indirect derived types.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
dc95c8d8c8
Fixed the bodies of functions overriding indirect virtuals.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
b15735d539
Generated GetHashCode in the C# front-end.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
4584ae7485
Fixed warnings in the generated code by properly using "new".
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
fa0e66687d
Fixed abstract implementations and bodies of overrides to properly handle abstract overrides.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
ae805eca31
Simplified overrides by just calling the base - all goes through the v-table anyway.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
ff76962bf9
Fixed a potential naming conflict.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
1b5de25f8c
Removed implementations for ignored abstract types.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
triton
8a510e4ac9
Workaround abstract implementations being generated even if there's no valid base class.
10 years ago
triton
d06c42129f
Fixed GenerateClassFields to only process actual base classes.
...
More specifically, TemplateParameterType was also coming up here.
Rather than checking for specific dependent types just check that we have a base class.
10 years ago
Dimitar Dobrev
f848f62180
Some refactoring to remove redundant members and casts.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
80643e0457
Added support for parameters with type a reference to a fixed-size array.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
5dca339ff2
Forbid the disposal of unowned objects and simplified the generated code.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
d769a81ade
Called virtual destructors through the virtual table.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago