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