-
Notifications
You must be signed in to change notification settings - Fork 10.5k
runtime: explicitly namespace ArrayRef in shared headers #31746
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
Conversation
@swift-ci please test |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
@swift-ci please test windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have whitespace problems everywhere you've spelled out llvm::ArrrayRef
.
I don't know how spelling out llvm::ArrayRef
in a bunch of places is easier to make use an inline namespace than a using
declaration in a common location. I also don't know what ODR problems you could possibly be having with ArrayRef
.
I can re-clang-format the changed areas. The explicit spelling helps by allowing the swift runtime to have a completely isolated The ODR violations that I am referring to occur when LLVM libraries are used in the same address space as the Swift runtime and are at different versions. There are collisions which occur due to the runtime's use of the |
There are a set of headers shared between the Swift compiler and the runtime. Ensure that we explicitly use `llvm::ArrayRef` rather than `ArrayRef` which is aliased to `::llvm::ArrayRef`. Doing so enables us to replace the `ArrayRef` with an inline namespaced version fixing ODR violations when the swift runtime is loaded into an address space with LLVM.
@rjmccall thanks for pointing out the whitespace issue, I really missed that. Ran clang-format over the patch again, definitely something went wrong originally. |
@swift-ci please test |
@swift-ci please test Windows platform |
There are a set of headers shared between the Swift compiler and the
runtime. Ensure that we explicitly use
llvm::ArrayRef
rather thanArrayRef
which is aliased to::llvm::ArrayRef
. Doing so enables usto replace the
ArrayRef
with an inline namespaced version fixing ODRviolations when the swift runtime is loaded into an address space with
LLVM.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.