This is an archive of the discontinued LLVM Phabricator instance.

[clang][HeaderSearch] Treat framework headers as System for suggestPath
ClosedPublic

Authored by dgoldman on Jul 31 2023, 8:48 AM.

Details

Summary
  • Rename the IsSystem flag to be IsAngled since that's how callers actually use the flag.
  • Since frameworks by convention use <> style includes, make sure we treat them as Angled

    Also update clangd's custom logic for frameworks accordingly.

Diff Detail

Event Timeline

dgoldman created this revision.Jul 31 2023, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 8:48 AM
Herald added a subscriber: arphaman. · View Herald Transcript
dgoldman requested review of this revision.Jul 31 2023, 8:48 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 31 2023, 8:48 AM
dgoldman updated this revision to Diff 546017.Aug 1 2023, 6:11 AM

run clang-format

kadircet added inline comments.Aug 3 2023, 5:12 AM
clang/lib/Lex/HeaderSearch.cpp
1939

sorry I guess my suggestion get distorted a little bit on the way :D

I was actually suggesting to rename IsSystem to IsAngled, and change the logic in the rest of the code here to look for angled-ness of include search path, rather than system-ness.
As all of the current callers make use of this information to figure out if they should spell the includes with angles or quotes and set it if the include search dir is either part of angled or system includes.

That way we make sure we're not giving mixed signals out of this function. WDYT?

dgoldman updated this revision to Diff 546927.Aug 3 2023, 10:18 AM

Rename IsSystem to IsAngled

dgoldman marked an inline comment as done.Aug 3 2023, 10:18 AM
dgoldman updated this revision to Diff 547011.Aug 3 2023, 2:55 PM

run clang-format again

dgoldman edited the summary of this revision. (Show Details)Aug 3 2023, 2:56 PM
kadircet accepted this revision.Aug 9 2023, 1:42 AM

thanks!

This revision is now accepted and ready to land.Aug 9 2023, 1:42 AM