-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc_trans: Disable landing pads on 32-bit MSVC
This is currently quite buggy in LLVM from what I can tell, so just disable it entirely. This commit also adds preliminary support, however, to actually target 32-bit MSVC by making sure the `rust_try_msvc_32.ll` file exists and wiring up exceptions to `_except_handler3` instead of `__C_specific_handler` (which doesn't exist on 32-bit).
- Loading branch information
1 parent
83ee47b
commit 3e26e56
Showing
3 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
; Copyright 2015 The Rust Project Developers. See the COPYRIGHT | ||
; file at the top-level directory of this distribution and at | ||
; http://rust-lang.org/COPYRIGHT. | ||
; | ||
; Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
; http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
; <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
; option. This file may not be copied, modified, or distributed | ||
; except according to those terms. | ||
|
||
; For more comments about what's going on here see rust_try_msvc_64.ll. The only | ||
; difference between that and this file is the personality function used as it's | ||
; different for 32-bit MSVC than it is for 64-bit. | ||
|
||
define i8* @rust_try(void (i8*)* %f, i8* %env) | ||
personality i8* bitcast (i32 (...)* @_except_handler3 to i8*) | ||
{ | ||
invoke void %f(i8* %env) | ||
to label %normal | ||
unwind label %catch | ||
|
||
normal: | ||
ret i8* null | ||
catch: | ||
%vals = landingpad { i8*, i32 } | ||
catch i8* bitcast (i32 (i8*, i8*)* @__rust_try_filter to i8*) | ||
%ehptr = extractvalue { i8*, i32 } %vals, 0 | ||
%sel = extractvalue { i8*, i32 } %vals, 1 | ||
%filter_sel = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @__rust_try_filter to i8*)) | ||
%is_filter = icmp eq i32 %sel, %filter_sel | ||
br i1 %is_filter, label %catch-return, label %catch-resume | ||
|
||
catch-return: | ||
ret i8* %ehptr | ||
|
||
catch-resume: | ||
resume { i8*, i32 } %vals | ||
} | ||
|
||
declare i32 @_except_handler3(...) | ||
declare i32 @__rust_try_filter(i8*, i8*) | ||
declare i32 @llvm.eh.typeid.for(i8*) readnone nounwind |