Author: arphaman Date: Tue Jun 19 12:43:07 2018 New Revision: 335073 URL: http://llvm.org/viewvc/llvm-project?rev=335073&view=rev Log: Revert r335063 as it causes bot failures
Removed: cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td cfe/trunk/include/clang/Lex/HeaderSearch.h cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=335073&r1=335072&r2=335073&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Tue Jun 19 12:43:07 2018 @@ -236,9 +236,4 @@ def err_invalid_vfs_overlay : Error< def warn_option_invalid_ocl_version : Warning< "OpenCL version %0 does not support the option '%1'">, InGroup<Deprecated>; - -def warn_stdlibcxx_not_found : Warning< - "include path for stdlibc++ headers not found; pass '-std=libc++' on the " - "command line to use the libc++ standard library instead">, - InGroup<DiagGroup<"stdlibcxx-not-found">>; } Modified: cfe/trunk/include/clang/Lex/HeaderSearch.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearch.h?rev=335073&r1=335072&r2=335073&view=diff ============================================================================== --- cfe/trunk/include/clang/Lex/HeaderSearch.h (original) +++ cfe/trunk/include/clang/Lex/HeaderSearch.h Tue Jun 19 12:43:07 2018 @@ -272,8 +272,6 @@ public: FileManager &getFileMgr() const { return FileMgr; } - DiagnosticsEngine &getDiags() const { return Diags; } - /// Interface for setting the file search paths. void SetSearchPaths(const std::vector<DirectoryLookup> &dirs, unsigned angledDirIdx, unsigned systemDirIdx, Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=335073&r1=335072&r2=335073&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original) +++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Tue Jun 19 12:43:07 2018 @@ -14,7 +14,6 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" #include "clang/Config/config.h" // C_INCLUDE_DIRS -#include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Frontend/Utils.h" #include "clang/Lex/HeaderMap.h" #include "clang/Lex/HeaderSearch.h" @@ -56,13 +55,11 @@ public: /// AddPath - Add the specified path to the specified group list, prefixing /// the sysroot if used. - /// Returns true if the path exists, false if it was ignored. - bool AddPath(const Twine &Path, IncludeDirGroup Group, bool isFramework); + void AddPath(const Twine &Path, IncludeDirGroup Group, bool isFramework); /// AddUnmappedPath - Add the specified path to the specified group list, /// without performing any sysroot remapping. - /// Returns true if the path exists, false if it was ignored. - bool AddUnmappedPath(const Twine &Path, IncludeDirGroup Group, + void AddUnmappedPath(const Twine &Path, IncludeDirGroup Group, bool isFramework); /// AddSystemHeaderPrefix - Add the specified prefix to the system header @@ -73,9 +70,10 @@ public: /// AddGnuCPlusPlusIncludePaths - Add the necessary paths to support a gnu /// libstdc++. - /// Returns true if the \p Base path was found, false if it does not exist. - bool AddGnuCPlusPlusIncludePaths(StringRef Base, StringRef ArchDir, - StringRef Dir32, StringRef Dir64, + void AddGnuCPlusPlusIncludePaths(StringRef Base, + StringRef ArchDir, + StringRef Dir32, + StringRef Dir64, const llvm::Triple &triple); /// AddMinGWCPlusPlusIncludePaths - Add the necessary paths to support a MinGW @@ -90,8 +88,7 @@ public: // AddDefaultCPlusPlusIncludePaths - Add paths that should be searched when // compiling c++. - void AddDefaultCPlusPlusIncludePaths(const LangOptions &LangOpts, - const llvm::Triple &triple, + void AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOptions &HSOpts); /// AddDefaultSystemIncludePaths - Adds the default system include paths so @@ -115,7 +112,7 @@ static bool CanPrefixSysroot(StringRef P #endif } -bool InitHeaderSearch::AddPath(const Twine &Path, IncludeDirGroup Group, +void InitHeaderSearch::AddPath(const Twine &Path, IncludeDirGroup Group, bool isFramework) { // Add the path with sysroot prepended, if desired and this is a system header // group. @@ -123,14 +120,15 @@ bool InitHeaderSearch::AddPath(const Twi SmallString<256> MappedPathStorage; StringRef MappedPathStr = Path.toStringRef(MappedPathStorage); if (CanPrefixSysroot(MappedPathStr)) { - return AddUnmappedPath(IncludeSysroot + Path, Group, isFramework); + AddUnmappedPath(IncludeSysroot + Path, Group, isFramework); + return; } } - return AddUnmappedPath(Path, Group, isFramework); + AddUnmappedPath(Path, Group, isFramework); } -bool InitHeaderSearch::AddUnmappedPath(const Twine &Path, IncludeDirGroup Group, +void InitHeaderSearch::AddUnmappedPath(const Twine &Path, IncludeDirGroup Group, bool isFramework) { assert(!Path.isTriviallyEmpty() && "can't handle empty path here"); @@ -152,7 +150,7 @@ bool InitHeaderSearch::AddUnmappedPath(c if (const DirectoryEntry *DE = FM.getDirectory(MappedPathStr)) { IncludePath.push_back( std::make_pair(Group, DirectoryLookup(DE, Type, isFramework))); - return true; + return; } // Check to see if this is an apple-style headermap (which are not allowed to @@ -164,7 +162,7 @@ bool InitHeaderSearch::AddUnmappedPath(c IncludePath.push_back( std::make_pair(Group, DirectoryLookup(HM, Type, Group == IndexHeaderMap))); - return true; + return; } } } @@ -172,16 +170,15 @@ bool InitHeaderSearch::AddUnmappedPath(c if (Verbose) llvm::errs() << "ignoring nonexistent directory \"" << MappedPathStr << "\"\n"; - return false; } -bool InitHeaderSearch::AddGnuCPlusPlusIncludePaths(StringRef Base, +void InitHeaderSearch::AddGnuCPlusPlusIncludePaths(StringRef Base, StringRef ArchDir, StringRef Dir32, StringRef Dir64, const llvm::Triple &triple) { // Add the base dir - bool IsBaseFound = AddPath(Base, CXXSystem, false); + AddPath(Base, CXXSystem, false); // Add the multilib dirs llvm::Triple::ArchType arch = triple.getArch(); @@ -193,7 +190,6 @@ bool InitHeaderSearch::AddGnuCPlusPlusIn // Add the backward dir AddPath(Base + "/backward", CXXSystem, false); - return IsBaseFound; } void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(StringRef Base, @@ -358,55 +354,46 @@ void InitHeaderSearch::AddDefaultCInclud } } -void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths( - const LangOptions &LangOpts, const llvm::Triple &triple, - const HeaderSearchOptions &HSOpts) { +void InitHeaderSearch:: +AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOptions &HSOpts) { llvm::Triple::OSType os = triple.getOS(); // FIXME: temporary hack: hard-coded paths. if (triple.isOSDarwin()) { - bool IsBaseFound = true; switch (triple.getArch()) { default: break; case llvm::Triple::ppc: case llvm::Triple::ppc64: - IsBaseFound = AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", - "powerpc-apple-darwin10", "", - "ppc64", triple); - IsBaseFound |= AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", - "powerpc-apple-darwin10", "", - "ppc64", triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", + "powerpc-apple-darwin10", "", "ppc64", + triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", + "powerpc-apple-darwin10", "", "ppc64", + triple); break; case llvm::Triple::x86: case llvm::Triple::x86_64: - IsBaseFound = AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", - "i686-apple-darwin10", "", - "x86_64", triple); - IsBaseFound |= AddGnuCPlusPlusIncludePaths( - "/usr/include/c++/4.0.0", "i686-apple-darwin8", "", "", triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", + "i686-apple-darwin10", "", "x86_64", triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", + "i686-apple-darwin8", "", "", triple); break; case llvm::Triple::arm: case llvm::Triple::thumb: - IsBaseFound = AddGnuCPlusPlusIncludePaths( - "/usr/include/c++/4.2.1", "arm-apple-darwin10", "v7", "", triple); - IsBaseFound |= AddGnuCPlusPlusIncludePaths( - "/usr/include/c++/4.2.1", "arm-apple-darwin10", "v6", "", triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", + "arm-apple-darwin10", "v7", "", triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", + "arm-apple-darwin10", "v6", "", triple); break; case llvm::Triple::aarch64: - IsBaseFound = AddGnuCPlusPlusIncludePaths( - "/usr/include/c++/4.2.1", "arm64-apple-darwin10", "", "", triple); + AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", + "arm64-apple-darwin10", "", "", triple); break; } - // Warn when compiling pure C++ / Objective-C++ only. - if (!IsBaseFound && - !(LangOpts.CUDA || LangOpts.OpenCL || LangOpts.RenderScript)) { - Headers.getDiags().Report(SourceLocation(), - diag::warn_stdlibcxx_not_found); - } return; } @@ -491,7 +478,7 @@ void InitHeaderSearch::AddDefaultInclude } AddPath("/usr/include/c++/v1", CXXSystem, false); } else { - AddDefaultCPlusPlusIncludePaths(Lang, triple, HSOpts); + AddDefaultCPlusPlusIncludePaths(triple, HSOpts); } } Removed: cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp?rev=335072&view=auto ============================================================================== --- cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp (original) +++ cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp (removed) @@ -1,5 +0,0 @@ -// RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist %s 2>&1 | FileCheck %s -// RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist -stdlib=libc++ %s -verify -// CHECK: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead - -// expected-no-diagnostics _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits