llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.75k stars 11.89k forks source link

[Driver][Darwin] Move the remaining bits for header path handling over to the Driver. #75638

Open brad0 opened 10 months ago

brad0 commented 10 months ago

The remaining bits for the header path handling need to be moved over to the Driver within AddClangSystemIncludeArgs() as has been done for other OS's to date.

clang/lib/Lex/InitHeaderSearch.cpp

https://github.com/llvm/llvm-project/blob/7113c80289d62de95bca818109324601a51fefd8/clang/lib/Lex/InitHeaderSearch.cpp#L343

  // NOTE: some additional header search logic is handled in the driver for
  // Darwin.
  if (triple.isOSDarwin()) {
    if (HSOpts.UseStandardSystemIncludes) {
      // Add the default framework include paths on Darwin.
      if (triple.isDriverKit()) {
        AddPath("/System/DriverKit/System/Library/Frameworks", System, true);
      } else {
        AddPath("/System/Library/Frameworks", System, true);
        AddPath("/Library/Frameworks", System, true);
      }
    }
    return;
  }
llvmbot commented 10 months ago

@llvm/issue-subscribers-clang-driver

Author: Brad Smith (brad0)

The remaining bits for the header path handling need to be moved over to the Driver within AddClangSystemIncludeArgs() as has been done for other OS's to date. clang/lib/Lex/InitHeaderSearch.cpp https://github.com/llvm/llvm-project/blob/7113c80289d62de95bca818109324601a51fefd8/clang/lib/Lex/InitHeaderSearch.cpp#L343 ``` // NOTE: some additional header search logic is handled in the driver for // Darwin. if (triple.isOSDarwin()) { if (HSOpts.UseStandardSystemIncludes) { // Add the default framework include paths on Darwin. if (triple.isDriverKit()) { AddPath("/System/DriverKit/System/Library/Frameworks", System, true); } else { AddPath("/System/Library/Frameworks", System, true); AddPath("/Library/Frameworks", System, true); } } return; } ```
MaskRay commented 10 months ago

@jansvoboda11 @jroelofs

https://reviews.llvm.org/D158376 (DragonFlyBSD) is a migration example.

brad0 commented 10 months ago

@MaskRay I had spoken to jroelofs on Discourse and he said to file an issue so he could pass it around to someone appropriate at Apple.

jroelofs commented 10 months ago

cc: @ldionne @cachemeifyoucan

ldionne commented 9 months ago

Reverted in https://github.com/llvm/llvm-project/commit/d34901f30b8b7ac8fe1437eeb588da6805b27cfb due to LSan issues.