[llvm] 4dbcefe - Revert the llvm::append_range change in lib/Target/X86/X86WinEHState.cpp

Alexander Kornienko via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 30 06:43:56 PDT 2025


Author: Alexander Kornienko
Date: 2025-03-30T15:43:36+02:00
New Revision: 4dbcefe3806f9970c0e4f4b08d98df5253517f14

URL: https://github.com/llvm/llvm-project/commit/4dbcefe3806f9970c0e4f4b08d98df5253517f14
DIFF: https://github.com/llvm/llvm-project/commit/4dbcefe3806f9970c0e4f4b08d98df5253517f14.diff

LOG: Revert the llvm::append_range change in lib/Target/X86/X86WinEHState.cpp

This reverts a single file from ad1ba15ea894ac47b0f2447db191a14ebe1b301d.
llvm::append_range in this context fails to compile with recent Clang and
libc++:

libcxx/include/__algorithm/copy_backward.h:221:68: error: invalid operands to
binary expression ('llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>'
and 'long')
...
llvm-project/llvm/lib/Target/X86/X86WinEHState.cpp:724:11: note: in
instantiation of function template specialization
'llvm::append_range<std::deque<llvm::BasicBlock *>,
llvm::iterator_range<llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock
>>>' requested here
  724 |     llvm::append_range(Worklist, successors(BB));
      |           ^

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86WinEHState.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86WinEHState.cpp b/llvm/lib/Target/X86/X86WinEHState.cpp
index 1bcbc7d6e6703..dfdeada476695 100644
--- a/llvm/lib/Target/X86/X86WinEHState.cpp
+++ b/llvm/lib/Target/X86/X86WinEHState.cpp
@@ -721,7 +721,8 @@ void WinEHStatePass::addStateStores(Function &F, WinEHFuncInfo &FuncInfo) {
     // enqueue it's successors to see if we can infer their states.
     InitialStates.insert({BB, PredState});
     FinalStates.insert({BB, PredState});
-    llvm::append_range(Worklist, successors(BB));
+    for (BasicBlock *SuccBB : successors(BB))
+       Worklist.push_back(SuccBB);
   }
 
   // Try to hoist stores from successors.


        


More information about the llvm-commits mailing list