about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2022-12-03 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2023-01-10 09:53:18 +0100
commit836ef6162dfe11c603854851a4a9b5c5e856f0d5 (patch)
tree488f5a8635c0a86aecc94123cac2407b8ca29486 /compiler
parentdeba5ddd0776108c51a69844d0ffe3f96886dd52 (diff)
downloadrust-836ef6162dfe11c603854851a4a9b5c5e856f0d5.tar.gz
rust-836ef6162dfe11c603854851a4a9b5c5e856f0d5.zip
Add comment to cleanup_kinds
based on the original commit message 1ae7ae0c1c7ed68c616273f245647afa47f3cbde
Diffstat (limited to 'compiler')
-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>,