Skip to content

Commit 1ca775f

Browse files
committed
refactor: Modularize codebase and separate implementation from headers
This commit restructures the project from a flat, header-heavy architecture into distinct modules (Core, Analysis, Synthesis, UI, Z3) and moves implementation logic into compiled source files. - CMakeLists.txt: - Reorganize source files into module-specific groups - Update paths to reflect the new `src/<module>/` directory structure - include/structor/*.hpp (modified): - Remove inline implementations from `access_collector.hpp`, `layout_synthesizer.hpp`, `structure_persistence.hpp`, and `type_propagator.hpp` - Reduce headers to pure declarations to minimize include bloat - src/*/*.cpp (added): - Move implementation logic from headers to corresponding source files in `src/analysis/`, `src/synthesis/`, and `src/core/` - Remove `inline` keywords as functions are now compiled in translation units - include/structor/core/fwd.hpp (added): - Introduce a central forward-declaration header to reduce circular dependencies and compile-time coupling - include/structor/structor.hpp (added): - Add a master include header that aggregates the public API across all modules Impact: - Significantly improves incremental build times by breaking header dependencies. - No functional changes to plugin behavior; this is a purely structural refactor. - Establishes a clearer separation of concerns between analysis logic, Z3 integration, and UI code.
1 parent 4718401 commit 1ca775f

37 files changed

+3891
-3594
lines changed

CMakeLists.txt

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -232,17 +232,27 @@ include_directories(
232232
${CMAKE_SOURCE_DIR}/include
233233
)
234234

235-
# Source files
235+
# Source files - organized by module
236236
set(STRUCTOR_SOURCES
237-
src/plugin.cpp
238-
src/config.cpp
239-
src/access_collector.cpp
240-
src/layout_synthesizer.cpp
241-
src/vtable_detector.cpp
242-
src/type_propagator.cpp
243-
src/pseudocode_rewriter.cpp
244-
src/structure_persistence.cpp
245-
src/ui_integration.cpp
237+
# Core module
238+
src/core/config.cpp
239+
240+
# Analysis module
241+
src/analysis/access_collector.cpp
242+
src/analysis/cross_function_analyzer.cpp
243+
src/analysis/vtable_detector.cpp
244+
245+
# Synthesis module
246+
src/synthesis/layout_synthesizer.cpp
247+
src/synthesis/structure_persistence.cpp
248+
src/synthesis/type_propagator.cpp
249+
250+
# UI module
251+
src/ui/plugin.cpp
252+
src/ui/pseudocode_rewriter.cpp
253+
src/ui/ui_integration.cpp
254+
255+
# Z3 module
246256
src/z3/context.cpp
247257
src/z3/type_encoding.cpp
248258
src/z3/constraint_tracker.cpp
@@ -254,7 +264,6 @@ set(STRUCTOR_SOURCES
254264
src/z3/type_inference_engine.cpp
255265
src/z3/alias_analysis.cpp
256266
src/z3/type_applicator.cpp
257-
src/cross_function_analyzer.cpp
258267
)
259268

260269
set(STRUCTOR_HEADERS

0 commit comments

Comments
 (0)