[clang] Add support for sysroot-relative system header search paths (PR #82084)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 16 17:15:12 PST 2024
================
@@ -3229,16 +3244,7 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
IsIndexHeaderMap ? frontend::IndexHeaderMap : frontend::Angled;
bool IsFramework = A->getOption().matches(OPT_F);
- std::string Path = A->getValue();
-
- if (IsSysrootSpecified && !IsFramework && A->getValue()[0] == '=') {
- SmallString<32> Buffer;
- llvm::sys::path::append(Buffer, Opts.Sysroot,
- llvm::StringRef(A->getValue()).substr(1));
- Path = std::string(Buffer);
- }
-
- Opts.AddPath(Path, Group, IsFramework,
+ Opts.AddPath(ConvertHeaderPath(A, IsFramework), Group, IsFramework,
----------------
jansvoboda11 wrote:
Instead of prefixing the path with sysroot here, would it make sense to defer to `InitHeaderSearch::AddPath()` by calling `Opts.AddPath(..., /*IgnoreSysRoot=*/false)`? Note that this function only adds the prefix to absolute paths. Does that match GCC behavior?
https://github.com/llvm/llvm-project/pull/82084
More information about the cfe-commits
mailing list