about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2023-01-11 14:18:52 +0900
committerGitHub <noreply@github.com>2023-01-11 14:18:52 +0900
commit8d7a06aece82336d3c23c6e925e11b96aa85f63f (patch)
treefc30cc216e03b3d5f4c3051a1c3b01a6b983a2d5
parentbf7ea0d11b07d84cfbd18feac0ed59e6d1da87ab (diff)
parent836ef6162dfe11c603854851a4a9b5c5e856f0d5 (diff)
downloadrust-8d7a06aece82336d3c23c6e925e11b96aa85f63f.tar.gz
rust-8d7a06aece82336d3c23c6e925e11b96aa85f63f.zip
Rollup merge of #105194 - tmiasko:cleanup-kinds, r=davidtwco
Add comment to cleanup_kinds

based on the original commit message 1ae7ae0c1c7ed68c616273f245647afa47f3cbde
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/analyze.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/analyze.rs b/compiler/rustc_codegen_ssa/src/mir/analyze.rs
index c7617d2e464..dd1ac2c74ae 100644
--- a/compiler/rustc_codegen_ssa/src/mir/analyze.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/analyze.rs
@@ -261,6 +261,9 @@ impl CleanupKind {
     }
 }
 
+/// MSVC requires unwinding code to be split to a tree of *funclets*, where each funclet can only
+/// branch to itself or to its parent. Luckily, the code we generates matches this pattern.
+/// Recover that structure in an analyze pass.
 pub fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKind> {
     fn discover_masters<'tcx>(
         result: &mut IndexVec<mir::BasicBlock, CleanupKind>,