forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#83044 - kubo39:set-llvm-code-model, r=nikic
Add support for storing code model to LLVM module IR This patch avoids undefined behavior by linking different object files. Also this would it could be propagated properly to LTO. See https://reviews.llvm.org/D52322 and https://reviews.llvm.org/D52323. This patch is based on rust-lang#74002
- Loading branch information
Showing
5 changed files
with
38 additions
and
1 deletion.
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
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,20 @@ | ||
// only-x86_64 | ||
|
||
// revisions: NOMODEL MODEL-SMALL MODEL-KERNEL MODEL-MEDIUM MODEL-LARGE | ||
//[NOMODEL] compile-flags: | ||
//[MODEL-SMALL] compile-flags: -C code-model=small | ||
//[MODEL-KERNEL] compile-flags: -C code-model=kernel | ||
//[MODEL-MEDIUM] compile-flags: -C code-model=medium | ||
//[MODEL-LARGE] compile-flags: -C code-model=large | ||
|
||
#![crate_type = "lib"] | ||
|
||
// MODEL-SMALL: !llvm.module.flags = !{{{.*}}} | ||
// MODEL-SMALL: !{{[0-9]+}} = !{i32 1, !"Code Model", i32 1} | ||
// MODEL-KERNEL: !llvm.module.flags = !{{{.*}}} | ||
// MODEL-KERNEL: !{{[0-9]+}} = !{i32 1, !"Code Model", i32 2} | ||
// MODEL-MEDIUM: !llvm.module.flags = !{{{.*}}} | ||
// MODEL-MEDIUM: !{{[0-9]+}} = !{i32 1, !"Code Model", i32 3} | ||
// MODEL-LARGE: !llvm.module.flags = !{{{.*}}} | ||
// MODEL-LARGE: !{{[0-9]+}} = !{i32 1, !"Code Model", i32 4} | ||
// NOMODEL-NOT: Code Model |