-
Notifications
You must be signed in to change notification settings - Fork 2
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] Support for all the enums #7
Comments
Yes, would be great to support these. I assume that Sven would prefer to auto-generate the enums. We have already a translation table for cases where names conflict with C++ keywords. We can likely reuse this here. |
@chandangreddy : Any plans to move this forward. I think it would be great to see some of the isl ast interface to be exposed. |
@TobiG Yes, I have modified the generator to handle all enums uniformly. It basically strips isl_ from the name of enums and does static_cast whenever necessary. But I assume that all the enum classes are defined manually in the isl.h.top. I think, it not worth the effort to generate enum definitions automatically, given the limited number of enums that we have. Could you please share the translation tables that is agreed upon? |
@chandangreddy : Thanks for looking into this. I am slightly confused what you mean. You say you modified the generator, but prefer to add manual declarations of enums to isl.h.top? This seems to be inconsistent? I personally believe for small enums which are unlikely to ever be extended we can indeed just copy the declaration to isl.h.top. isl_dim is such a case. Maybe we should start with this and a couple of related functions? Larger enums (such as the ones in the AST generator) are likely better auto-generated. The translation table is part of interface/cpp.cc:
and is still mostly empty. |
@TobiG The generator modifications are to generate static_casts in the methods like
The enum declarations are manually added to isl.h.top. |
Thanks, now i understand your use of the generator. No, I don't think we had a discussion here. You may have a look at these two patches: simbuerg/isl@1a95bcc for how enums in general can be added to the generator. However, to spark the discussion a minimal patch with the enum in isl.h.top and the small code generator changes might be a good start. |
Currently, only isl::stat is supported. We can follow the same strategy as isl::stat and all enums to isl.h.top and generate appropriate static_casts while generating methods. We need to decide on names of enums as the simple rule of removing type name from enums will result in C++ default keywords for some like isl_ast_node_for, isl_ast_node_if etc..
The text was updated successfully, but these errors were encountered: