From d4a0154902fb9b0611ed857134b26a64a1d5ad1e Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 13 Jun 2024 20:20:27 +0100 Subject: [llvm-project] Fix typo "seperate" (#95373) --- llvm/lib/Support/VirtualFileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 7360901f2962..f9c15bf7809e 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -1373,7 +1373,7 @@ std::error_code RedirectingFileSystem::makeAbsolute(SmallVectorImpl &Path) llvm::sys::path::is_absolute(Path, llvm::sys::path::Style::windows_backslash)) // This covers windows absolute path with forward slash as well, as the - // forward slashes are treated as path seperation in llvm::path + // forward slashes are treated as path separation in llvm::path // regardless of what path::Style is used. return {}; -- cgit v1.2.3 From 48ef912e2b32798b704af242e551a7090102c750 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 21 Jun 2024 14:59:05 +0200 Subject: [VFS] Avoid include (NFC) Directly use a vector instead of wrapping it in a stack, like we do in most places. --- llvm/lib/Support/VirtualFileSystem.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index f9c15bf7809e..ce2bf2b4193a 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -2913,30 +2913,31 @@ vfs::recursive_directory_iterator::recursive_directory_iterator( directory_iterator I = FS->dir_begin(Path, EC); if (I != directory_iterator()) { State = std::make_shared(); - State->Stack.push(I); + State->Stack.push_back(I); } } vfs::recursive_directory_iterator & recursive_directory_iterator::increment(std::error_code &EC) { assert(FS && State && !State->Stack.empty() && "incrementing past end"); - assert(!State->Stack.top()->path().empty() && "non-canonical end iterator"); + assert(!State->Stack.back()->path().empty() && "non-canonical end iterator"); vfs::directory_iterator End; if (State->HasNoPushRequest) State->HasNoPushRequest = false; else { - if (State->Stack.top()->type() == sys::fs::file_type::directory_file) { - vfs::directory_iterator I = FS->dir_begin(State->Stack.top()->path(), EC); + if (State->Stack.back()->type() == sys::fs::file_type::directory_file) { + vfs::directory_iterator I = + FS->dir_begin(State->Stack.back()->path(), EC); if (I != End) { - State->Stack.push(I); + State->Stack.push_back(I); return *this; } } } - while (!State->Stack.empty() && State->Stack.top().increment(EC) == End) - State->Stack.pop(); + while (!State->Stack.empty() && State->Stack.back().increment(EC) == End) + State->Stack.pop_back(); if (State->Stack.empty()) State.reset(); // end iterator -- cgit v1.2.3