[5.7] add default values for SymbolGraphOptions #59081
Merged
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.
Cherry-pick of #59037
Explanation: The
IncludeClangDocs
field ofSymbolGraphOptions
is uninitialized when generating symbol graphs during compilation. On Intel, this reads the value asfalse
. However, on ARM (at least ARM macOS), this reads the value astrue
. This PR adds default values toSymbolGraphOptions
, as well as explicitly setsIncludeClangDocs
to false when generating symbol graphs during compilation.Scope: Only has an effect when generating symbol graphs. Should not affect normal compilation.
Bug: rdar://93780666
Risk: Very low. The change sets values that were assumed to have already been set anyway. The values only have an effect when symbol graphs are requested; the only effect during normal compilation is the potential extra assignment when initializing the
CompilerInvocation
.Testing: The lit test
SymbolGraph/ClangImporter/EmitWhileBuilding.swift
has been updated to ensure that Clang symbols do not emit alocation
field. This field was erroneously being emitted on ARM Macs. Existing automated tests still pass.