[clang] [Clang][Hexagon] Use --cstdlib flag to choose Picolibc (PR #183257)
Alexey Karyakin via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 7 07:55:59 PDT 2026
================
@@ -745,29 +767,33 @@ void HexagonToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
}
}
-void HexagonToolChain::addLibCxxIncludePaths(
- const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const {
- SmallString<128> Dir;
- getBaseIncludeDir(Dir);
- llvm::sys::path::append(Dir, "c++", "v1");
- addLibStdCXXIncludePaths(Dir, "", "", DriverArgs, CC1Args);
-}
+void HexagonToolChain::AddClangCXXStdlibIncludeArgs(
+ const ArgList &DriverArgs, ArgStringList &CC1Args) const {
+ if (DriverArgs.hasArg(options::OPT_nostdinc, options::OPT_nostdlibinc,
+ options::OPT_nostdincxx))
+ return;
-void HexagonToolChain::addLibStdCxxIncludePaths(
- const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const {
SmallString<128> Dir;
- getBaseIncludeDir(Dir);
- llvm::sys::path::append(Dir, "c++");
- addLibStdCXXIncludePaths(Dir, "", "", DriverArgs, CC1Args);
+ getBaseIncludeDir(DriverArgs, Dir);
+
+ CXXStdlibType Type = GetCXXStdlibType(DriverArgs);
+ switch (Type) {
+ case ToolChain::CST_Libcxx:
+ llvm::sys::path::append(Dir, "c++", "v1");
+ addSystemInclude(DriverArgs, CC1Args, Dir);
+ break;
+ case ToolChain::CST_Libstdcxx:
+ llvm::sys::path::append(Dir, "c++");
+ addSystemInclude(DriverArgs, CC1Args, Dir);
+ break;
+ }
----------------
quic-akaryaki wrote:
It seems addLibStdCXXIncludePaths() is the standard way to add C++ include path and other targets use it. I think it's better to stick to it unless there is a good reason. Is the failing test the only reason?
https://github.com/llvm/llvm-project/pull/183257
More information about the cfe-commits
mailing list