Remove all uses of PathV1::GetRootDirectory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122552 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer 2010-12-25 20:09:27 +00:00
Родитель a6b0b96e53
Коммит af6530c938
1 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -41,15 +41,14 @@ class InitHeaderSearch {
std::vector<DirectoryLookup> IncludeGroup[4];
HeaderSearch& Headers;
bool Verbose;
llvm::sys::Path IncludeSysroot;
std::string IncludeSysroot;
bool IsNotEmptyOrRoot;
public:
InitHeaderSearch(HeaderSearch &HS, bool verbose, llvm::StringRef sysroot)
: Headers(HS), Verbose(verbose),
IncludeSysroot((sysroot.empty() || sysroot == "/") ?
llvm::sys::Path::GetRootDirectory() :
llvm::sys::Path(sysroot)) {
: Headers(HS), Verbose(verbose), IncludeSysroot(sysroot),
IsNotEmptyOrRoot(!(sysroot.empty() || sysroot == "/")) {
}
/// AddPath - Add the specified path to the specified group list.
@ -110,10 +109,10 @@ void InitHeaderSearch::AddPath(const llvm::Twine &Path,
// Handle isysroot.
if (Group == System && !IgnoreSysRoot &&
llvm::sys::path::is_absolute(MappedPathStr) &&
IncludeSysroot != llvm::sys::Path::GetRootDirectory()) {
IsNotEmptyOrRoot) {
MappedPathStorage.clear();
MappedPathStr =
(IncludeSysroot.str() + Path).toStringRef(MappedPathStorage);
(IncludeSysroot + Path).toStringRef(MappedPathStorage);
}
// Compute the DirectoryLookup type.