[Lldb-commits] [lldb] r369905 - Fix windows build after r369894
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 26 05:42:32 PDT 2019
Author: labath
Date: Mon Aug 26 05:42:32 2019
New Revision: 369905
URL: http://llvm.org/viewvc/llvm-project?rev=369905&view=rev
Log:
Fix windows build after r369894
Constructing a std::vector from a llvm::map_range fails on windows,
apparently because std::vector expects the input iterator to have a
const operator* (map_range iterator has a non-const one).
This avoids the cleverness and unrolls the map-loop manually (which is
also slightly shorter).
Modified:
lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
Modified: lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp?rev=369905&r1=369904&r2=369905&view=diff
==============================================================================
--- lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp (original)
+++ lldb/trunk/unittests/Symbol/PostfixExpressionTest.cpp Mon Aug 26 05:42:32 2019
@@ -108,12 +108,10 @@ ParseFPOAndStringify(llvm::StringRef pro
llvm::BumpPtrAllocator alloc;
std::vector<std::pair<llvm::StringRef, Node *>> parsed =
ParseFPOProgram(prog, alloc);
- auto range = llvm::map_range(
- parsed, [](const std::pair<llvm::StringRef, Node *> &pair) {
- return std::make_pair(pair.first, ASTPrinter::Print(pair.second));
- });
- return std::vector<std::pair<std::string, std::string>>(range.begin(),
- range.end());
+ std::vector<std::pair<std::string, std::string>> result;
+ for (const auto &p : parsed)
+ result.emplace_back(p.first, ASTPrinter::Print(p.second));
+ return result;
}
TEST(PostfixExpression, ParseFPOProgram) {
More information about the lldb-commits
mailing list