-
Notifications
You must be signed in to change notification settings - Fork 273
Add --java-no-load-class option #2013
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected] | |
#ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_CLASS_H | ||
#define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_CONVERT_CLASS_H | ||
|
||
#include <unordered_set> | ||
#include <util/symbol_table.h> | ||
#include <util/message.h> | ||
|
||
|
@@ -25,7 +26,8 @@ bool java_bytecode_convert_class( | |
message_handlert &message_handler, | ||
size_t max_array_length, | ||
method_bytecodet &, | ||
java_string_library_preprocesst &string_preprocess); | ||
java_string_library_preprocesst &string_preprocess, | ||
const std::unordered_set<std::string> &no_load_classes); | ||
|
||
void mark_java_implicitly_generic_class_type( | ||
const irep_idt &class_name, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ Author: Daniel Kroening, [email protected] | |
"(java-cp-include-files):" \ | ||
"(lazy-methods)" \ | ||
"(lazy-methods-extra-entry-point):" \ | ||
"(java-load-class):" | ||
"(java-load-class):" \ | ||
"(java-no-load-class):" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be useful to document (in the help string) what that method does and how it interacts with the other options. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Help for both |
||
|
||
#define JAVA_BYTECODE_LANGUAGE_OPTIONS_HELP /*NOLINT*/ \ | ||
" --no-core-models don't load internally provided models for core classes in\n"/* NOLINT(*) */ \ | ||
|
@@ -181,6 +182,8 @@ class java_bytecode_languaget:public languaget | |
synthetic_methods_mapt synthetic_methods; | ||
stub_global_initializer_factoryt stub_global_initializer_factory; | ||
class_hierarchyt class_hierarchy; | ||
// List of classes to never load | ||
std::unordered_set<std::string> no_load_classes; | ||
}; | ||
|
||
std::unique_ptr<languaget> new_java_bytecode_language(); | ||
|
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.
I'd prefer using
.find
or explicitly checking on0
here, but no blockerThere 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.
how about emitting a debug message in that case? Then you could also add a regression test
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.
Debug message would print EVERY class. I don't think it's such a good idea. We could however with that option simplify some test-gen regression tests.
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.
I'd only send to debug the classes that were not loaded due to the setting of the new parameter. That could be used to validate the functioning in a regression test and would not create too much additional output.