Skip to content

Commit a518393

Browse files
author
svorenova
committed
Introduce lambda method handles in java class type
1 parent 37afd9a commit a518393

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/java_bytecode/java_types.h

+25
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Author: Daniel Kroening, [email protected]
1717
#include <util/std_types.h>
1818
#include <util/c_types.h>
1919
#include <util/optional.h>
20+
#include <util/std_expr.h>
2021

2122
class java_class_typet:public class_typet
2223
{
@@ -30,6 +31,30 @@ class java_class_typet:public class_typet
3031
{
3132
return set(ID_access, access);
3233
}
34+
35+
typedef std::vector<symbol_exprt> java_lambda_method_handlest;
36+
37+
const java_lambda_method_handlest &lambda_method_handles() const
38+
{
39+
return (const java_lambda_method_handlest &)find(
40+
ID_java_lambda_method_handles)
41+
.get_sub();
42+
}
43+
44+
java_lambda_method_handlest &lambda_method_handles()
45+
{
46+
return (java_lambda_method_handlest &)add(ID_java_lambda_method_handles)
47+
.get_sub();
48+
}
49+
50+
void add_lambda_method_handle(const irep_idt &identifier)
51+
{
52+
lambda_method_handles().emplace_back(identifier);
53+
}
54+
void add_unknown_lambda_method_handle()
55+
{
56+
lambda_method_handles().emplace_back();
57+
}
3358
};
3459

3560
inline const java_class_typet &to_java_class_type(const typet &type)

src/util/irep_ids.def

+1
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ IREP_ID_TWO(generic_types, #generic_types)
837837
IREP_ID_TWO(implicit_generic_types, #implicit_generic_types)
838838
IREP_ID_TWO(type_variables, #type_variables)
839839
IREP_ID_TWO(java_lambda_method_handle_index, lambda_method_handle_index)
840+
IREP_ID_TWO(java_lambda_method_handles, lambda_method_handles)
840841
IREP_ID_ONE(havoc_object)
841842
IREP_ID_TWO(overflow_shl, overflow-shl)
842843
IREP_ID_TWO(C_no_initialization_required, #no_initialization_required)

0 commit comments

Comments
 (0)