Add comment explaining the necessity of r93456
[oota-llvm.git] / lib / CodeGen / LLVMTargetMachine.cpp
index 8ea6dba51927f51064df671d3cc10bc4a54e86cd..2b5fd2c949091383ef7a52911459df8b40033dfa 100644 (file)
@@ -280,6 +280,11 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
   {
   case ExceptionHandling::SjLj:
     // SjLj piggy-backs on dwarf for this bit. The cleanups done apply to both
+    // Dwarf EH prepare needs to be run after SjLj prepare. Otherwise,
+    // 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.
     PM.add(createSjLjEHPass(getTargetLowering()));
     PM.add(createDwarfEHPass(getTargetLowering(), OptLevel==CodeGenOpt::None));
     break;