aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-tree.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-10-19 18:02:36 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-10-20 16:10:15 +0100
commit678bf852435aca6de25704ca417fab257fe03da9 (patch)
tree7eb78257e1d85eb7f2086e06867091f71a22cc34 /gcc/rust/backend/rust-tree.h
parentfeaa40602b7ecad36de8dcb6c387e686d04ce207 (diff)
downloadgcc-678bf852435aca6de25704ca417fab257fe03da9.zip
gcc-678bf852435aca6de25704ca417fab257fe03da9.tar.gz
gcc-678bf852435aca6de25704ca417fab257fe03da9.tar.bz2
Closure support at CallExpr
Closures's need to generate their specific function and setup their argument passing based on the signiture specified in libcore. We can get this information based on the specified bound on the closure. Addresses #195
Diffstat (limited to 'gcc/rust/backend/rust-tree.h')
-rw-r--r--gcc/rust/backend/rust-tree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-tree.h b/gcc/rust/backend/rust-tree.h
index 378254c..4a11016 100644
--- a/gcc/rust/backend/rust-tree.h
+++ b/gcc/rust/backend/rust-tree.h
@@ -82,6 +82,11 @@
#define SLICE_TYPE_P(TYPE) \
(TREE_CODE (TYPE) == RECORD_TYPE && TREE_LANG_FLAG_0 (TYPE))
+// lambda?
+#define RS_CLOSURE_FLAG TREE_LANG_FLAG_1
+#define RS_CLOSURE_TYPE_P(TYPE) \
+ (TREE_CODE (TYPE) == RECORD_TYPE && TREE_LANG_FLAG_1 (TYPE))
+
/* Returns true if NODE is a pointer to member function type. */
#define TYPE_PTRMEMFUNC_P(NODE) \
(TREE_CODE (NODE) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (NODE))