Skip to content
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

Tidying up for lambdas [TG-2478] #1978

Merged
merged 1 commit into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,10 @@ code_typet member_type_lazy(
/// \param lambda_method_handles Vector of lambda method handles (bootstrap
/// methods) of the class where the lambda is called
/// \param index Index of the lambda method handle in the vector
/// \return Symbol of the lambda method if the method handle does not have an
/// unknown type
/// \return Symbol of the lambda method if the method handle has a known type
optionalt<symbolt> java_bytecode_convert_methodt::get_lambda_method_symbol(
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
const size_t &index)
const size_t index)
{
const symbol_exprt &lambda_method_handle = lambda_method_handles.at(index);
// If the lambda method handle has an unknown type, it does not refer to
Expand Down
2 changes: 1 addition & 1 deletion src/java_bytecode/java_bytecode_convert_method_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class java_bytecode_convert_methodt:public messaget

optionalt<symbolt> get_lambda_method_symbol(
const java_class_typet::java_lambda_method_handlest &lambda_method_handles,
const size_t &index);
const size_t index);

// conversion
void convert(const symbolt &class_symbol, const methodt &);
Expand Down
2 changes: 2 additions & 0 deletions src/java_bytecode/java_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ class java_class_typet:public class_typet

void add_lambda_method_handle(const irep_idt &identifier)
{
// creates a symbol_exprt for the identifier and pushes it in the vector
lambda_method_handles().emplace_back(identifier);
}
void add_unknown_lambda_method_handle()
{
// creates empty symbol_exprt and pushes it in the vector
lambda_method_handles().emplace_back();
}
};
Expand Down
1 change: 0 additions & 1 deletion unit/testing-utils/require_parse_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ require_parse_tree::require_lambda_entry_for_descriptor(
entry.second.method_type == method_type &&
entry.second.lambda_method_ref == lambda_method_ref);
});
INFO("Number of matching lambda method entries: " << matches.size());
REQUIRE(matches.size() == 1);
return matches.at(0).second;
}
Expand Down