[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #75841)

Alan Zhao via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 13:44:15 PST 2024


alanzhao1 wrote:

If we pass `-v` to Clang, we get the following include directories:

without this patch:

```
clang -cc1 version 18.0.0git based upon LLVM 18.0.0git default target arm64-apple-darwin23.3.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk//Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
 /Users/ayzhao/src/llvm-project/build/lib/clang/18/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk//System/Library/Frameworks (framework directory)
End of search list.
```

with this patch:

```
clang -cc1 version 18.0.0git based upon LLVM 18.0.0git default target arm64-apple-darwin23.3.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
 /Users/ayzhao/src/llvm-project/build/lib/clang/18/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
End of search list.
```

So it looks like this patch causes Clang to think that the directory `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk//Library/Frameworks` exists when it doesn't.

https://github.com/llvm/llvm-project/pull/75841


More information about the cfe-commits mailing list