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.
Depends on D137211.
Differential D137213
[clang][modules] NFCI: Pragma diagnostic mappings: write/read FileID instead of SourceLocation jansvoboda11 on Nov 1 2022, 5:04 PM. Authored by
Details 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. Depends on D137211.
Diff Detail
Event TimelineComment Actions LGTM, although I there's format-is-probably-compatible-version as a courtesy for tooling, does that need a bump here? Comment Actions Good point, I'll bump VERSION_MAJOR in clang/include/clang/Serialization/ASTBitCodes.h before committing. Comment Actions Heads up: this commit has broken compilation in a small number of cases: some #includes from modularized headers now fail to be found. I'm still trying to figure out what exactly happened, but some behavior has definitely changed by this commit. Comment Actions Looks like our tests fail because ReadFileID doesn't translate file ID as ReadSourceLocation/TranslateSourceLocation do. Please see the prototype fix inline.
Comment Actions I just realized @jansvoboda11 is probably out on holiday this week (IIRC, Apple usually gets this week off). Since this was committed almost a month ago, I'm guessing this isn't enough of a blocker that we need to revert rather than wait until next week (and there are some commits on top that rely on this!). But probably reverting the stack would be an option if it's critical. In the meantime, I'll try to help.
Comment Actions Now that the behaviour change is understood, maybe it'd be useful to split the patch in two:
That way, the future temporary reverts won't churn the file format. For example, downstreams that hit problems and need to temporarily revert can just revert the second patch. (... assuming that @rsmith/others confirm that implying -I is undesirable... or, if it's desired, surely there's a more explicit way to implement it.)
|
This doesn't work as before, likely because ReadFileID doesn't do TranslateSourceLocation.
Our tests fail.
I tried calling TranslateSourceLocation here and the tests passed:
Sorry I don't know the codebase, so this fix is definitely ugly :) But it shows the problem.