-
-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cpp] Marshalling Extern Types #11981
Open
Aidan63
wants to merge
182
commits into
HaxeFoundation:development
Choose a base branch
from
Aidan63:cpp-value-types
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 181 commits
Commits
Show all changes
182 commits
Select commit
Hold shift + click to select a range
49b4220
Initial class, interface, and enum separation
Aidan63 59e730c
fold init stuff
Aidan63 354da10
Move interface header generation into its own module
Aidan63 d9bfebd
reduce some duplication
Aidan63 249688d
managed interface implementation gen in its own module
Aidan63 93df328
cache dependencies in the ctx
Aidan63 36ddd73
move to gencpp with the other context data func
Aidan63 de409db
remove interface code from class gen modules
Aidan63 ebaa770
Use option for reference wildcard
Aidan63 328ab64
path Map
Aidan63 9fe38ea
Add back objc guard
Aidan63 145e55f
calculate IDs up front
Aidan63 ad8bc9a
separate id lookup table
Aidan63 a9bb142
Object IDs module to hide cache
Aidan63 631a5d3
remap enum constructors
Aidan63 9f59edd
more interface dead code removal
Aidan63 eb7c4bf
tcpp interface type
Aidan63 95a7407
name, flags, and debug level in tcpp_class
Aidan63 5200fb3
remove unused constructor var list return item
Aidan63 fde882b
separate out header field generation
Aidan63 7e71613
separate managed and native header gen functions
Aidan63 0a17f2c
move header stuff into shared function
Aidan63 e35bb2e
break class impl field gen function down
Aidan63 3bd3028
add converted fields to tcpp_class
Aidan63 758a507
Initial split for managed and native class impl
Aidan63 057d790
map for haxe and native implementations
Aidan63 d190014
use a list for haxe and native implementations
Aidan63 5d3a415
use tcpp_class field variables
Aidan63 9829bf2
field rename and meta / rtti filtering
Aidan63 e5897d4
create fields and default functions at class transform
Aidan63 736bb08
use container flag
Aidan63 0edf381
Mark and visit using variables and fix inverted container flag
Aidan63 4aaac3c
static mark and visit use static variables list
Aidan63 9871978
print reflective fields
Aidan63 701f911
don't duplicate boot generation code
Aidan63 d42df0f
don't duplicate init function generation
Aidan63 c23b8ff
don't duplicate dynamic function allocation generation
Aidan63 05fafa7
generate properties and __Field function
Aidan63 ef924ec
fold right member get fields
Aidan63 7c365b8
static get fields
Aidan63 bfb3a74
shared member and static get fold functions
Aidan63 4034ca5
static set function uses ordered fields
Aidan63 3344a77
member set uses organised fields
Aidan63 d3cc1db
turn abstract functions into normal functions
Aidan63 dc1adbf
cppia gen uses organised functions
Aidan63 77bc03a
simplify ScriptNamedFunction generation
Aidan63 7200bcb
bit of simplification of more cppia stuff
Aidan63 8e8e342
GetFields uses organised fields
Aidan63 36e5870
move class retyping into retyper
Aidan63 1d1efee
remap interface functions
Aidan63 916320b
store interface hash
Aidan63 4c94f0f
store meta and rtti fields in remapped interface
Aidan63 1c0bfce
dead code removal
Aidan63 02e11ce
tcpp interfaces only store their functions
Aidan63 07ac093
remapped enum fields rename for consistency
Aidan63 0da3840
calculate interface slots ahead of time
Aidan63 f683ccd
remap interface arg names
Aidan63 0c69ea9
retype the interfaces stored on retyped classes
Aidan63 909cd50
retype tcpp_class supers
Aidan63 973b4be
find_class_implementation uses tcpp_class
Aidan63 21744f9
folds for class interface code
Aidan63 cd77345
other minor cleanup
Aidan63 36cd2e9
use flags in class generation to selectively generate some funcs
Aidan63 41d63d4
retype class functions
Aidan63 5f7b93a
retype class variables
Aidan63 554d2fa
dedicated var and dyn function boot functions
Aidan63 399b7de
dead code cleanup
Aidan63 d28a3bd
use bindings instead of to_list
Aidan63 a1dff50
own implementation of of_list
Aidan63 c5b4c62
replace another to_list
Aidan63 0a0ad1a
Fix pointer and struct wrapping
Aidan63 317b0cd
fix debug level not being reset between classes
Aidan63 4f12a08
add space after static
Aidan63 5834049
remove unused variable
Aidan63 151c563
ensure SourceFile paths are made absolute
Aidan63 2787b94
some debugging
Aidan63 63eb006
remove debugging prints and store class params
Aidan63 ba5a228
don't use already mangled name when generating the getter name in ref…
Aidan63 c57a4e5
same for setters
Aidan63 e3f92b3
dont use new gc references function
Aidan63 c1b7332
better handling of static and virtual attributes
Aidan63 f56c0d4
generate scriptable class using tcpp class function lists
Aidan63 4bf6e1c
go back to type cant be null
Aidan63 08bce30
Container flag refers to entire inheritance tree
Aidan63 1da4f13
allow code to easily distinguish between the different container types
Aidan63 078a5a8
remove accidentally tracked file
Aidan63 a2f763a
Merge branch 'development' into gencpp_rework_mkii
Aidan63 ca927c8
Merge branch 'development' into gencpp_rework_mkii
Aidan63 fe455fd
Merge branch 'development' into gencpp_rework_mkii
Aidan63 760989c
pass a context object around the retyper
Aidan63 89bc3b8
closures tracked in retyper ctx
Aidan63 a9cb03e
injection stored in retyper ctx
Aidan63 8b1792b
declarations track by retyper ctx
Aidan63 b800eb0
this handling moved into ctx
Aidan63 71b4d54
gc stack handled by retyper ctx
Aidan63 36718d8
function return type handled by retyper ctx
Aidan63 4b10c5e
move loop goto management into retyper ctx
Aidan63 b15f527
consistent retyper ctx variable name
Aidan63 0b41462
move remaining counter into the fold
Aidan63 4138b6c
Merge branch 'development' into gencpp_rework_mkii
Aidan63 9a11526
shared string_map_of_list function
Aidan63 6033946
initial value type support
Aidan63 696dd29
generic templates and correct return types
Aidan63 1d46e65
Boxing of captured locals and use marshalling struct helper
Aidan63 b4734a2
cast dynamic to a reference object
Aidan63 994377f
always use a reference object instead of sometimes directly a boxed o…
Aidan63 54f20b3
cast variant to value type
Aidan63 8f6a2f6
error on to value type field closures
Aidan63 57c1f96
Use dedicated new marshal types
Aidan63 416b42d
Update forgotten about old cpp reference
Aidan63 2206949
use _hx_vt as a prefix
Aidan63 e2e0866
support namespace field
Aidan63 6ee58ef
omit brackets for stack constructors which have no arguments
Aidan63 c1a1962
Fix alignment of reference declarations in closures
Aidan63 fb74f7b
default to creating boxed value types and deal with the few special c…
Aidan63 580c989
some nullable support
Aidan63 82a80dd
move auto cast into a separate file
Aidan63 9c99937
retype tvar to tcpp specific type
Aidan63 10c3cdf
retype tvar to simplify code and fix closure argument assignment
Aidan63 53628ad
promote function and lambda args if captured
Aidan63 da02ed2
unify closure and function arg generation
Aidan63 d9d1c09
initial attempt at assigning value types a state
Aidan63 386d335
some cleanup surrounding value type state assignment
Aidan63 83f38b5
remove the two variable creation system
Aidan63 4b3913c
implement class fields and statics
Aidan63 c692353
wrap value type arguments for new non based struct value type
Aidan63 c70f62f
cleanup of code and default values
Aidan63 62658ca
support enums
Aidan63 c23394e
treat abstract this variable as a reference and cast with a promoted …
Aidan63 65a6616
pointer type interop support
Aidan63 8b1616e
ensure arrays of value types are boxed
Aidan63 36b8111
treat nullable value types as promoted
Aidan63 cfd53f1
default to heap construction for references
Aidan63 67aac7e
treat extern value type fields of extern value types as refences
Aidan63 84e06e5
avoid double :: when no namespace is specified
Aidan63 dc9dc27
Merge branch 'development' into gencpp_rework_mkii
Aidan63 44fd82b
another pass to catch some missing :: prefixes
Aidan63 a4e267a
Merge branch 'gencpp_rework_mkii' into cpp-value-types
Aidan63 6fbf7c6
Initial enum support and comparison operator support
Aidan63 146758d
correct enum casting
Aidan63 c5e285c
handle extern value type field access and assignment correctly
Aidan63 40d2c8d
fallback to stack allocation instead of heap
Aidan63 ecc238e
Allow creating reference state values types on the stack
Aidan63 6d58e63
require reference semantics metadata
Aidan63 9637d01
Don't use the package if no namespace is provided
Aidan63 72521c2
add inheritance and casting tests
Aidan63 8b8006c
support star of and dereference native functions
Aidan63 d60f8aa
Initial support for pointer types
Aidan63 6e1fbe6
Add forgotten meta json change
Aidan63 dab99bc
make sure all boxed pointer vars are allocated
Aidan63 a4e790b
handle adding pointer stars once
Aidan63 7a4774d
Use custom marshal pointer type for pointer references
Aidan63 3562f93
pointer and value specific reference cpp types
Aidan63 4714cc3
don't retype args with dynamic
Aidan63 52f22ba
bits of cleanup and specifying some types more
Aidan63 26b7441
Remove need for assignment filter, now fixed at source
Aidan63 27da419
remove useless argument
Aidan63 c0386b0
retype null promoted pointers into boxed objects
Aidan63 5c9fdc1
inheritance casting with pointer types as well
Aidan63 ddbdf01
Look for include meta on extern abstracts
Aidan63 c84c65b
don't add * to pointer type and references
Aidan63 aabb69d
Don't use subscript operator for pointers of marshal types
Aidan63 ec76d2e
less code duplication and unwrap marshal type params
Aidan63 2e39547
do something for cppia
Aidan63 96ba95d
require reference semantics on pointer types
Aidan63 e15f84c
Don't allow constructors on pointer types
Aidan63 4829fde
Initial support for managed externs
Aidan63 8e9a114
first pass of the _obj handling
Aidan63 7bd1413
Handle static functions and variable
Aidan63 d2ae7c5
Fix incorrect template handling with standard naming
Aidan63 e507af1
another standard naming fix
Aidan63 e602fb0
allow static fields on extern pointers
Aidan63 9822463
better static handling and helper function name consistency
Aidan63 d0b27e2
Exclude marshal types from having debug info generated
Aidan63 3864521
rename marshal type enum for consistency
Aidan63 cd38211
add managed marshal type to cppia enum
Aidan63 370a963
don't follow away marshalling enum abstracts to ensure we see meta
Aidan63 818c7b7
More generic extern abstract following
Aidan63 74ef478
Add a bunch of errors
Aidan63 802a601
Fix error position
Aidan63 528ee1b
dev merge
Aidan63 774f772
Move meta up and fill in doc comment
Aidan63 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
open CppAst | ||
open CppAstTools | ||
|
||
let get_extern_value_type_boxed value_type = | ||
let p = get_native_marshalled_type value_type in | ||
let suffix = | ||
match value_type with | ||
| Pointer _ -> "*" | ||
| _ -> "" | ||
in | ||
|
||
Printf.sprintf "::cpp::marshal::Boxed< %s%s >" p suffix, Printf.sprintf "::cpp::marshal::Boxed_obj< %s%s >" p suffix |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to move those up with other
Cpp*
metadata, and adddoc
:)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other cpp meta seems to be a bit all over the place, but I've moved the new ones up to be next to a few others and filled in the doc comment.