{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/26569","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/26569/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/26569/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/26569/events","html_url":"https://github.com/rust-lang/rust/pull/26569","id":91008987,"number":26569,"title":"MSVC: Implement runtime support for unwinding","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"brson","id":147214,"avatar_url":"https://avatars.githubusercontent.com/u/147214?v=3","gravatar_id":"","url":"https://api.github.com/users/brson","html_url":"https://github.com/brson","followers_url":"https://api.github.com/users/brson/followers","following_url":"https://api.github.com/users/brson/following{/other_user}","gists_url":"https://api.github.com/users/brson/gists{/gist_id}","starred_url":"https://api.github.com/users/brson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brson/subscriptions","organizations_url":"https://api.github.com/users/brson/orgs","repos_url":"https://api.github.com/users/brson/repos","events_url":"https://api.github.com/users/brson/events{/privacy}","received_events_url":"https://api.github.com/users/brson/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-06-25T16:21:54Z","updated_at":"2015-06-27T03:34:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/26569","html_url":"https://github.com/rust-lang/rust/pull/26569","diff_url":"https://github.com/rust-lang/rust/pull/26569.diff","patch_url":"https://github.com/rust-lang/rust/pull/26569.patch"},"body":"Now that LLVM has been updated, the only remaining roadblock to implementing\r\nunwinding for MSVC is to fill out the runtime support in `std::rt::unwind::seh`.\r\nThis commit does precisely that, fixing up some other bits and pieces along the\r\nway:\r\n\r\n* The `seh` unwinding module now uses `RaiseException` to initiate a panic.\r\n* The `rust_try.ll` file was rewritten for MSVC (as it's quite different) and is\r\n  located at `rust_try_msvc_64.ll`, only included on MSVC builds for now.\r\n* The personality function for all landing pads generated by LLVM is hard-wired\r\n  to `__C_specific_handler` instead of the standard `rust_eh_personality` lang\r\n  item. This is required to get LLVM to emit SEH unwinding information instead\r\n  of DWARF unwinding information. This also means that on MSVC the\r\n  `rust_eh_personality` function is entirely unused (but is defined as it's a\r\n  lang item).\r\n\r\nMore details about how panicking works on SEH can be found in the\r\n`rust_try_msvc_64.ll` or `seh.rs` files, but I'm always open to adding more\r\ncomments!\r\n\r\nA key aspect of this PR is missing, however, which is that **unwinding is still\r\nturned off by default for MSVC**. There is a [bug in llvm][llvm-bug] which\r\ncauses optimizations to inline enough landing pads that LLVM chokes. If the\r\ncompiler is optimized at `-O1` (where inlining isn't enabled) then it can\r\nbootstrap with unwinding enabled, but when optimized at `-O2` (inlining is\r\nenabled) then it hits a fatal LLVM error.\r\n\r\n[llvm-bug]: https://llvm.org/bugs/show_bug.cgi?id=23884"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/115952694","html_url":"https://github.com/rust-lang/rust/pull/26569#issuecomment-115952694","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/26569","id":115952694,"user":{"login":"bors","id":3372342,"avatar_url":"https://avatars.githubusercontent.com/u/3372342?v=3","gravatar_id":"","url":"https://api.github.com/users/bors","html_url":"https://github.com/bors","followers_url":"https://api.github.com/users/bors/followers","following_url":"https://api.github.com/users/bors/following{/other_user}","gists_url":"https://api.github.com/users/bors/gists{/gist_id}","starred_url":"https://api.github.com/users/bors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors/subscriptions","organizations_url":"https://api.github.com/users/bors/orgs","repos_url":"https://api.github.com/users/bors/repos","events_url":"https://api.github.com/users/bors/events{/privacy}","received_events_url":"https://api.github.com/users/bors/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T03:34:04Z","updated_at":"2015-06-27T03:34:04Z","body":":pushpin: Commit 759a7f1 has been approved by `brson`\n\n<!-- @bors r=brson 759a7f1f66490191a6f809c9709151d6d27cea87 -->"}}