aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/util.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-15 18:50:17 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-21 20:25:05 +0200
commitf96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d (patch)
treea782f21ca0659eda6b9b667e197c4927490a7bc4 /macros/src/codegen/util.rs
parent355cb82d0693fe108ac28ec8a0d77e8aab4e6e06 (diff)
downloadrtic-f96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d.tar.gz
rtic-f96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d.tar.zst
rtic-f96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d.zip
Updated examples
More work
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r--macros/src/codegen/util.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs
index f04ccb23..887ee3bd 100644
--- a/macros/src/codegen/util.rs
+++ b/macros/src/codegen/util.rs
@@ -106,6 +106,14 @@ pub fn late_resources_ident(init: &Ident) -> Ident {
)
}
+/// Mangle an ident
+pub fn mangle_ident(ident: &Ident) -> Ident {
+ Ident::new(
+ &format!("__rtic_internal_{}", ident.to_string()),
+ Span::call_site(),
+ )
+}
+
fn link_section_index() -> usize {
static INDEX: AtomicUsize = AtomicUsize::new(0);