This is an archive of the discontinued LLVM Phabricator instance.

[Frontend] Restore Preprocessor::getPredefines()
ClosedPublic

Authored by royjacobson on Aug 31 2022, 12:33 PM.

Details

Summary

https://reviews.llvm.org/rG6bbf51f3ed59ae37f0fec729f25af002111c9e74 from May removed Preprocessor::getPredefines() from Clang's API, presumably as a cleanup because this method is unused in the LLVM codebase.

However, it was/is used by a small number of third-party tools and is pretty harmless, so this patch adds it back and documents why it's here.

The issue was raised in https://github.com/llvm/llvm-project/issues/57483, it would be nice to be able to land it into Clang 15 as it breaks those third-party tools and we can't easily add it back in bug fix releases.

Diff Detail

Event Timeline

royjacobson created this revision.Aug 31 2022, 12:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 12:33 PM
royjacobson requested review of this revision.Aug 31 2022, 12:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 12:33 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
brad.king accepted this revision.Aug 31 2022, 12:47 PM

LGTM. After applying this patch locally on top of the release/15.x branch, CastXML builds again. Thanks!

This revision is now accepted and ready to land.Aug 31 2022, 12:47 PM
thieta accepted this revision.Aug 31 2022, 12:56 PM

LGTM and seems pretty safe so I am not opposed to merge it before 15 final.

I would maybe add a link to the GitHub issue in the comment, but that's a nit.

royjacobson edited the summary of this revision. (Show Details)Aug 31 2022, 1:15 PM
royjacobson edited the summary of this revision. (Show Details)

Add a link to github issue.

brad.king accepted this revision.Aug 31 2022, 1:16 PM
This revision was landed with ongoing or failed builds.Aug 31 2022, 1:16 PM
This revision was automatically updated to reflect the committed changes.