Skip to content

Commit f1e56ac

Browse files
authored
Revert "[Clang] Take libstdc++ into account during GCC detection" (#154368)
Reverts #145056
1 parent e04feda commit f1e56ac

File tree

37 files changed

+106
-319
lines changed

37 files changed

+106
-319
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@ latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or the
3737
Potentially Breaking Changes
3838
============================
3939

40-
- Clang will now emit a warning if the auto-detected GCC installation
41-
directory (i.e. the one with the largest version number) does not
42-
contain libstdc++ include directories although a "complete" GCC
43-
installation directory containing the include directories is
44-
available. It is planned to change the auto-detection to prefer the
45-
"complete" directory in the future. The warning will disappear if
46-
the libstdc++ include directories are either installed or removed
47-
for all GCC installation directories considered by the
48-
auto-detection; see the output of ``clang -v`` for a list of those
49-
directories. If the GCC installations cannot be modified and
50-
maintaining the current choice of the auto-detection is desired, the
51-
GCC installation directory can be selected explicitly using the
52-
``--gcc-install-dir`` command line argument. This will silence the
53-
warning. It can also be disabled using the
54-
``-Wno-gcc-install-dir-libstdcxx`` command line flag.
55-
5640
C/C++ Language Potentially Breaking Changes
5741
-------------------------------------------
5842

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,4 @@ def warn_drv_openacc_without_cir
885885
: Warning<"OpenACC directives will result in no runtime behavior; use "
886886
"-fclangir to enable runtime effect">,
887887
InGroup<SourceUsesOpenACC>;
888-
889-
def warn_drv_gcc_install_dir_libstdcxx : Warning<
890-
"future releases of the clang compiler will prefer GCC installations "
891-
"containing libstdc++ include directories; '%0' would be chosen over '%1'">,
892-
InGroup<DiagGroup<"gcc-install-dir-libstdcxx">>;
893888
}

clang/include/clang/Driver/ToolChain.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ class ToolChain {
224224
static void addSystemFrameworkInclude(const llvm::opt::ArgList &DriverArgs,
225225
llvm::opt::ArgStringList &CC1Args,
226226
const Twine &Path);
227+
static void addSystemInclude(const llvm::opt::ArgList &DriverArgs,
228+
llvm::opt::ArgStringList &CC1Args,
229+
const Twine &Path);
227230
static void addExternCSystemInclude(const llvm::opt::ArgList &DriverArgs,
228231
llvm::opt::ArgStringList &CC1Args,
229232
const Twine &Path);
@@ -243,9 +246,6 @@ class ToolChain {
243246
///@}
244247

245248
public:
246-
static void addSystemInclude(const llvm::opt::ArgList &DriverArgs,
247-
llvm::opt::ArgStringList &CC1Args,
248-
const Twine &Path);
249249
virtual ~ToolChain();
250250

251251
// Accessors

clang/lib/Driver/ToolChain.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,13 @@ void ToolChain::addSystemFrameworkInclude(const llvm::opt::ArgList &DriverArgs,
14091409
CC1Args.push_back(DriverArgs.MakeArgString(Path));
14101410
}
14111411

1412+
/// Utility function to add a system include directory to CC1 arguments.
1413+
void ToolChain::addSystemInclude(const ArgList &DriverArgs,
1414+
ArgStringList &CC1Args, const Twine &Path) {
1415+
CC1Args.push_back("-internal-isystem");
1416+
CC1Args.push_back(DriverArgs.MakeArgString(Path));
1417+
}
1418+
14121419
/// Utility function to add a system include directory with extern "C"
14131420
/// semantics to CC1 arguments.
14141421
///
@@ -1431,14 +1438,6 @@ void ToolChain::addExternCSystemIncludeIfExists(const ArgList &DriverArgs,
14311438
addExternCSystemInclude(DriverArgs, CC1Args, Path);
14321439
}
14331440

1434-
/// Utility function to add a system include directory to CC1 arguments.
1435-
/*static*/ void ToolChain::addSystemInclude(const ArgList &DriverArgs,
1436-
ArgStringList &CC1Args,
1437-
const Twine &Path) {
1438-
CC1Args.push_back("-internal-isystem");
1439-
CC1Args.push_back(DriverArgs.MakeArgString(Path));
1440-
}
1441-
14421441
/// Utility function to add a list of system framework directories to CC1.
14431442
void ToolChain::addSystemFrameworkIncludes(const ArgList &DriverArgs,
14441443
ArgStringList &CC1Args,

0 commit comments

Comments
 (0)