Skip to content

Commit

Permalink
Rollup merge of rust-lang#72397 - petrochenkov:tiny, r=Amanieu
Browse files Browse the repository at this point in the history
llvm: Expose tiny code model to users

This model is relevant to embedded AArch64 targets and was added to LLVM relatively recently (https://reviews.llvm.org/D49673, mid 2018), so rustc frontend didn't provide access to it with `-C code-model`. The gcc analogue is [`-mcmodel=tiny`](https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html).
(This is one of the options that are passed directly to LLVM without being interpreted by rustc.)

Follow up to rust-lang#72248.
  • Loading branch information
RalfJung authored May 21, 2020
2 parents 1cef9bf + c7813ff commit fcd93b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/doc/rustc/src/codegen-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ specification.

Supported values for this option are:

<!-- - `tiny` - Tiny code model. -->
- `tiny` - Tiny code model.
- `small` - Small code model. This is the default model for majority of supported targets.
- `kernel` - Kernel code model.
- `medium` - Medium code model.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl CodegenBackend for LlvmCodegenBackend {
}
PrintRequest::CodeModels => {
println!("Available code models:");
for name in &["small", "kernel", "medium", "large"] {
for name in &["tiny", "small", "kernel", "medium", "large"] {
println!(" {}", name);
}
println!();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl FromStr for CodeModel {

fn from_str(s: &str) -> Result<CodeModel, ()> {
Ok(match s {
// "tiny" => CodeModel::Tiny, // Not exposed to users right now.
"tiny" => CodeModel::Tiny,
"small" => CodeModel::Small,
"kernel" => CodeModel::Kernel,
"medium" => CodeModel::Medium,
Expand Down

0 comments on commit fcd93b7

Please sign in to comment.