Skip to content

Fix build with -DLLVM_ENABLE_MODULES=1 #10217

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

Merged

Conversation

benlangmuir
Copy link

  • Explanation: Fixes compile errors seen when building with -DLLVM_ENABLE_MODULES=1. The specific changes are just adding some missing includes and replacing the include of the wrapper header Frontend/PCHContainerOperations.h with an include of the underlying Serialization/PCHContainerOperations.h header.
  • Scope: This is an NFC change and only affects the build.
  • Risk: Low. The previous include (Frontend/PCHContainerOperations.h) just wrapped this file (Serialization/PCHContainerOperations.h) anyway, so this just eliminates an unnecessary indirection. The other changes are just adding missing includes.
  • Tests: Existing tests pass.
  • Issues: rdar://146677307
  • Original PRs: [Modules] Fix cyclic module dependencies in clang llvm/llvm-project#102348 and https://github.com/llvm/llvm-project/pull/107654/files
  • Reviewers: @jansvoboda11 reviewed both upstream PRs

akyrtzi and others added 2 commits March 10, 2025 15:17
The errors fixed were:
* llvm-project/llvm/include/llvm/Analysis/SyntheticCountsUtils.h:33:22:
error: missing '#include <__fwd/vector.h>'; default argument of 'vector'
must be defined before it is used
*
llvm-project/clang/include/clang/Tooling/Inclusions/StandardLibrary.h:41:15:
error: missing '#include <vector>'; 'vector' must be declared before it
is used
*
llvm-project/llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:83:3:
error: missing '#include "llvm/ADT/PostOrderIterator.h"';
'ReversePostOrderTraversal' must be declared before it is used

(cherry picked from commit 9a84afe)
Breakup the cyclic dependency in module 'Clang_Frontend':
Clang_Frontend -> Clang_Serialization -> Clang_Frontend

(cherry picked from commit 61c0a6d)
@benlangmuir benlangmuir requested a review from a team as a code owner March 10, 2025 23:46
@benlangmuir
Copy link
Author

@swift-ci please test

@benlangmuir
Copy link
Author

@swift-ci please test llvm

Copy link

@cyndyishida cyndyishida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as this is to fix failing CI bots.

@benlangmuir
Copy link
Author

@swift-ci please test macOS

@benlangmuir
Copy link
Author

@swift-ci please test Windows

@kperryua kperryua merged commit 60e6635 into swiftlang:stable/20240723 Mar 12, 2025
4 of 5 checks passed
@benlangmuir benlangmuir deleted the fix-modules-build-stable branch March 12, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants