Skip to content

[clang][modules] NFCI: Pragma diagnostic mappings: write/read FileID instead of SourceLocation #87427

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

jansvoboda11
Copy link
Contributor

For pragma diagnostic mappings, we always write/read SourceLocation with offset 0. This is equivalent to just writing a FileID, which is exactly what this patch starts doing.

Originally reviewed here: https://reviews.llvm.org/D137213

…instead of SourceLocation

For pragma diagnostic mappings, we always write/read `SourceLocation` with offset 0. This is equivalent to just writing a `FileID`, which is exactly what this patch starts doing.

Originally reviewed here: https://reviews.llvm.org/D137213
Comment on lines +6627 to +6628
// FIXME: Remove this once we don't need the side-effects.
(void)SourceMgr.getSLocEntryOrNull(FID);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be removed in a follow-up commit, to keep this one a true NFC. (Described in more detail in https://reviews.llvm.org/D137213.)

@jansvoboda11 jansvoboda11 merged commit c925c16 into llvm:main Apr 3, 2024
@jansvoboda11 jansvoboda11 deleted the pragma-diagnostic-mappings-file-id branch April 3, 2024 01:36
jansvoboda11 added a commit to swiftlang/llvm-project that referenced this pull request Apr 3, 2024
…` instead of `SourceLocation` (llvm#87427)

For pragma diagnostic mappings, we always write/read `SourceLocation`
with offset 0. This is equivalent to just writing a `FileID`, which is
exactly what this patch starts doing.

Originally reviewed here: https://reviews.llvm.org/D137213

(cherry picked from commit c925c16)
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.

2 participants