@@ -2514,25 +2514,19 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
2514
2514
switch (GetCXXStdlibType (DriverArgs)) {
2515
2515
case ToolChain::CST_Libcxx: {
2516
2516
// On Darwin, libc++ can be installed in one of the following places:
2517
- // 1. Alongside the compiler in <install>/include/c++/v1
2518
- // 2. Alongside the compiler in <clang-executable-folder>/../include/c++/v1
2519
- // 3. In a SDK (or a custom sysroot) in <sysroot>/usr/include/c++/v1
2517
+ // 1. Alongside the compiler in <clang-executable-folder>/../include/c++/v1
2518
+ // 2. In a SDK (or a custom sysroot) in <sysroot>/usr/include/c++/v1
2520
2519
//
2521
2520
// The precedence of paths is as listed above, i.e. we take the first path
2522
2521
// that exists. Note that we never include libc++ twice -- we take the first
2523
2522
// path that exists and don't send the other paths to CC1 (otherwise
2524
2523
// include_next could break).
2525
- //
2526
- // Also note that in most cases, (1) and (2) are exactly the same path.
2527
- // Those two paths will differ only when the `clang` program being run
2528
- // is actually a symlink to the real executable.
2529
2524
2530
2525
// Check for (1)
2531
2526
// Get from '<install>/bin' to '<install>/include/c++/v1'.
2532
2527
// Note that InstallBin can be relative, so we use '..' instead of
2533
2528
// parent_path.
2534
- llvm::SmallString<128 > InstallBin =
2535
- llvm::StringRef (getDriver ().Dir ); // <install>/bin
2529
+ llvm::SmallString<128 > InstallBin (getDriver ().Dir ); // <install>/bin
2536
2530
llvm::sys::path::append (InstallBin, " .." , " include" , " c++" , " v1" );
2537
2531
if (getVFS ().exists (InstallBin)) {
2538
2532
addSystemInclude (DriverArgs, CC1Args, InstallBin);
@@ -2542,20 +2536,7 @@ void DarwinClang::AddClangCXXStdlibIncludeArgs(
2542
2536
<< " \"\n " ;
2543
2537
}
2544
2538
2545
- // (2) Check for the folder where the executable is located, if different.
2546
- if (getDriver ().Dir != getDriver ().Dir ) {
2547
- InstallBin = llvm::StringRef (getDriver ().Dir );
2548
- llvm::sys::path::append (InstallBin, " .." , " include" , " c++" , " v1" );
2549
- if (getVFS ().exists (InstallBin)) {
2550
- addSystemInclude (DriverArgs, CC1Args, InstallBin);
2551
- return ;
2552
- } else if (DriverArgs.hasArg (options::OPT_v)) {
2553
- llvm::errs () << " ignoring nonexistent directory \" " << InstallBin
2554
- << " \"\n " ;
2555
- }
2556
- }
2557
-
2558
- // Otherwise, check for (3)
2539
+ // Otherwise, check for (2)
2559
2540
llvm::SmallString<128 > SysrootUsr = Sysroot;
2560
2541
llvm::sys::path::append (SysrootUsr, " usr" , " include" , " c++" , " v1" );
2561
2542
if (getVFS ().exists (SysrootUsr)) {
0 commit comments