Skip to content
#

codegen

Here are 389 public repositories matching this topic...

rogpeppe
rogpeppe commented May 25, 2019

One of the specific advantages of the wire approach is that it generates code that's relatively readable compared to reflect-based equivalents. When wire.Value is used on a small by-value type, there's no need for the value to live in a global variable - the expression could instead be used literally inside the generated code, which would make the code easier to follow, and more similar to the c

programmerjake
programmerjake commented Apr 15, 2021

In:
https://github.com/TheDan64/inkwell/blob/f768691fccb04fe262a6ccf22c215657dc08de98/src/context.rs#L950
the lifetimes are left implicit, which unnecessarily shortens the lifetime of the return value. Making the lifetimes explicit:

impl<'ctx> Context<'ctx> {
    pub fn const_string<'a>(&'a self, string: &'a [u8], null_terminated: bool) -> VectorValue<'a> {
        ...
    }
}

Improve this page

Add a description, image, and links to the codegen topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the codegen topic, visit your repo's landing page and select "manage topics."

Learn more