about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-05-21 13:12:24 +0200
committerGitHub <noreply@github.com>2020-05-21 13:12:24 +0200
commite5a455086944fc6ef95b33248de2894d10076139 (patch)
treec5013e43d75a33c85ac401ed12640c4f1eb1e9b5 /src
parent0e887129adfe149b1089d9f719475f7c3a1c8e33 (diff)
parentc7813ff7d242f7b7340e7bba02ae9dd452ea0f9e (diff)
downloadrust-e5a455086944fc6ef95b33248de2894d10076139.tar.gz
rust-e5a455086944fc6ef95b33248de2894d10076139.zip
Rollup merge of #72397 - petrochenkov:tiny, r=Amanieu
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 https://github.com/rust-lang/rust/pull/72248.
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustc/src/codegen-options/index.md2
-rw-r--r--src/librustc_codegen_llvm/lib.rs2
-rw-r--r--src/librustc_target/spec/mod.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md
index 9180f48bd94..0b4bb05c1db 100644
--- a/src/doc/rustc/src/codegen-options/index.md
+++ b/src/doc/rustc/src/codegen-options/index.md
@@ -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.
diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs
index 6afd4278451..55ee660d9f7 100644
--- a/src/librustc_codegen_llvm/lib.rs
+++ b/src/librustc_codegen_llvm/lib.rs
@@ -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!();
diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs
index 41c2f1d93d2..8770e033e05 100644
--- a/src/librustc_target/spec/mod.rs
+++ b/src/librustc_target/spec/mod.rs
@@ -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,