Remove dubious module dependencies in goto-programs#8767
Remove dubious module dependencies in goto-programs#8767tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
Move call_graph and does_remove_const from analyses to goto-programs to eliminate the analyses dependency from goto-programs. Update build files and include paths accordingly. The goto-symex dependency in goto-programs (for GraphML witnesses) is retained as it requires access to ansi-c and xmllang which are allowed dependencies of goto-programs but not of goto-symex. Fixes: diffblue#571 Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
1a52fae to
62e1164
Compare
There was a problem hiding this comment.
Pull request overview
This PR restructures CBMC’s module layering to reduce “dubious” cross-module dependencies by relocating call-graph and const-removal utilities into goto-programs, and updating includes/build metadata accordingly (Fixes #571).
Changes:
- Move
call_graph/call_graph_helpersanddoes_remove_constusage over togoto-programsheaders and sources. - Update unit tests and
goto-instrumentcode to include the newgoto-programs/*headers. - Adjust
goto-programsbuild metadata to drop theanalyseslink dependency and update module dependency declarations.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| unit/analyses/does_remove_const/is_type_at_least_as_const_as.cpp | Switch unit test includes to goto-programs/does_remove_const.h. |
| unit/analyses/does_remove_const/does_type_preserve_const_correctness.cpp | Switch unit test includes to goto-programs/does_remove_const.h. |
| unit/analyses/does_remove_const/does_remove_const_util.h | Point test utility at goto-programs/does_remove_const.h. |
| unit/analyses/does_remove_const/does_expr_lose_const.cpp | Switch unit test includes to goto-programs/does_remove_const.h. |
| unit/analyses/disconnect_unreachable_nodes_in_graph.cpp | Update include to goto-programs/call_graph_helpers.h. |
| unit/analyses/call_graph.cpp | Update includes to goto-programs/call_graph*.h. |
| src/goto-programs/slice_global_inits.cpp | Replace analyses/call_graph.h include with local call_graph.h. |
| src/goto-programs/remove_function_pointers.cpp | Replace analyses/does_remove_const.h include with local does_remove_const.h. |
| src/goto-programs/module_dependencies.txt | Remove analyses dependency entry and update comments. |
| src/goto-programs/Makefile | Add moved .cpp files to the goto-programs library build. |
| src/goto-programs/does_remove_const.h | New home/header-guard for does_remove_const API. |
| src/goto-programs/does_remove_const.cpp | New home for does_remove_const implementation. |
| src/goto-programs/CMakeLists.txt | Drop analyses from goto-programs link dependencies. |
| src/goto-programs/call_graph.h | New home/header-guard for call-graph API. |
| src/goto-programs/call_graph.cpp | New home for call-graph implementation; include path updates/formatting. |
| src/goto-programs/call_graph_helpers.h | New home/header-guard for call-graph helper API. |
| src/goto-programs/call_graph_helpers.cpp | New home for call-graph helper implementation; formatting updates. |
| src/goto-instrument/goto_instrument_parse_options.cpp | Update include to goto-programs/call_graph.h. |
| src/goto-instrument/aggressive_slicer.h | Update include to goto-programs/call_graph.h. |
| src/goto-instrument/aggressive_slicer.cpp | Update include to goto-programs/call_graph_helpers.h. |
| src/analyses/Makefile | Remove moved sources from analyses library build list. |
Comments suppressed due to low confidence (2)
src/goto-programs/call_graph.h:22
call_graph.husesstd::set,std::optional,std::unordered_map, andstd::stringin its public API (e.g.,locationst,directed_grapht::get_node_index,nodes_by_name,format_callsites) but doesn't include the corresponding standard headers. This makes the header non-self-contained and can break builds depending on transitive includes. Add the missing includes (e.g.,<set>,<optional>,<unordered_map>,<string>).
src/goto-programs/does_remove_const.h:26does_remove_const.hforward-declaressource_locationtbut exposes it by value insidestd::pair<bool, source_locationt>in theoperator()()signature. Becausestd::pairneeds a completesource_locationt, this header isn't self-contained and can fail to compile in translation units that include it without also includingutil/source_location.h. Include<util/source_location.h>here (or change the API to avoid returningsource_locationtby value).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,8 +1,7 @@ | |||
| analyses # dubious - concerns call_graph and does_remove_const | |||
| ansi-c # for GraphML witnesses | |||
| architecture # system | |||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8767 +/- ##
===========================================
+ Coverage 79.93% 80.41% +0.47%
===========================================
Files 1698 1703 +5
Lines 187698 188397 +699
Branches 73 73
===========================================
+ Hits 150034 151495 +1461
+ Misses 37664 36902 -762 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes: #571