[PATCH] D158376: [Driver] move DragonFly header search path management to the driver
Brad Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 28 19:45:04 PDT 2023
brad updated this revision to Diff 554140.
brad added a comment.
Remove C_INCLUDE_DIRS bits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158376/new/
https://reviews.llvm.org/D158376
Files:
clang/lib/Driver/ToolChains/DragonFly.cpp
clang/lib/Driver/ToolChains/DragonFly.h
clang/lib/Lex/InitHeaderSearch.cpp
Index: clang/lib/Lex/InitHeaderSearch.cpp
===================================================================
--- clang/lib/Lex/InitHeaderSearch.cpp
+++ clang/lib/Lex/InitHeaderSearch.cpp
@@ -327,9 +327,6 @@
break;
}
break;
- case llvm::Triple::DragonFly:
- AddPath("/usr/include/c++/5.0", CXXSystem, false);
- break;
default:
break;
}
@@ -339,6 +336,7 @@
const llvm::Triple &triple) {
switch (triple.getOS()) {
case llvm::Triple::AIX:
+ case llvm::Triple::DragonFly:
case llvm::Triple::Emscripten:
case llvm::Triple::FreeBSD:
case llvm::Triple::NaCl:
Index: clang/lib/Driver/ToolChains/DragonFly.h
===================================================================
--- clang/lib/Driver/ToolChains/DragonFly.h
+++ clang/lib/Driver/ToolChains/DragonFly.h
@@ -55,6 +55,13 @@
bool IsMathErrnoDefault() const override { return false; }
+ void
+ AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
+ void addLibStdCxxIncludePaths(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
+
protected:
Tool *buildAssembler() const override;
Tool *buildLinker() const override;
Index: clang/lib/Driver/ToolChains/DragonFly.cpp
===================================================================
--- clang/lib/Driver/ToolChains/DragonFly.cpp
+++ clang/lib/Driver/ToolChains/DragonFly.cpp
@@ -12,6 +12,7 @@
#include "clang/Driver/Driver.h"
#include "clang/Driver/Options.h"
#include "llvm/Option/ArgList.h"
+#include "llvm/Support/Path.h"
using namespace clang::driver;
using namespace clang::driver::tools;
@@ -195,6 +196,33 @@
getFilePaths().push_back("/usr/lib/gcc80");
}
+void DragonFly::AddClangSystemIncludeArgs(
+ const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
+ const Driver &D = getDriver();
+
+ if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
+ return;
+
+ if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
+ SmallString<128> Dir(D.ResourceDir);
+ llvm::sys::path::append(Dir, "include");
+ addSystemInclude(DriverArgs, CC1Args, Dir.str());
+ }
+
+ if (DriverArgs.hasArg(options::OPT_nostdlibinc))
+ return;
+
+ addExternCSystemInclude(DriverArgs, CC1Args,
+ concat(D.SysRoot, "/usr/include"));
+}
+
+void DragonFly::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const {
+ addLibStdCXXIncludePaths(concat(getDriver().SysRoot, "/usr/include/c++/8.0"), "", "",
+ DriverArgs, CC1Args);
+}
+
Tool *DragonFly::buildAssembler() const {
return new tools::dragonfly::Assembler(*this);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158376.554140.patch
Type: text/x-patch
Size: 2835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230829/db0b051b/attachment.bin>
More information about the cfe-commits
mailing list