diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-21 14:59:05 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2024-06-21 15:17:41 +0200 |
commit | 48ef912e2b32798b704af242e551a7090102c750 (patch) | |
tree | ccc82b0fd419a73209b3d8d73201a926a553bcff /llvm/lib/Support/VirtualFileSystem.cpp | |
parent | df86fb069e130f405ca2e6124c725e6dd1d629c6 (diff) | |
download | llvm-48ef912e2b32798b704af242e551a7090102c750.zip llvm-48ef912e2b32798b704af242e551a7090102c750.tar.gz llvm-48ef912e2b32798b704af242e551a7090102c750.tar.bz2 |
[VFS] Avoid <stack> include (NFC)
Directly use a vector instead of wrapping it in a stack, like we
do in most places.
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r-- | llvm/lib/Support/VirtualFileSystem.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index f9c15bf..ce2bf2b 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<detail::RecDirIterState>(); - 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 |