Skip to content
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: force static functions #22

Open
ftynse opened this issue Sep 25, 2017 · 3 comments
Open

cpp: force static functions #22

ftynse opened this issue Sep 25, 2017 · 3 comments

Comments

@ftynse
Copy link
Member

ftynse commented Sep 25, 2017

Currently, the exported function is made static if its first argument is of a different type than its expected surrounding class (determined from the function name prefix).

There are "constructing" functions which make more sense as static rather than as instance functions, but with current generator it seems impossible to make them static. In particular, space construction:
isl_space_map_from_domain_and_range(isl_space *, isl_space *) makes more sense if translated as
isl::space::map_from_domain_and_range(domain, range) and not as domain.map_from_domain_and_range(range). Same goes for, e.g., isl_space_set_from_params.

I would suggest an extra tag __isl_export_ensure_static that forces the generator to produce a static function even if the function would be instance function otherwise. The danger here is to avoid a mixup with all the implicitly static functions with only __isl_export.

@tobiasgrosser
Copy link
Member

Good point. I have seen it also for isl::space::map_from_domain_and_range.

An alternative name could be:

__isl_constructor_static

@ftynse
Copy link
Member Author

ftynse commented Sep 25, 2017 via email

@tobiasgrosser
Copy link
Member

Why? If you want to make it more explicit, what about:

__isl_constructor_ensure_static

I think the best is to submit a patch to isl and discuss with Sven. No need to have two bikesheding discussions.

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

No branches or pull requests

2 participants