Skip to content

Commit d6d97e8

Browse files
brad0tstellar
authored andcommitted
[Driver][FreeBSD] Further simplify the Driver handling for older FreeBSD releases
Since GCC 4.2 was removed with 10.0 and newer the respective Driver bits can be removed. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D144778 (cherry picked from commit 4dd4eb9)
1 parent 9b2e09e commit d6d97e8

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

clang/lib/Driver/ToolChains/FreeBSD.cpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -441,30 +441,14 @@ void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
441441
concat(getDriver().SysRoot, "/usr/include/c++/v1"));
442442
}
443443

444-
void FreeBSD::addLibStdCxxIncludePaths(
445-
const llvm::opt::ArgList &DriverArgs,
446-
llvm::opt::ArgStringList &CC1Args) const {
447-
addLibStdCXXIncludePaths(concat(getDriver().SysRoot, "/usr/include/c++/4.2"),
448-
"", "", DriverArgs, CC1Args);
449-
}
450-
451444
void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,
452445
ArgStringList &CmdArgs) const {
453-
CXXStdlibType Type = GetCXXStdlibType(Args);
454446
unsigned Major = getTriple().getOSMajorVersion();
455447
bool Profiling = Args.hasArg(options::OPT_pg) && Major != 0 && Major < 14;
456448

457-
switch (Type) {
458-
case ToolChain::CST_Libcxx:
459-
CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
460-
if (Args.hasArg(options::OPT_fexperimental_library))
461-
CmdArgs.push_back("-lc++experimental");
462-
break;
463-
464-
case ToolChain::CST_Libstdcxx:
465-
CmdArgs.push_back(Profiling ? "-lstdc++_p" : "-lstdc++");
466-
break;
467-
}
449+
CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
450+
if (Args.hasArg(options::OPT_fexperimental_library))
451+
CmdArgs.push_back("-lc++experimental");
468452
}
469453

470454
void FreeBSD::AddCudaIncludeArgs(const ArgList &DriverArgs,

clang/lib/Driver/ToolChains/FreeBSD.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
7171

7272
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
7373
llvm::opt::ArgStringList &CC1Args) const override;
74-
void
75-
addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
76-
llvm::opt::ArgStringList &CC1Args) const override;
7774
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
7875
llvm::opt::ArgStringList &CmdArgs) const override;
7976
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,

0 commit comments

Comments
 (0)