[Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.

llvm-svn: 173411
This commit is contained in:
Daniel Dunbar 2013-01-25 01:50:39 +00:00
parent c9c57e9181
commit 6b04f1d1be
1 changed files with 63 additions and 72 deletions

View File

@ -54,8 +54,7 @@ public:
/// AddPath - Add the specified path to the specified group list. /// AddPath - Add the specified path to the specified group list.
void AddPath(const Twine &Path, IncludeDirGroup Group, void AddPath(const Twine &Path, IncludeDirGroup Group,
bool isCXXAware, bool isUserSupplied, bool isCXXAware, bool isFramework, bool IgnoreSysRoot = false);
bool isFramework, bool IgnoreSysRoot = false);
/// AddSystemHeaderPrefix - Add the specified prefix to the system header /// AddSystemHeaderPrefix - Add the specified prefix to the system header
/// prefix list. /// prefix list.
@ -106,8 +105,7 @@ public:
void InitHeaderSearch::AddPath(const Twine &Path, void InitHeaderSearch::AddPath(const Twine &Path,
IncludeDirGroup Group, bool isCXXAware, IncludeDirGroup Group, bool isCXXAware,
bool isUserSupplied, bool isFramework, bool isFramework, bool IgnoreSysRoot) {
bool IgnoreSysRoot) {
assert(!Path.isTriviallyEmpty() && "can't handle empty path here"); assert(!Path.isTriviallyEmpty() && "can't handle empty path here");
FileManager &FM = Headers.getFileMgr(); FileManager &FM = Headers.getFileMgr();
@ -171,42 +169,42 @@ void InitHeaderSearch::AddGnuCPlusPlusIncludePaths(StringRef Base,
StringRef Dir64, StringRef Dir64,
const llvm::Triple &triple) { const llvm::Triple &triple) {
// Add the base dir // Add the base dir
AddPath(Base, CXXSystem, true, false, false); AddPath(Base, CXXSystem, true, false);
// Add the multilib dirs // Add the multilib dirs
llvm::Triple::ArchType arch = triple.getArch(); llvm::Triple::ArchType arch = triple.getArch();
bool is64bit = arch == llvm::Triple::ppc64 || arch == llvm::Triple::x86_64; bool is64bit = arch == llvm::Triple::ppc64 || arch == llvm::Triple::x86_64;
if (is64bit) if (is64bit)
AddPath(Base + "/" + ArchDir + "/" + Dir64, CXXSystem, true, false, false); AddPath(Base + "/" + ArchDir + "/" + Dir64, CXXSystem, true, false);
else else
AddPath(Base + "/" + ArchDir + "/" + Dir32, CXXSystem, true, false, false); AddPath(Base + "/" + ArchDir + "/" + Dir32, CXXSystem, true, false);
// Add the backward dir // Add the backward dir
AddPath(Base + "/backward", CXXSystem, true, false, false); AddPath(Base + "/backward", CXXSystem, true, false);
} }
void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(StringRef Base, void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(StringRef Base,
StringRef Arch, StringRef Arch,
StringRef Version) { StringRef Version) {
AddPath(Base + "/" + Arch + "/" + Version + "/include/c++", AddPath(Base + "/" + Arch + "/" + Version + "/include/c++",
CXXSystem, true, false, false); CXXSystem, true, false);
AddPath(Base + "/" + Arch + "/" + Version + "/include/c++/" + Arch, AddPath(Base + "/" + Arch + "/" + Version + "/include/c++/" + Arch,
CXXSystem, true, false, false); CXXSystem, true, false);
AddPath(Base + "/" + Arch + "/" + Version + "/include/c++/backward", AddPath(Base + "/" + Arch + "/" + Version + "/include/c++/backward",
CXXSystem, true, false, false); CXXSystem, true, false);
} }
void InitHeaderSearch::AddMinGW64CXXPaths(StringRef Base, void InitHeaderSearch::AddMinGW64CXXPaths(StringRef Base,
StringRef Version) { StringRef Version) {
// Assumes Base is HeaderSearchOpts' ResourceDir // Assumes Base is HeaderSearchOpts' ResourceDir
AddPath(Base + "/../../../include/c++/" + Version, AddPath(Base + "/../../../include/c++/" + Version,
CXXSystem, true, false, false); CXXSystem, true, false);
AddPath(Base + "/../../../include/c++/" + Version + "/x86_64-w64-mingw32", AddPath(Base + "/../../../include/c++/" + Version + "/x86_64-w64-mingw32",
CXXSystem, true, false, false); CXXSystem, true, false);
AddPath(Base + "/../../../include/c++/" + Version + "/i686-w64-mingw32", AddPath(Base + "/../../../include/c++/" + Version + "/i686-w64-mingw32",
CXXSystem, true, false, false); CXXSystem, true, false);
AddPath(Base + "/../../../include/c++/" + Version + "/backward", AddPath(Base + "/../../../include/c++/" + Version + "/backward",
CXXSystem, true, false, false); CXXSystem, true, false);
} }
void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
@ -222,7 +220,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
break; break;
default: default:
// FIXME: temporary hack: hard-coded paths. // FIXME: temporary hack: hard-coded paths.
AddPath("/usr/local/include", System, true, false, false); AddPath("/usr/local/include", System, true, false);
break; break;
} }
} }
@ -234,7 +232,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
// supplied path. // supplied path.
llvm::sys::Path P(HSOpts.ResourceDir); llvm::sys::Path P(HSOpts.ResourceDir);
P.appendComponent("include"); P.appendComponent("include");
AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); AddPath(P.str(), System, false, false, /*IgnoreSysRoot=*/ true);
} }
// All remaining additions are for system include directories, early exit if // All remaining additions are for system include directories, early exit if
@ -250,7 +248,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
for (SmallVectorImpl<StringRef>::iterator i = dirs.begin(); for (SmallVectorImpl<StringRef>::iterator i = dirs.begin();
i != dirs.end(); i != dirs.end();
++i) ++i)
AddPath(*i, System, false, false, false); AddPath(*i, System, false, false);
return; return;
} }
@ -260,68 +258,62 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
llvm_unreachable("Include management is handled in the driver."); llvm_unreachable("Include management is handled in the driver.");
case llvm::Triple::Haiku: case llvm::Triple::Haiku:
AddPath("/boot/common/include", System, true, false, false); AddPath("/boot/common/include", System, true, false);
AddPath("/boot/develop/headers/os", System, true, false, false); AddPath("/boot/develop/headers/os", System, true, false);
AddPath("/boot/develop/headers/os/app", System, true, false, false); AddPath("/boot/develop/headers/os/app", System, true, false);
AddPath("/boot/develop/headers/os/arch", System, true, false, false); AddPath("/boot/develop/headers/os/arch", System, true, false);
AddPath("/boot/develop/headers/os/device", System, true, false, false); AddPath("/boot/develop/headers/os/device", System, true, false);
AddPath("/boot/develop/headers/os/drivers", System, true, false, false); AddPath("/boot/develop/headers/os/drivers", System, true, false);
AddPath("/boot/develop/headers/os/game", System, true, false, false); AddPath("/boot/develop/headers/os/game", System, true, false);
AddPath("/boot/develop/headers/os/interface", System, true, false, false); AddPath("/boot/develop/headers/os/interface", System, true, false);
AddPath("/boot/develop/headers/os/kernel", System, true, false, false); AddPath("/boot/develop/headers/os/kernel", System, true, false);
AddPath("/boot/develop/headers/os/locale", System, true, false, false); AddPath("/boot/develop/headers/os/locale", System, true, false);
AddPath("/boot/develop/headers/os/mail", System, true, false, false); AddPath("/boot/develop/headers/os/mail", System, true, false);
AddPath("/boot/develop/headers/os/media", System, true, false, false); AddPath("/boot/develop/headers/os/media", System, true, false);
AddPath("/boot/develop/headers/os/midi", System, true, false, false); AddPath("/boot/develop/headers/os/midi", System, true, false);
AddPath("/boot/develop/headers/os/midi2", System, true, false, false); AddPath("/boot/develop/headers/os/midi2", System, true, false);
AddPath("/boot/develop/headers/os/net", System, true, false, false); AddPath("/boot/develop/headers/os/net", System, true, false);
AddPath("/boot/develop/headers/os/storage", System, true, false, false); AddPath("/boot/develop/headers/os/storage", System, true, false);
AddPath("/boot/develop/headers/os/support", System, true, false, false); AddPath("/boot/develop/headers/os/support", System, true, false);
AddPath("/boot/develop/headers/os/translation", AddPath("/boot/develop/headers/os/translation", System, true, false);
System, true, false, false); AddPath("/boot/develop/headers/os/add-ons/graphics", System, true, false);
AddPath("/boot/develop/headers/os/add-ons/graphics",
System, true, false, false);
AddPath("/boot/develop/headers/os/add-ons/input_server", AddPath("/boot/develop/headers/os/add-ons/input_server",
System, true, false, false); System, true, false);
AddPath("/boot/develop/headers/os/add-ons/screen_saver", AddPath("/boot/develop/headers/os/add-ons/screen_saver",
System, true, false, false); System, true, false);
AddPath("/boot/develop/headers/os/add-ons/tracker", AddPath("/boot/develop/headers/os/add-ons/tracker", System, true, false);
System, true, false, false); AddPath("/boot/develop/headers/os/be_apps/Deskbar", System, true, false);
AddPath("/boot/develop/headers/os/be_apps/Deskbar",
System, true, false, false);
AddPath("/boot/develop/headers/os/be_apps/NetPositive", AddPath("/boot/develop/headers/os/be_apps/NetPositive",
System, true, false, false); System, true, false);
AddPath("/boot/develop/headers/os/be_apps/Tracker", AddPath("/boot/develop/headers/os/be_apps/Tracker", System, true, false);
System, true, false, false); AddPath("/boot/develop/headers/cpp", System, true, false);
AddPath("/boot/develop/headers/cpp", System, true, false, false); AddPath("/boot/develop/headers/cpp/i586-pc-haiku", System, true, false);
AddPath("/boot/develop/headers/cpp/i586-pc-haiku", AddPath("/boot/develop/headers/3rdparty", System, true, false);
System, true, false, false); AddPath("/boot/develop/headers/bsd", System, true, false);
AddPath("/boot/develop/headers/3rdparty", System, true, false, false); AddPath("/boot/develop/headers/glibc", System, true, false);
AddPath("/boot/develop/headers/bsd", System, true, false, false); AddPath("/boot/develop/headers/posix", System, true, false);
AddPath("/boot/develop/headers/glibc", System, true, false, false); AddPath("/boot/develop/headers", System, true, false);
AddPath("/boot/develop/headers/posix", System, true, false, false);
AddPath("/boot/develop/headers", System, true, false, false);
break; break;
case llvm::Triple::RTEMS: case llvm::Triple::RTEMS:
break; break;
case llvm::Triple::Cygwin: case llvm::Triple::Cygwin:
AddPath("/usr/include/w32api", System, true, false, false); AddPath("/usr/include/w32api", System, true, false);
break; break;
case llvm::Triple::MinGW32: { case llvm::Triple::MinGW32: {
// mingw-w64 crt include paths // mingw-w64 crt include paths
llvm::sys::Path P(HSOpts.ResourceDir); llvm::sys::Path P(HSOpts.ResourceDir);
P.appendComponent("../../../i686-w64-mingw32/include"); // <sysroot>/i686-w64-mingw32/include P.appendComponent("../../../i686-w64-mingw32/include"); // <sysroot>/i686-w64-mingw32/include
AddPath(P.str(), System, true, false, false); AddPath(P.str(), System, true, false);
P = llvm::sys::Path(HSOpts.ResourceDir); P = llvm::sys::Path(HSOpts.ResourceDir);
P.appendComponent("../../../x86_64-w64-mingw32/include"); // <sysroot>/x86_64-w64-mingw32/include P.appendComponent("../../../x86_64-w64-mingw32/include"); // <sysroot>/x86_64-w64-mingw32/include
AddPath(P.str(), System, true, false, false); AddPath(P.str(), System, true, false);
// mingw.org crt include paths // mingw.org crt include paths
P = llvm::sys::Path(HSOpts.ResourceDir); P = llvm::sys::Path(HSOpts.ResourceDir);
P.appendComponent("../../../include"); // <sysroot>/include P.appendComponent("../../../include"); // <sysroot>/include
AddPath(P.str(), System, true, false, false); AddPath(P.str(), System, true, false);
AddPath("/mingw/include", System, true, false, false); AddPath("/mingw/include", System, true, false);
#if defined(_WIN32) #if defined(_WIN32)
AddPath("c:/mingw/include", System, true, false, false); AddPath("c:/mingw/include", System, true, false);
#endif #endif
} }
break; break;
@ -331,7 +323,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
} }
if ( os != llvm::Triple::RTEMS ) if ( os != llvm::Triple::RTEMS )
AddPath("/usr/include", System, false, false, false); AddPath("/usr/include", System, false, false);
} }
void InitHeaderSearch:: void InitHeaderSearch::
@ -408,7 +400,7 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp
#endif #endif
break; break;
case llvm::Triple::DragonFly: case llvm::Triple::DragonFly:
AddPath("/usr/include/c++/4.1", CXXSystem, true, false, false); AddPath("/usr/include/c++/4.1", CXXSystem, true, false);
break; break;
case llvm::Triple::FreeBSD: case llvm::Triple::FreeBSD:
// FreeBSD 8.0 // FreeBSD 8.0
@ -474,16 +466,15 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
// Get foo/lib/c++/v1 // Get foo/lib/c++/v1
P.appendComponent("c++"); P.appendComponent("c++");
P.appendComponent("v1"); P.appendComponent("v1");
AddPath(P.str(), CXXSystem, true, false, false, true); AddPath(P.str(), CXXSystem, true, false, true);
} }
} }
// On Solaris, include the support directory for things like xlocale and // On Solaris, include the support directory for things like xlocale and
// fudged system headers. // fudged system headers.
if (triple.getOS() == llvm::Triple::Solaris) if (triple.getOS() == llvm::Triple::Solaris)
AddPath("/usr/include/c++/v1/support/solaris", CXXSystem, true, false, AddPath("/usr/include/c++/v1/support/solaris", CXXSystem, true, false);
false);
AddPath("/usr/include/c++/v1", CXXSystem, true, false, false); AddPath("/usr/include/c++/v1", CXXSystem, true, false);
} else { } else {
AddDefaultCPlusPlusIncludePaths(triple, HSOpts); AddDefaultCPlusPlusIncludePaths(triple, HSOpts);
} }
@ -494,8 +485,8 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
// Add the default framework include paths on Darwin. // Add the default framework include paths on Darwin.
if (HSOpts.UseStandardSystemIncludes) { if (HSOpts.UseStandardSystemIncludes) {
if (triple.isOSDarwin()) { if (triple.isOSDarwin()) {
AddPath("/System/Library/Frameworks", System, true, false, true); AddPath("/System/Library/Frameworks", System, true, true);
AddPath("/Library/Frameworks", System, true, false, true); AddPath("/Library/Frameworks", System, true, true);
} }
} }
} }
@ -669,8 +660,8 @@ void clang::ApplyHeaderSearchOptions(HeaderSearch &HS,
// Add the user defined entries. // Add the user defined entries.
for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) { for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) {
const HeaderSearchOptions::Entry &E = HSOpts.UserEntries[i]; const HeaderSearchOptions::Entry &E = HSOpts.UserEntries[i];
Init.AddPath(E.Path, E.Group, !E.ImplicitExternC, E.IsUserSupplied, Init.AddPath(E.Path, E.Group, !E.ImplicitExternC, E.IsFramework,
E.IsFramework, E.IgnoreSysRoot); E.IgnoreSysRoot);
} }
Init.AddDefaultIncludePaths(Lang, Triple, HSOpts); Init.AddDefaultIncludePaths(Lang, Triple, HSOpts);