Generalize passes that require RTTI#2127
Generalize passes that require RTTI#2127peterschrammel wants to merge 3 commits intodiffblue:developfrom
Conversation
|
Seems sensible -- two possible changes:
|
tautschnig
left a comment
There was a problem hiding this comment.
Looks good to me, but I can't claim serious java_bytecode knowledge.
| #include <goto-programs/remove_exceptions.h> | ||
| #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.
Nit pick: lexicographic ordering
| #include <goto-programs/remove_exceptions.h> | ||
| #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.
Nit pick: lexicographic ordering
| #include <goto-programs/loop_ids.h> | ||
| #include <goto-programs/remove_exceptions.h> | ||
| #include <goto-programs/remove_virtual_functions.h> | ||
| #include <goto-programs/remove_instanceof.h> |
There was a problem hiding this comment.
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.
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.