aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-fnparam.h
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2021-02-07 12:40:19 +0800
committerSimplyTheOther <simplytheother@gmail.com>2021-02-07 12:40:19 +0800
commit94be91d6159101caa7c560b188bd6c02d8d86d17 (patch)
treeb3c32de54db1a850079f79d3dfb4c4000dec9d90 /gcc/rust/backend/rust-compile-fnparam.h
parent27eef5b7a065e8ea05ac575c4b364bb5dbc44e46 (diff)
parentdb7134353447921136a321b8fd78cea78f2c344e (diff)
downloadgcc-94be91d6159101caa7c560b188bd6c02d8d86d17.zip
gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.tar.gz
gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.tar.bz2
Merge branch 'master' of https://github.com/redbrain/gccrs
Diffstat (limited to 'gcc/rust/backend/rust-compile-fnparam.h')
-rw-r--r--gcc/rust/backend/rust-compile-fnparam.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-fnparam.h b/gcc/rust/backend/rust-compile-fnparam.h
index cf6e6f7..1ea0c9f 100644
--- a/gcc/rust/backend/rust-compile-fnparam.h
+++ b/gcc/rust/backend/rust-compile-fnparam.h
@@ -61,6 +61,22 @@ private:
::Bvariable *translated;
};
+class CompileSelfParam : public HIRCompileBase
+{
+public:
+ static Bvariable *compile (Context *ctx, Bfunction *fndecl,
+ HIR::SelfParam &self, Btype *decl_type,
+ Location locus)
+ {
+ if (!self.get_is_mut ())
+ decl_type = ctx->get_backend ()->immutable_type (decl_type);
+
+ return ctx->get_backend ()->parameter_variable (fndecl, "self", decl_type,
+ false /* address_taken */,
+ locus);
+ }
+};
+
} // namespace Compile
} // namespace Rust