Skip to content

Add Callable default ctor + defined() method #7380

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

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

steven-johnson
Copy link
Contributor

This allows it to behave like other Halide IR pieces.

This allows it to behave like
src/Callable.cpp Outdated
@@ -197,6 +203,8 @@ Callable::FailureFn Callable::check_fcci(size_t argc, const FullCallCheckInfo *a
}

int Callable::call_argv_checked(size_t argc, const void *const *argv, const QuickCallCheckInfo *actual_qcci) const {
internal_assert(defined());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a user_assert with an error message, because a user might actually try to call a default-constructed callable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@steven-johnson steven-johnson merged commit bdba694 into main Feb 28, 2023
@steven-johnson steven-johnson deleted the srj/nullable-callable branch February 28, 2023 02:14
steven-johnson added a commit that referenced this pull request Feb 28, 2023
* Add Callable default ctor + `defined()` method

This allows it to behave like

* Add user_assert + test
steven-johnson added a commit that referenced this pull request Mar 1, 2023
* Make Callable::call_argv_fast public (#7315)

* Make Callable::call_argv_fast public

* Add rough specification of the calling convention

* Fix a typo

* Add Callable default ctor + `defined()` method (#7380)

* Add Callable default ctor + `defined()` method

This allows it to behave like

* Add user_assert + test

---------

Co-authored-by: Tom Westerhout <14264576+twesterhout@users.noreply.github.com>
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
* Add Callable default ctor + `defined()` method

This allows it to behave like

* Add user_assert + test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants