#include <isl_ctx_private.h>
#include <isl_id_private.h>
+/* A special, static isl_id to use as domains (and ranges)
+ * of sets and parameters domains.
+ * The user should never get a hold on this isl_id.
+ */
+isl_id isl_id_none = {
+ .ref = -1,
+ .ctx = NULL,
+ .name = "#none",
+ .user = NULL
+};
+
isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id)
{
return id ? id->ctx : NULL;
return entry->data;
}
+/* If the id has a negative refcount, then it is a static isl_id
+ * which should not be changed.
+ */
__isl_give isl_id *isl_id_copy(isl_id *id)
{
if (!id)
return NULL;
+ if (id->ref < 0)
+ return id;
+
id->ref++;
return id;
}
return hash;
}
+/* If the id has a negative refcount, then it is a static isl_id
+ * and should not be freed.
+ */
void *isl_id_free(__isl_take isl_id *id)
{
struct isl_hash_table_entry *entry;
if (!id)
return NULL;
+ if (id->ref < 0)
+ return NULL;
+
if (--id->ref > 0)
return NULL;
isl_printer_free(p);
return NULL;
}
-
-void isl_id_dump(__isl_keep isl_id *id)
-{
- isl_printer *printer;
-
- if (!id)
- return;
-
- printer = isl_printer_to_file(isl_id_get_ctx(id), stderr);
- printer = isl_printer_print_id(printer, id);
- printer = isl_printer_end_line(printer);
-
- isl_printer_free(printer);
-}