aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-07-21 23:23:32 -0700
committerFangrui Song <i@maskray.me>2023-07-21 23:23:32 -0700
commitb55ac6e9cb539a52e6bdc5ce6bf40258dd41f63e (patch)
tree67923b2481380e1addd49e5e9e6f6d880bf80e2b /llvm/lib/Support/VirtualFileSystem.cpp
parent5f1a388a11ae67c2e5d7a4d1fe45e369a393c572 (diff)
downloadllvm-b55ac6e9cb539a52e6bdc5ce6bf40258dd41f63e.zip
llvm-b55ac6e9cb539a52e6bdc5ce6bf40258dd41f63e.tar.gz
llvm-b55ac6e9cb539a52e6bdc5ce6bf40258dd41f63e.tar.bz2
[VirtualFileSystem] Make gcc<7.5 happy after 75d71800aa384ee58663d892c325572f5588df2a
There is a libstdc++ stl_map.h bug that is only back ported to 7.5. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78595#c13 ``` /tmp/opt/gcc-7.3.0/include/c++/7.3.0/bits/stl_tree.h:2091:28: error: no matching function for call to ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<llvm::vfs::detail::InMemoryNode> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<llvm::vfs::detail::InMemoryNode> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<llvm::vfs::detail::InMemoryNode> > > >::_M_get_insert_unique_pos(std::pair<llvm::StringRef, std::unique_ptr<llvm::vfs::detail::InMemoryNode> >::first_type&)’ = _M_get_insert_unique_pos(_KeyOfValue()(__v)); ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ``` Just construct a std::string from StringRef to work around it.
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 9c1c990..25d057b 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -749,7 +749,7 @@ public:
}
InMemoryNode *addChild(StringRef Name, std::unique_ptr<InMemoryNode> Child) {
- return Entries.insert(make_pair(Name, std::move(Child)))
+ return Entries.insert(make_pair(Name.str(), std::move(Child)))
.first->second.get();
}