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

Remove uses of records in instruction schemata #52

Merged
merged 9 commits into from
Oct 7, 2022
21 changes: 9 additions & 12 deletions FactGenerator/include/predicates.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GROUP_BEGIN(instr)
PREDICATE(instr, to, instr_assigns_to)
PREDICATE(instr, flag, instr_flag)
PREDICATE(instr, next, next_instr)
PREDICATE(instr, bb_entry, _instr_bb_entry)
PREDICATE(instr, bb_entry, instr_bb_entry)
PREDICATE(instr, func, instr_func)
PREDICATE(instr, pos, instr_pos)
PREDICATE(instr, unreachable, unreachable_instr)
Expand Down Expand Up @@ -207,9 +207,8 @@ GROUP_BEGIN(switch_)
PREDICATE2S(switch_, instr)
PREDICATEIS(switch_, operand)
PREDICATEIS(switch_, default_label)
// TODO(#42): Remove leading underscores
PREDICATE(switch_, case_value, _switch_instr_case_value)
PREDICATE(switch_, case_label, _switch_instr_case_label)
PREDICATEIS(switch_, case_value)
PREDICATEIS(switch_, case_label)
PREDICATEIS(switch_, ncases)
GROUP_END(switch_)

Expand Down Expand Up @@ -440,9 +439,8 @@ GROUP_END(fcmp)
GROUP_BEGIN(phi)
PREDICATE2(phi, instr)
PREDICATEI(phi, type)
// TODO(#42): Remove underscores!
PREDICATE(phi, pair_value, _phi_instr_pair_value)
PREDICATE(phi, pair_label, _phi_instr_pair_label)
PREDICATEI(phi, pair_value)
PREDICATEI(phi, pair_label)
PREDICATEI(phi, npairs)
GROUP_END(phi)

Expand Down Expand Up @@ -476,9 +474,8 @@ GROUP_END(call)
GROUP_BEGIN(landingpad)
PREDICATE2(landingpad, instr)
PREDICATEI(landingpad, type)
// TODO(#42): Remove underscores
PREDICATE(landingpad, catch_clause, _landingpad_instr_catch_clause)
PREDICATE(landingpad, filter_clause, _landingpad_instr_filter_clause)
PREDICATEI(landingpad, catch_clause)
PREDICATEI(landingpad, filter_clause)
PREDICATEI(landingpad, nclauses)
// TODO(#42): Remove is
PREDICATE(landingpad, cleanup, landingpad_instr_is_cleanup)
Expand Down Expand Up @@ -546,15 +543,15 @@ PREDICATE(variable, id, variable)
PREDICATE(variable, type, variable_has_type)
PREDICATE(variable, source_name, variable_has_debug_source_name)
PREDICATE(variable, pos, variable_has_debug_decl_pos)
PREDICATE(variable, in_func, _variable_in_func)
PREDICATE(variable, in_func, variable_in_func_name)
PREDICATE(variable, name, variable_has_name)
GROUP_END(variable)

GROUP_BEGIN(constant)
PREDICATE(constant, id, constant)
PREDICATE(constant, type, constant_has_type)
PREDICATE(constant, value, constant_has_value)
PREDICATE(constant, in_func, _constant_in_func)
PREDICATE(constant, in_func, constant_in_func_name)
PREDICATE(constant, expr, constant_expression)
PREDICATE(constant, hash, constant_hashes_to)
PREDICATE(constant, to_integer, constant_to_int)
Expand Down
2 changes: 0 additions & 2 deletions datalog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(DL_SOURCES
${CMAKE_CURRENT_LIST_DIR}/import/import.dl
${CMAKE_CURRENT_LIST_DIR}/import/todo.dl
${CMAKE_CURRENT_LIST_DIR}/symbol-lookup/resolve-func-calls.dl
${CMAKE_CURRENT_LIST_DIR}/points-to/allocations-globals.dl
${CMAKE_CURRENT_LIST_DIR}/points-to/allocations-sizes.dl
Expand Down Expand Up @@ -104,7 +103,6 @@ set(DL_SOURCES
${CMAKE_CURRENT_LIST_DIR}/schema/attr.dl
${CMAKE_CURRENT_LIST_DIR}/schema/landingpad-instr.dl
${CMAKE_CURRENT_LIST_DIR}/callgraph/entry-points.dl
${CMAKE_CURRENT_LIST_DIR}/export/auxiliary-records.dl
${CMAKE_CURRENT_LIST_DIR}/export/subset.dl
${CMAKE_CURRENT_LIST_DIR}/export/statistics.dl
${CMAKE_CURRENT_LIST_DIR}/export/unification.dl
Expand Down
1 change: 0 additions & 1 deletion datalog/debug.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "subset-and-unification.project"
#include "export/statistics.dl"
#include "export/auxiliary-records.dl"
#include "export/debug-output.dl"

// These are relations from components that aren't detected using
Expand Down
21 changes: 0 additions & 21 deletions datalog/export/auxiliary-records.dl

This file was deleted.

44 changes: 19 additions & 25 deletions datalog/export/debug-output-extended.dl
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,19 @@
.output _assert_type_compatible_ptr_points_to_alias (compress=true)
.output _assert_type_compatible_relaxed (compress=true)
.output _assert_type_compatible_relaxed_inner (compress=true)
.output _catch_clause (compress=true)
.output _clause (compress=true)
.output _constant_contains_typeinfo (compress=true)
.output _constant_expression_next_index (compress=true)
.output _constant_in_func (compress=true)
.output _eligible_base_type (compress=true)
.output _filter_clause (compress=true)
.output _getelementptr_constant_expression_base_type (compress=true)
.output _getelementptr_constant_expression_index_type (compress=true)
.output _getelementptr_constant_expression_interm_type (compress=true)
.output _getelementptr_constant_expression_value_type (compress=true)
.output _instr_bb_entry (compress=true)
.output _instr_calls_func (compress=true)
.output _landingpad_contains_landingpad_instr (compress=true)
.output _landingpad_first_nonphi (compress=true)
.output _landingpad_instr_catch_clause (compress=true)
.output _landingpad_instr_clause (compress=true)
.output _landingpad_instr_filter_clause (compress=true)
.output _landingpad_starting_phi (compress=true)
.output _nvars_by_pt_total (compress=true)
.output _phi_instr_pair (compress=true)
.output _phi_instr_pair_label (compress=true)
.output _phi_instr_pair_value (compress=true)
.output _string_iteration_trick (compress=true)
.output _switch_instr_case (compress=true)
.output _switch_instr_case_label (compress=true)
.output _switch_instr_case_value (compress=true)
.output _type_expands_base_type (compress=true)
.output _type_info_by_alloc (compress=true)
.output _typed_alloc (compress=true)
Expand All @@ -41,7 +27,6 @@
.output _typeinfo_class_type (compress=true)
.output _typeinfo_contains_typeinfo (compress=true)
.output _valid_landingpad (compress=true)
.output _variable_in_func (compress=true)
.output _vtable_by_class_name (compress=true)
.output _vtable_class_name (compress=true)
.output acq_rel_ordering (compress=true)
Expand Down Expand Up @@ -207,6 +192,7 @@
.output constant_has_value (compress=true)
.output constant_hashes_to (compress=true)
.output constant_in_func (compress=true)
.output constant_in_func_name (compress=true)
.output constant_points_to (compress=true)
.output constant_ptr_points_to (compress=true)
.output constant_references_func (compress=true)
Expand Down Expand Up @@ -339,6 +325,15 @@
.output fsub_instr_second_operand (compress=true)
.output func (compress=true)
.output func_alignment (compress=true)
.output func_by_location (compress=true)
.output func_by_value_param (compress=true)
.output func_calling_conv (compress=true)
.output func_calls_func (compress=true)
.output func_constant (compress=true)
.output func_constant_fn_name (compress=true)
.output func_decl (compress=true)
.output func_decl_to_defn (compress=true)
.output func_degree (compress=true)
.output func_fn_attr (compress=true)
.output func_fn_attr__alignstack (compress=true)
.output func_fn_attr__alwaysinline (compress=true)
Expand Down Expand Up @@ -374,15 +369,6 @@
.output func_fn_attr__sspreq (compress=true)
.output func_fn_attr__sspstrong (compress=true)
.output func_fn_attr__uwtable (compress=true)
.output func_by_location (compress=true)
.output func_by_value_param (compress=true)
.output func_calling_conv (compress=true)
.output func_calls_func (compress=true)
.output func_constant (compress=true)
.output func_constant_fn_name (compress=true)
.output func_decl (compress=true)
.output func_decl_to_defn (compress=true)
.output func_degree (compress=true)
.output func_gc (compress=true)
.output func_is_illformed (compress=true)
.output func_is_wellformed (compress=true)
Expand Down Expand Up @@ -446,11 +432,11 @@
.output global_var_constant_reference (compress=true)
.output global_var_demangled_name (compress=true)
.output global_var_flag (compress=true)
.output global_var_section (compress=true)
.output global_var_initializer (compress=true)
.output global_var_is_constant (compress=true)
.output global_var_linkage (compress=true)
.output global_var_name (compress=true)
.output global_var_section (compress=true)
.output global_var_threadlocal_mode (compress=true)
.output global_var_type (compress=true)
.output global_var_visibility (compress=true)
Expand Down Expand Up @@ -512,6 +498,7 @@
.output insertvalue_instrterm_type (compress=true)
.output instr (compress=true)
.output instr_assigns_to (compress=true)
.output instr_bb_entry (compress=true)
.output instr_block (compress=true)
.output instr_flag (compress=true)
.output instr_func (compress=true)
Expand Down Expand Up @@ -550,7 +537,9 @@
.output label_type (compress=true)
.output landingpad (compress=true)
.output landingpad_instr (compress=true)
.output landingpad_instr_catch_clause (compress=true)
.output landingpad_instr_clause (compress=true)
.output landingpad_instr_filter_clause (compress=true)
.output landingpad_instr_is_cleanup (compress=true)
.output landingpad_instr_nclauses (compress=true)
.output landingpad_instr_pers_fn (compress=true)
Expand Down Expand Up @@ -633,6 +622,8 @@
.output phi_instr (compress=true)
.output phi_instr_npairs (compress=true)
.output phi_instr_pair (compress=true)
.output phi_instr_pair_label (compress=true)
.output phi_instr_pair_value (compress=true)
.output phi_instr_type (compress=true)
.output pointer_index (compress=true)
.output pointer_offset (compress=true)
Expand Down Expand Up @@ -758,6 +749,8 @@
.output superclass (compress=true)
.output switch_instr (compress=true)
.output switch_instr_case (compress=true)
.output switch_instr_case_label (compress=true)
.output switch_instr_case_value (compress=true)
.output switch_instr_default_label (compress=true)
.output switch_instr_ncases (compress=true)
.output switch_instr_operand (compress=true)
Expand Down Expand Up @@ -824,6 +817,7 @@
.output variable_has_name (compress=true)
.output variable_has_type (compress=true)
.output variable_in_func (compress=true)
.output variable_in_func_name (compress=true)
.output variable_is_firstclass (compress=true)
.output variable_is_label (compress=true)
.output variable_is_pointer (compress=true)
Expand Down
44 changes: 19 additions & 25 deletions datalog/export/debug-output.dl
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,19 @@
.output _assert_type_compatible_ptr_points_to_alias (compress=true)
.output _assert_type_compatible_relaxed (compress=true)
.output _assert_type_compatible_relaxed_inner (compress=true)
.output _catch_clause (compress=true)
.output _clause (compress=true)
.output _constant_contains_typeinfo (compress=true)
.output _constant_expression_next_index (compress=true)
.output _constant_in_func (compress=true)
.output _eligible_base_type (compress=true)
.output _filter_clause (compress=true)
.output _getelementptr_constant_expression_base_type (compress=true)
.output _getelementptr_constant_expression_index_type (compress=true)
.output _getelementptr_constant_expression_interm_type (compress=true)
.output _getelementptr_constant_expression_value_type (compress=true)
.output _instr_bb_entry (compress=true)
.output _instr_calls_func (compress=true)
.output _landingpad_contains_landingpad_instr (compress=true)
.output _landingpad_first_nonphi (compress=true)
.output _landingpad_instr_catch_clause (compress=true)
.output _landingpad_instr_clause (compress=true)
.output _landingpad_instr_filter_clause (compress=true)
.output _landingpad_starting_phi (compress=true)
.output _nvars_by_pt_total (compress=true)
.output _phi_instr_pair (compress=true)
.output _phi_instr_pair_label (compress=true)
.output _phi_instr_pair_value (compress=true)
.output _string_iteration_trick (compress=true)
.output _switch_instr_case (compress=true)
.output _switch_instr_case_label (compress=true)
.output _switch_instr_case_value (compress=true)
.output _type_expands_base_type (compress=true)
.output _type_info_by_alloc (compress=true)
.output _typed_alloc (compress=true)
Expand All @@ -41,7 +27,6 @@
.output _typeinfo_class_type (compress=true)
.output _typeinfo_contains_typeinfo (compress=true)
.output _valid_landingpad (compress=true)
.output _variable_in_func (compress=true)
.output _vtable_by_class_name (compress=true)
.output _vtable_class_name (compress=true)
.output acq_rel_ordering (compress=true)
Expand Down Expand Up @@ -207,6 +192,7 @@
.output constant_has_value (compress=true)
.output constant_hashes_to (compress=true)
.output constant_in_func (compress=true)
.output constant_in_func_name (compress=true)
.output constant_points_to (compress=true)
.output constant_ptr_points_to (compress=true)
.output constant_references_func (compress=true)
Expand Down Expand Up @@ -339,6 +325,15 @@
.output fsub_instr_second_operand (compress=true)
.output func (compress=true)
.output func_alignment (compress=true)
.output func_by_location (compress=true)
.output func_by_value_param (compress=true)
.output func_calling_conv (compress=true)
.output func_calls_func (compress=true)
.output func_constant (compress=true)
.output func_constant_fn_name (compress=true)
.output func_decl (compress=true)
.output func_decl_to_defn (compress=true)
.output func_degree (compress=true)
.output func_fn_attr (compress=true)
.output func_fn_attr__alignstack (compress=true)
.output func_fn_attr__alwaysinline (compress=true)
Expand Down Expand Up @@ -374,15 +369,6 @@
.output func_fn_attr__sspreq (compress=true)
.output func_fn_attr__sspstrong (compress=true)
.output func_fn_attr__uwtable (compress=true)
.output func_by_location (compress=true)
.output func_by_value_param (compress=true)
.output func_calling_conv (compress=true)
.output func_calls_func (compress=true)
.output func_constant (compress=true)
.output func_constant_fn_name (compress=true)
.output func_decl (compress=true)
.output func_decl_to_defn (compress=true)
.output func_degree (compress=true)
.output func_gc (compress=true)
.output func_is_illformed (compress=true)
.output func_is_wellformed (compress=true)
Expand Down Expand Up @@ -446,11 +432,11 @@
.output global_var_constant_reference (compress=true)
.output global_var_demangled_name (compress=true)
.output global_var_flag (compress=true)
.output global_var_section (compress=true)
.output global_var_initializer (compress=true)
.output global_var_is_constant (compress=true)
.output global_var_linkage (compress=true)
.output global_var_name (compress=true)
.output global_var_section (compress=true)
.output global_var_threadlocal_mode (compress=true)
.output global_var_type (compress=true)
.output global_var_visibility (compress=true)
Expand Down Expand Up @@ -512,6 +498,7 @@
.output insertvalue_instrterm_type (compress=true)
.output instr (compress=true)
.output instr_assigns_to (compress=true)
.output instr_bb_entry (compress=true)
.output instr_block (compress=true)
.output instr_flag (compress=true)
.output instr_func (compress=true)
Expand Down Expand Up @@ -550,7 +537,9 @@
.output label_type (compress=true)
.output landingpad (compress=true)
.output landingpad_instr (compress=true)
.output landingpad_instr_catch_clause (compress=true)
.output landingpad_instr_clause (compress=true)
.output landingpad_instr_filter_clause (compress=true)
.output landingpad_instr_is_cleanup (compress=true)
.output landingpad_instr_nclauses (compress=true)
.output landingpad_instr_pers_fn (compress=true)
Expand Down Expand Up @@ -633,6 +622,8 @@
.output phi_instr (compress=true)
.output phi_instr_npairs (compress=true)
.output phi_instr_pair (compress=true)
.output phi_instr_pair_label (compress=true)
.output phi_instr_pair_value (compress=true)
.output phi_instr_type (compress=true)
.output pointer_index (compress=true)
.output pointer_offset (compress=true)
Expand Down Expand Up @@ -758,6 +749,8 @@
.output superclass (compress=true)
.output switch_instr (compress=true)
.output switch_instr_case (compress=true)
.output switch_instr_case_label (compress=true)
.output switch_instr_case_value (compress=true)
.output switch_instr_default_label (compress=true)
.output switch_instr_ncases (compress=true)
.output switch_instr_operand (compress=true)
Expand Down Expand Up @@ -824,6 +817,7 @@
.output variable_has_name (compress=true)
.output variable_has_type (compress=true)
.output variable_in_func (compress=true)
.output variable_in_func_name (compress=true)
.output variable_is_firstclass (compress=true)
.output variable_is_label (compress=true)
.output variable_is_pointer (compress=true)
Expand Down
4 changes: 0 additions & 4 deletions datalog/import/import.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
#line 1 "import.dl"
#include "import.dl"

// TODO(lb): Delete this, see todo.dl
#line 1 "todo.dl"
#include "todo.dl"
Loading