Skip to content

Commit

Permalink
asm: document translate_modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
fw-immunant committed Apr 13, 2022
1 parent ef78e97 commit 1f53baf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions c2rust-transpile/src/translator/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<char> {
Some(match arch {
"x86" => match modifier {
Expand Down

0 comments on commit 1f53baf

Please sign in to comment.