From 1f53baf1cede5cadc329e11e1d25a1317b4ceb19 Mon Sep 17 00:00:00 2001 From: fw Date: Tue, 12 Apr 2022 20:16:20 -0400 Subject: [PATCH] asm: document translate_modifier --- c2rust-transpile/src/translator/assembly.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c2rust-transpile/src/translator/assembly.rs b/c2rust-transpile/src/translator/assembly.rs index 366d990fab..f5cd5f32ab 100644 --- a/c2rust-transpile/src/translator/assembly.rs +++ b/c2rust-transpile/src/translator/assembly.rs @@ -117,6 +117,10 @@ fn parse_constraints(mut constraints: &str) -> Ok((mode, mem_only, constraints)) } +/// Translate a template modifier from llvm/gcc asm template argument modifiers +/// to those accepted by the Rust asm! macro. This is arch-dependent, so we need +/// to know which architecture the asm targets. +/// See https://doc.rust-lang.org/nightly/reference/inline-assembly.html#template-modifiers fn translate_modifier(modifier: char, arch: &str) -> Option { Some(match arch { "x86" => match modifier {