M68kInstrInfo::AnalyzeBranchImpl - fix MSVC build. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 9 Mar 2021 11:06:29 +0000 (11:06 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 9 Mar 2021 11:27:26 +0000 (11:27 +0000)
MSVC couldn't resolve the decltype of a capture of a capture - but is happy with an auto.

llvm/lib/Target/M68k/M68kInstrInfo.cpp

index 9a1eef4..94b003f 100644 (file)
@@ -92,9 +92,7 @@ bool M68kInstrInfo::AnalyzeBranchImpl(MachineBasicBlock &MBB,
   std::vector<std::reference_wrapper<llvm::MachineInstr>> EraseList;
   auto FinalizeOnReturn = llvm::make_scope_exit([&EraseList] {
     std::for_each(EraseList.begin(), EraseList.end(),
-                  [](decltype(EraseList)::value_type &ref) {
-                    ref.get().eraseFromParent();
-                  });
+                  [](auto &ref) { ref.get().eraseFromParent(); });
   });
 
   // Start from the bottom of the block and work up, examining the