[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:07:17 PST 2024


================
@@ -3256,12 +3262,14 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
   }
 
   for (const auto *A : Args.filtered(OPT_idirafter))
-    Opts.AddPath(A->getValue(), frontend::After, false, true);
+    Opts.AddPath(ConvertHeaderPath(A), frontend::After, false, true);
   for (const auto *A : Args.filtered(OPT_iquote))
-    Opts.AddPath(A->getValue(), frontend::Quoted, false, true);
-  for (const auto *A : Args.filtered(OPT_isystem, OPT_iwithsysroot))
+    Opts.AddPath(ConvertHeaderPath(A), frontend::Quoted, false, true);
+  for (const auto *A : Args.filtered(OPT_iwithsysroot))
     Opts.AddPath(A->getValue(), frontend::System, false,
-                 !A->getOption().matches(OPT_iwithsysroot));
+                 /*IgnoreSysRoot=*/false);
+  for (const auto *A : Args.filtered(OPT_isystem))
----------------
jansvoboda11 wrote:

Handling `OPT_isystem` in a loop separate from `OPT_iwithsysroot` is a behavior change. Is that intentional?

Previously "-isystem A -iwithsysroot B -isystem C" would result in "A B C", now it results in "B A C".

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


More information about the cfe-commits mailing list