Conversation
Define ROSE_SKIP_COMPILATION_OF_WAVE in rose_attributes_list.h so that all #ifndef ROSE_SKIP_COMPILATION_OF_WAVE guards across the codebase exclude the wave-specific code from compilation. The wave runtime path has been disabled since 2020 (see attachPreprocessingInfo.C:385), so those code blocks are already dead; this commit removes the compile-time dependency so librose.so no longer links libboost_wave. Changes in rose_attributes_list.h: - Define ROSE_SKIP_COMPILATION_OF_WAVE 1 at the top of the file - Remove #include <boost/wave.hpp> and #include <boost/wave/cpplexer/cpp_lex_token.hpp> - Add #include <string>, <vector>, <list> (formerly implicit via boost/wave) - Add minimal RoseToken struct as a clean API replacement for boost::wave::cpplexer::lex_token<> (value + position, same accessors) - Move token_type / token_container / token_list_container / token_container_container typedefs outside the wave guard so they remain available as stable public types - Remove extern token_container wave_tokenStream (dead wave global)
Now that ROSE_SKIP_COMPILATION_OF_WAVE gates are no longer needed
(the macro itself is removed along with all guarded blocks), clean up
the dead wave code throughout the codebase.
Deleted files (pure wave code):
- src/frontend/SageIII/advanced_preprocessing_hooks.h
- src/frontend/SageIII/attributeListMap.h
- src/frontend/SageIII/attributeListMap.C
Removed #ifndef ROSE_SKIP_COMPILATION_OF_WAVE blocks from:
- rose_attributes_list.h: wave member vars, wave constructors, wave accessors
- rose_attributes_list.C: all 15 wave function implementations
- attachPreprocessingInfo.C: wave typedefs, wave includes, wave runtime branch
- astTokenStream/doCompleteMapping.{h,C}: wave separator functions
- astTokenStream/createMap.{h,C}: wave token stream constructor/accessor
- astTokenStream/unparseMacro.C: wave macro expansion block
- sageInterface/sageInterface.C: wave macro call expansion
Build system:
- Makefile.am: remove attributeListMap.C from libsage3Sources;
remove dead header refs from EXTRA_DIST
- config/support-rose.m4: remove --with-wave-default configure option
…in ROSETTA CMakeLists.txt was still listing attributeListMap.C (deleted in the dead-code cleanup) causing a CMake error in CI. Remove it from SAGE3_SOURCES. Support.code had a ROSE_SKIP_COMPILATION_OF_WAVE define and a guarded boost::wave block that was emitted verbatim into the generated Cxx_Grammar.h. After the cleanup commit removed the macro definition from rose_attributes_list.h, the guard evaluated true and caused a build failure. Remove both the define and the boost::wave block; regenerate Cxx_Grammar.h from the fixed template. Verified locally: rose_attributes_list.lo and attachPreprocessingInfo.lo compile cleanly after Cxx_Grammar.h regeneration.
ROSE_WAVE_DEFAULT was generated by the --with-wave-default configure option in support-rose.m4, which was removed as part of the wave cleanup. Replace the single usage with a literal false so that wave is always off by default (user can still pass -rose:wave explicitly, which will hit the ROSE_ABORT in attachPreprocessingInfo.C).
Wave support is gone, so there is no point keeping the -rose:wave
command-line option or any of its downstream state:
- cmdline.cpp: remove both isOption("-rose:wave") parsing blocks
(SgFile and SgProject), along with the verbose get_wave() prints
- attachPreprocessingInfo.C: remove the dead get_wave() guard block
and the usingWave local variable; simplify the call to
buildCommentAndCppDirectiveList (drop the bool argument)
- attachPreprocessingInfoTraversal.h: remove the use_Wave member
and drop bool use_Wave from the buildCommentAndCppDirectiveList
signature
- attachPreprocessingInfoTraversal.C: remove use_Wave from the
constructor and display(); drop bool use_Wave from the function
definition; delete the dead else branch (use_Wave == true path)
Compiled and verified locally.
All remaining boost dependencies in src/ were dead code or build artifacts with no actual usage: Source files — remove unused includes: - rtiHelpers.h: drop boost/lexical_cast.hpp (never called) - rose_attributes_list.C: drop boost/algorithm/string/case_conv.hpp (Ada case comment, no actual to_lower/to_upper calls) - attachPreprocessingInfo.C: drop boost/filesystem.hpp (comment said "exists()" but no boost::filesystem calls exist; std::filesystem is already included via FileSystem.h) Build system — remove stale BOOST_CPPFLAGS / BOOST_THREAD_LIB: - src/util/support/Makefile.am: none of the support sources include any boost header, so the thread flags served no purpose - src/util/graphs/Makefile.am: same - src/ROSETTA/src/CMakeLists.txt: ROSETTA sources use no boost headers; drop Boost_LIBRARIES from link_libs FileHelper.h — replace legacy variable names and unqualified calls: - Rename boostPath variables to inline std::filesystem::path(...) - Qualify unqualified create_directories/remove_all calls with std::filesystem:: (C++17, already required) - Remove the stale comment block about BOOST_FILESYSTEM_VERSION Compiled and verified locally (rose_attributes_list.lo, attachPreprocessingInfo.lo).
Build system:
- src/frontend/SageIII/virtualCFG/Makefile.am: remove $(BOOST_CPPFLAGS)
- exampleTranslators/*/CMakeLists.txt: remove ${Boost_LIBRARIES} from
target_link_libraries (no find_package(Boost) ran, so already empty)
- tutorial/CMakeLists.txt, tutorial/outliner/CMakeLists.txt: same
- tests/nonsmoke/functional/CMakeLists.txt: remove ${Boost_INCLUDE_DIRS}
- tests/.../CompileTests/CMakeLists.txt: same
- tests/.../copyAST_tests/CMakeLists.txt: remove ${Boost_LIBRARIES}
- tests/.../translatorTests/CMakeLists.txt: remove ${Boost_INCLUDE_DIRS}
Test programs — migrate from boost to C++17:
- tests/smoke/unit/Utility/testBitOps.C: drop boost/lexical_cast.hpp,
replace boost::lexical_cast<std::string>(x) with std::to_string(x)
- tests/smoke/unit/Utility/testToNumber.C: same
- tests/.../testFileNamesAndExtensions/translator.C: remove unused
boost/algorithm and boost/filesystem includes (no functions called)
Remove parallelASTMerge.C:
- tests/nonsmoke/functional/parallelASTMerge.C: delete; never wired
into any Makefile.am or CMakeLists.txt target; depends on
boost::thread/mutex/filesystem which we are removing.
Note: libboost-all-dev removal from .github/workflows/cmake.yml is
in a separate commit (requires PAT workflow scope).
ROSE no longer requires boost at compile time. All boost headers and link-time dependencies have been removed from src/. Remove libboost-all-dev from the CI apt install list to verify this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ROSE_SKIP_COMPILATION_OF_WAVE 1inrose_attributes_list.has the single change that removes the compile-timelibboost_wavedependency fromlibrose.so#include <boost/wave.hpp>and#include <boost/wave/cpplexer/cpp_lex_token.hpp>from the headerRoseTokenstruct as a clean, self-documenting replacement forboost::wave::cpplexer::lex_token<>— same public API (get_value(),get_position().get_file/line/column())token_type/token_containertypedefs outside the wave guard so they remain stable public typesBackground
The boost::wave preprocessor runtime path was commented out in 2020 (see
attachPreprocessingInfo.C:385). All wave-specific code throughout the codebase is already gated behind#ifndef ROSE_SKIP_COMPILATION_OF_WAVEguards. This PR defines that macro, making those guards take effect.src/Makefile.amalready lacks$(BOOST_WAVE_LIB)inlibrose_la_LIBADD(prior cleanup). After this source change + rebuild,ldd librose.so | grep wavewill return nothing.Dead code left for follow-up
The
#ifndef ROSE_SKIP_COMPILATION_OF_WAVEblocks in:rose_attributes_list.h(wave member vars, wave constructors)rose_attributes_list.C(wave constructor implementations)attachPreprocessingInfo.C(wave runtime path)doCompleteMapping.C/unparseMacro.C/sageInterface.C…can all be removed in a follow-up cleanup PR. They are now unreachable dead code.
Test plan
librose.sofrom this branch:make -C src -j$(nproc)ldd librose.so | grep wave→ emptyrose-compiler --rose:openmp:lowering hello_omp.cCloses #150