-
Notifications
You must be signed in to change notification settings - Fork 273
[TG-1338] Remove redundant specialisation code #1555
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
Merged
thk123
merged 4 commits into
diffblue:develop
from
thk123:feature/remove-redundant-specalisation-code
Nov 8, 2017
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file removed
BIN
-892 Bytes
regression/cbmc-java/generics_symtab1/generics$bound_element.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*******************************************************************\ | ||
|
||
Module: Unit test utilities | ||
|
||
Author: DiffBlue Limited. All rights reserved. | ||
|
||
\*******************************************************************/ | ||
|
||
#include <util/ui_message.h> | ||
#include <java_bytecode/generate_java_generic_type.h> | ||
#include "generic_utils.h" | ||
#include "catch.hpp" | ||
#include "require_type.h" | ||
|
||
/// Generic a specalised version of a Java generic class and add it to the | ||
/// symbol table. | ||
/// \param example_type: A reference type that is a specalised generic to use | ||
/// as the base for the specalised version (e.g. a variable of type | ||
/// `Generic<Integer>` | ||
/// \param new_symbol_table: The symbol table to store the new type in | ||
void generic_utils::specialise_generic( | ||
const java_generic_typet &example_type, | ||
symbol_tablet &new_symbol_table) | ||
{ | ||
// Should be a fully instantiated generic type | ||
REQUIRE( | ||
std::all_of( | ||
example_type.generic_type_variables().begin(), | ||
example_type.generic_type_variables().end(), | ||
is_java_generic_inst_parameter)); | ||
|
||
// Generate the specialised version. | ||
ui_message_handlert message_handler; | ||
generate_java_generic_typet instantiate_generic_type(message_handler); | ||
instantiate_generic_type( | ||
to_java_generic_type(example_type), new_symbol_table); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/*******************************************************************\ | ||
|
||
Module: Unit test utilities | ||
|
||
Author: DiffBlue Limited. All rights reserved. | ||
|
||
\*******************************************************************/ | ||
|
||
/// \file | ||
/// Utility methods for dealing with Java generics in unit tests | ||
|
||
#ifndef CPROVER_TESTING_UTILS_GENERIC_UTILS_H | ||
#define CPROVER_TESTING_UTILS_GENERIC_UTILS_H | ||
|
||
#include <util/irep.h> | ||
#include <util/symbol_table.h> | ||
|
||
// NOLINTNEXTLINE(readability/namespace) | ||
namespace generic_utils | ||
{ | ||
void specialise_generic( | ||
const java_generic_typet &example_type, | ||
symbol_tablet &new_symbol_table); | ||
} | ||
|
||
#endif // CPROVER_TESTING_UTILS_GENERIC_UTILS_H |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@NlightNFotis This is your old code for checking that all generic parameters are instantiated - you may wish to reuse this in your
smart_select_pointer_typet