Skip to content

Commit

Permalink
misc: add comments based on suggestions (to be squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Oct 25, 2020
1 parent a929919 commit 6454e5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/mun_codegen_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ pub fn as_value_derive(input: TokenStream) -> TokenStream {
let type_context = context.type_context;
let field_padding = #field_padding_values;

// If struct type can be constructed as a constant LLVM IR value
if <#ident>::has_const_value() {
// construct a named instance of that struct type
let struct_type = Self::get_ir_type(context.type_context);

let field_values = vec![ #(#field_types_values),* ];
Expand Down Expand Up @@ -286,6 +288,7 @@ pub fn as_value_derive(input: TokenStream) -> TokenStream {
use crate::value::{AsBytesAndPtrs, BytesOrPtr};
use inkwell::values::BasicValueEnum;

// construct an anonymous struct type consisting of bytes and pointers
let field_bytes_and_ptrs = self
.as_bytes_and_ptrs(context.type_context)
.into_iter()
Expand Down

0 comments on commit 6454e5f

Please sign in to comment.