[clang] [llvm] [clang][Hexagon] Add Picolibc as part of triple (PR #169613)
Brian Cain via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 26 10:38:54 PST 2025
================
@@ -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
More information about the llvm-commits
mailing list