Skip to content

[Runtime] Remove dependency on Compiler.h from Config.h. #17702

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
merged 1 commit into from
Jul 3, 2018

Conversation

dcci
Copy link
Member

@dcci dcci commented Jul 3, 2018

The runtime doesn't really need Compiler.h. It just needs some
visibility macros which can be inlined here instead of pulling
the whole heavyweight header (including its transitive closure,
llvm-config.h). This is becoming more important now that Compiler.h
includes C++ headers (namely, ), and swift/Runtime/Config.h
can be included from C or Objective-C files (causing build failures).

rdar://problem/35860874

The runtime doesn't really need Compiler.h. It just needs some
visibility macros which can be inlined here instead of pulling
the whole heavyweight header (including its transitive closure,
llvm-config.h). This is becoming more important now that Compiler.h
includes C++ headers (namely, <new>), and swift/Runtime/Config.h
can be included from C or Objective-C files (causing build failures).

<rdar://problem/35860874>
@dcci dcci requested review from gparker42 and bob-wilson July 3, 2018 17:43
/// Extend the default __GNUC_PREREQ even if glibc's features.h isn't
/// available.
#ifndef SWIFT_RUNTIME_GNUC_PREREQ
# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we up to the point where the runtime is always built with the just-built Clang? If so, we can drop all this too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we always use the just-built Clang to build the runtime. We've discussed changes to allow building the stdlib and runtime separately (where there may not be a just-built Clang), but in that case, if someone chooses to use that option (in some future version where it is supported), I think we will then require the system compiler to be a suitably recent version of Clang.

@dcci dcci merged commit 44af870 into swiftlang:master-next Jul 3, 2018
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.

3 participants