Basic: import SmallString<> into clang namespace
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
This commit is contained in:
@@ -477,7 +477,7 @@ void FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const {
|
||||
|| llvm::sys::path::is_absolute(pathRef))
|
||||
return;
|
||||
|
||||
llvm::SmallString<128> NewPath(FileSystemOpts.WorkingDir);
|
||||
SmallString<128> NewPath(FileSystemOpts.WorkingDir);
|
||||
llvm::sys::path::append(NewPath, pathRef);
|
||||
path = NewPath;
|
||||
}
|
||||
@@ -509,7 +509,7 @@ getBufferForFile(const FileEntry *Entry, std::string *ErrorStr) {
|
||||
return Result.take();
|
||||
}
|
||||
|
||||
llvm::SmallString<128> FilePath(Entry->getName());
|
||||
SmallString<128> FilePath(Entry->getName());
|
||||
FixupRelativePath(FilePath);
|
||||
ec = llvm::MemoryBuffer::getFile(FilePath.str(), Result, Entry->getSize());
|
||||
if (ec && ErrorStr)
|
||||
@@ -528,7 +528,7 @@ getBufferForFile(StringRef Filename, std::string *ErrorStr) {
|
||||
return Result.take();
|
||||
}
|
||||
|
||||
llvm::SmallString<128> FilePath(Filename);
|
||||
SmallString<128> FilePath(Filename);
|
||||
FixupRelativePath(FilePath);
|
||||
ec = llvm::MemoryBuffer::getFile(FilePath.c_str(), Result);
|
||||
if (ec && ErrorStr)
|
||||
@@ -549,7 +549,7 @@ bool FileManager::getStatValue(const char *Path, struct stat &StatBuf,
|
||||
return FileSystemStatCache::get(Path, StatBuf, FileDescriptor,
|
||||
StatCache.get());
|
||||
|
||||
llvm::SmallString<128> FilePath(Path);
|
||||
SmallString<128> FilePath(Path);
|
||||
FixupRelativePath(FilePath);
|
||||
|
||||
return FileSystemStatCache::get(FilePath.c_str(), StatBuf, FileDescriptor,
|
||||
@@ -558,7 +558,7 @@ bool FileManager::getStatValue(const char *Path, struct stat &StatBuf,
|
||||
|
||||
bool FileManager::getNoncachedStatValue(StringRef Path,
|
||||
struct stat &StatBuf) {
|
||||
llvm::SmallString<128> FilePath(Path);
|
||||
SmallString<128> FilePath(Path);
|
||||
FixupRelativePath(FilePath);
|
||||
|
||||
return ::stat(FilePath.c_str(), &StatBuf) != 0;
|
||||
|
||||
Reference in New Issue
Block a user