[llvm-branch-commits] [clang] d6d97e8 - [Driver][FreeBSD] Further simplify the Driver handling for older FreeBSD releases

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 2 23:48:08 PST 2023


Author: Brad Smith
Date: 2023-03-02T23:46:54-08:00
New Revision: d6d97e82e0b621c6567570833aabef24b3fc46b9

URL: https://github.com/llvm/llvm-project/commit/d6d97e82e0b621c6567570833aabef24b3fc46b9
DIFF: https://github.com/llvm/llvm-project/commit/d6d97e82e0b621c6567570833aabef24b3fc46b9.diff

LOG: [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 4dd4eb939caef1138c655e22bb4adc8978f16427)

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/FreeBSD.cpp
    clang/lib/Driver/ToolChains/FreeBSD.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp
index b3e0707d23d6..9a5af638c399 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -441,30 +441,14 @@ void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
                    concat(getDriver().SysRoot, "/usr/include/c++/v1"));
 }
 
-void FreeBSD::addLibStdCxxIncludePaths(
-    const llvm::opt::ArgList &DriverArgs,
-    llvm::opt::ArgStringList &CC1Args) const {
-  addLibStdCXXIncludePaths(concat(getDriver().SysRoot, "/usr/include/c++/4.2"),
-                           "", "", DriverArgs, CC1Args);
-}
-
 void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,
                                   ArgStringList &CmdArgs) const {
-  CXXStdlibType Type = GetCXXStdlibType(Args);
   unsigned Major = getTriple().getOSMajorVersion();
   bool Profiling = Args.hasArg(options::OPT_pg) && Major != 0 && Major < 14;
 
-  switch (Type) {
-  case ToolChain::CST_Libcxx:
-    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
-    if (Args.hasArg(options::OPT_fexperimental_library))
-      CmdArgs.push_back("-lc++experimental");
-    break;
-
-  case ToolChain::CST_Libstdcxx:
-    CmdArgs.push_back(Profiling ? "-lstdc++_p" : "-lstdc++");
-    break;
-  }
+  CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
+  if (Args.hasArg(options::OPT_fexperimental_library))
+    CmdArgs.push_back("-lc++experimental");
 }
 
 void FreeBSD::AddCudaIncludeArgs(const ArgList &DriverArgs,

diff  --git a/clang/lib/Driver/ToolChains/FreeBSD.h b/clang/lib/Driver/ToolChains/FreeBSD.h
index b12814a444c4..9b24ef1a1e1c 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.h
+++ b/clang/lib/Driver/ToolChains/FreeBSD.h
@@ -71,9 +71,6 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
 
   void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
                              llvm::opt::ArgStringList &CC1Args) const override;
-  void
-  addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
-                           llvm::opt::ArgStringList &CC1Args) const override;
   void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
                            llvm::opt::ArgStringList &CmdArgs) const override;
   void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,


        


More information about the llvm-branch-commits mailing list