This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Teach dep directive scanner about _Pragma
ClosedPublic

Authored by benlangmuir on May 4 2023, 11:42 AM.

Details

Summary

While we cannot handle _Pragma used inside macros, we an handle this at the top level, and it some projects use the _Pragma("once") spelling like that, which was causing spurious failures in the scanner.

Limitations

  • Cannot handle #define ONCE _Pragma("once"), same issue as using @import in a macro -- ideally we should diagnose this in obvious cases
  • Our LangOpts are currently fixed, so we are not handling u"" strings or R"()" strings that require C11/C++11.

rdar://108629982

Diff Detail

Event Timeline

benlangmuir created this revision.May 4 2023, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 11:42 AM
benlangmuir requested review of this revision.May 4 2023, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 11:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
akyrtzi accepted this revision.May 9 2023, 9:59 AM
This revision is now accepted and ready to land.May 9 2023, 9:59 AM