[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #120149)
Cyndy Ishida via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 19 12:31:41 PST 2024
================
@@ -2539,6 +2550,18 @@ void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs
llvm::sys::path::append(P, "usr", "include");
addExternCSystemInclude(DriverArgs, CC1Args, P.str());
}
+
+ // Add default framework search paths
+ auto addFrameworkInclude = [&](auto ...Path) {
+ SmallString<128> P(Sysroot);
+ llvm::sys::path::append(P, Path...);
+
+ CC1Args.push_back("-internal-iframework");
+ CC1Args.push_back(DriverArgs.MakeArgString(P));
+ };
+ addFrameworkInclude("System", "Library", "Frameworks");
----------------
cyndyishida wrote:
Could we change the lambda `AddSearchPath` used for linker search args as a static function and reuse it for both places?
That way we could do
```
// For header search
addSearchPath(DriverArgs, CC1Args, Sysroot, "-internal-iframework", "/System/Library/Frameworks");
// For linker
addSearchPath(Args, CmdArgs, Sysroot, "-F", "/System/Library/Frameworks");
```
If that's not easily doable, having the `addFrameworkInclude` lambda accept the same types as `AddSearchPath` is nice.
https://github.com/llvm/llvm-project/pull/120149
More information about the cfe-commits
mailing list