Skip to content
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

Add an assertion that verifies the size of cached debug info types. #62499

Merged
merged 1 commit into from Feb 9, 2023

Conversation

adrian-prantl
Copy link
Member

@adrian-prantl adrian-prantl commented Dec 10, 2022

DebugTypeInfo: Prefer the size of the Storage type derived from the TypeInfo.

Previously type sizes would be inconsistently sourced from either the LLVM type
or the FixedTypeInfo, depending on the call site. This was problematic because
TypeInfo operates with a resolution of whole bytes, which means that types such
as i1 would get a reported as having a size of 8. This patch now asserts that
all occurrences of the same type have the same size as the first, cached
occurence.

To avoid triggering the cached type verification assertion, this patch avoids
caching of storage-sized containers. It also removes the unique identifier from
forward declarations, which could lead to type confusion during LTO.

rdar://102367872

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test source compatibility

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test source compatibility

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test source compatibility

@adrian-prantl
Copy link
Member Author

@swift-ci test

lib/IRGen/IRGenDebugInfo.cpp Outdated Show resolved Hide resolved
lib/IRGen/IRGenDebugInfo.cpp Outdated Show resolved Hide resolved
@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test source compatibility

@adrian-prantl
Copy link
Member Author

Nice, the only failure is an unrelated linker crash.

@adrian-prantl
Copy link
Member Author

@swift-ci test and merge

@adrian-prantl
Copy link
Member Author

@swift-ci test

3 similar comments
@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test macos

@adrian-prantl
Copy link
Member Author

@swift-ci test

1 similar comment
@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl
Copy link
Member Author

@swift-ci test platform macOS

@adrian-prantl
Copy link
Member Author

@swift-ci test macOS

1 similar comment
@adrian-prantl
Copy link
Member Author

@swift-ci test macOS

…ypeInfo.

Previously type sizes would be inconsistently sourced from either the LLVM type
or the FixedTypeInfo, depending on the call site. This was problematic because
TypeInfo operates with a resolution of whole bytes, which means that types such
as i1 would get a reported as having a size of 8. This patch now asserts that
all occurrences of the same type have the same size as the first, cached
occurence.

To avoid triggering the cached type verification assertion, this patch avoids
caching of storage-sized containers. It also removes the unique identifier from
forward declarations, which could lead to type confusion during LTO.

rdar://102367872
@adrian-prantl
Copy link
Member Author

@swift-ci test and merge

@swift-ci swift-ci merged commit 1bfb3e6 into apple:main Feb 9, 2023
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.

None yet

3 participants