-
Notifications
You must be signed in to change notification settings - Fork 273
Generalize passes that require RTTI #2127
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
Generalize passes that require RTTI #2127
Conversation
Seems sensible -- two possible changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I can't claim serious java_bytecode knowledge.
#include <goto-programs/remove_function_pointers.h> | ||
#include <goto-programs/remove_virtual_functions.h> | ||
#include <goto-programs/remove_instanceof.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick: lexicographic ordering
#include <goto-programs/remove_function_pointers.h> | ||
#include <goto-programs/remove_virtual_functions.h> | ||
#include <goto-programs/remove_instanceof.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick: lexicographic ordering
src/jbmc/jbmc_parse_options.cpp
Outdated
#include <goto-programs/remove_virtual_functions.h> | ||
#include <goto-programs/remove_instanceof.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick: lexicographic ordering
id2string(uncaught_exceptions_domaint::get_exception_type(exc.type())). | ||
find("java.lang.AssertionError")!=std::string::npos; | ||
if(!is_assertion_error) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a test to cover this?
cb61d28
to
b3ba2cc
Compare
@smowton, yes, that's indeed very, very inefficient. We cannot transparently cache the language in the global languages list, but we could provide a caching wrapper that could be used where necessary. |
@peterschrammel in fact on closer inspection we sort of have this mechanism already -- the |
Am holding off on review this due to above comment suggests a potential re-work - let me know if I should review as is. |
+1, what @thk123 said. Am happy to review if this is live again. FWIW Ada will need something like remove virtual functions and remove exceptions and I know that @andreast271 is working on C++ and so might care about having space for that. |
I'm going to revive this. |
This needs rebasing due to a number of merge conflicts and running out of date CI jobs. @peterschrammel are you still planning to revive this? If this is work which is no longer planned then we should close it out in order to clean up the number of open PRs. |
It's probably easier to reimplement these few lines than to rebase them. |
A small extension to languaget allows us to make the following passes language-independent:
The caveat is that (ignoring CPP which needs to be reimplemented) there is currently no other language that would use these facilities.
Alternatively, we could choose to move these passes to java_bytecode, with the (at the moment not much worrying) risk that incompatible infrastructures for similar functionalities will be re-implemented for future languages.