diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-07-25 21:56:36 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-07-25 21:56:36 +0200 |
| commit | 18afea306114de303161f4aa044fb9842db1b10c (patch) | |
| tree | 483e8dc928d577b0ada6ae61be0cc6aa2a63eabe /src/common | |
| parent | 5f37d25310d282c0370f082328b5268e344b131c (diff) | |
Support soa in generics
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/ast.odin | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/ast.odin b/src/common/ast.odin index 4f1b25d..267c84d 100644 --- a/src/common/ast.odin +++ b/src/common/ast.odin @@ -207,6 +207,26 @@ unwrap_pointer_expr :: proc(expr: ^ast.Expr) -> (^ast.Expr, int, bool) { return expr, n, true } +array_is_soa :: proc(array: ast.Array_Type) -> bool { + if array.tag != nil { + if basic, ok := array.tag.derived.(^ast.Basic_Directive); + ok && basic.name == "soa" { + return true + } + } + return false +} + +dynamic_array_is_soa :: proc(array: ast.Dynamic_Array_Type) -> bool { + if array.tag != nil { + if basic, ok := array.tag.derived.(^ast.Basic_Directive); + ok && basic.name == "soa" { + return true + } + } + return false +} + expr_contains_poly :: proc(expr: ^ast.Expr) -> bool { if expr == nil { return false |