Dwarf EH prepare needs to be run after SjLj prepare. Otherwise,
authorJim Grosbach <grosbach@apple.com>
Thu, 14 Jan 2010 21:22:16 +0000 (21:22 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 14 Jan 2010 21:22:16 +0000 (21:22 +0000)
catch info can get misplaced when a selector ends up more than one block
removed from the parent invoke(s). This could happen when a landing pad is
shared by multiple invokes and is also a target of a normal edge from
elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93456 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LLVMTargetMachine.cpp

index 733995f82be8dd4cd070c2b9d68c326c1cba6c9e..8ea6dba51927f51064df671d3cc10bc4a54e86cd 100644 (file)
@@ -280,8 +280,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
   {
   case ExceptionHandling::SjLj:
     // SjLj piggy-backs on dwarf for this bit. The cleanups done apply to both
-    PM.add(createDwarfEHPass(getTargetLowering(), OptLevel==CodeGenOpt::None));
     PM.add(createSjLjEHPass(getTargetLowering()));
+    PM.add(createDwarfEHPass(getTargetLowering(), OptLevel==CodeGenOpt::None));
     break;
   case ExceptionHandling::Dwarf:
     PM.add(createDwarfEHPass(getTargetLowering(), OptLevel==CodeGenOpt::None));