================
@@ -769,11 +902,38 @@ void HexagonToolChain::addLibStdCxxIncludePaths(
                            DriverArgs, CC1Args);
 }
 
+void HexagonToolChain::AddClangCXXStdlibIncludeArgs(
+    const llvm::opt::ArgList &DriverArgs,
+    llvm::opt::ArgStringList &CC1Args) const {
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
+      DriverArgs.hasArg(options::OPT_nostdincxx))
+    return;
+  // For Picolibc baremetal, add libc++ headers via extern C system include
+  // from the normalized triple tree to match driver tests.
+  const Driver &D = getDriver();
+  if (getTriple().isPicolibc() && getTriple().getOS() != llvm::Triple::Linux) {
+    StringRef InstallDir = D.Dir;
+    addExternCSystemInclude(DriverArgs, CC1Args,
+                            InstallDir + "/../target/" +
+                                getTriple().normalize() + "/include/c++/v1");
+    return;
+  }
+  // Otherwise delegate to the chosen C++ stdlib include path helper.
+  switch (GetCXXStdlibType(DriverArgs)) {
+  case ToolChain::CST_Libcxx:
+    addLibCxxIncludePaths(DriverArgs, CC1Args);
+    break;
+  case ToolChain::CST_Libstdcxx:
+    addLibStdCxxIncludePaths(DriverArgs, CC1Args);
+    break;
+  }
----------------
androm3da wrote:

The default case here should be handled (perhaps `LLVM_UNREACHABLE`?).

https://github.com/llvm/llvm-project/pull/169613
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to