Questions tagged [codegen]

Use codegen for questions related to language features or tools which facilitate translating code between languages or creating code from metadata

References

242 questions
3
votes
1 answer

RazorGenerator.MsBuild - Achieving harmony from Developer machine to Buildserver

We are currently using the RazorGenerator library to generate pre-compiled views for a project. Up until now we have been using the Visual Studio Extension to handle the generation, with these generated files also being committed to our repository.…
Grant Trevor
  • 1,052
  • 9
  • 23
3
votes
1 answer

Get a function declaration from another llvm::Module

In my application i have 2 LLVM modules - the runtime one (which contains void foo(int * a) function definition) and executable one (which i'm creating using LLVM C++ API). In my executable module i create int main(int argc, char ** argv) and want…
arrowd
  • 33,231
  • 8
  • 79
  • 110
3
votes
3 answers

Generate the correct type instead of a union in GraphQL codegen

I am trying to migrate a setup which generates all the types exactly like what the server has into something which is based on just the document nodes that we've written. I currenly have this configuration in .graphqlrc.js /** @type…
JP Calvo
  • 173
  • 1
  • 2
  • 14
3
votes
1 answer

React Query + Codegen - custom fetcher

I use a codegen + react query + my own fetcher to deal with API calls. https://www.graphql-code-generator.com/plugins/typescript-react-query#using-fetch-with-codegen-configuration My requirements: I need to have a custom fetcher - to resolve custom…
Dominik
  • 91
  • 5
3
votes
0 answers

Haskell CoreSyn library -- how does one refer to built-in IO types?

I am trying to see how the following Haskell code gets translated to the data types defined in the Coresyn library. module Main where f :: Double -> IO () f = putStrLn . show main :: IO () main = f 3 I can obtain the core code made human…
Jonathan Gallagher
  • 2,115
  • 2
  • 17
  • 31
3
votes
0 answers

Is it possible to use source generators in .NET Core 3.1/5 WPF projects?

I have a project that uses code generators to automatically provide INotifyPropertyChanged support for fields. Some classes in the project implement an interface that has some properties that ought to be generated by that source generator for the…
Streamline
  • 952
  • 1
  • 15
  • 23
3
votes
3 answers

swagger codegen --> angular6: rxjs observable compile error

When using to angular 6 and swagger codegen, i'm getting typescript compiler errors related to rxjs: Cannot find module 'rxjs-compat/Observable' I found the…
Datum Geek
  • 1,358
  • 18
  • 23
3
votes
1 answer

How to make Core Data generated code to use internal accessors? Swift 4, Xcode 9.2

I am wondering if there is any way to prevent core data from generating public classes from core data model Entities. Currently it generates classes like this: import Foundation import CoreData public class MyEntityMO: NSManagedObject…
3
votes
1 answer

Common sub-expression elimination using sympy

I am trying to learn using sympy to optimize the numerical evaluation of mathematical expressions in C. On one side I know that sympy can generate C code to evaluate one expression as follows: from mpmath import * from sympy.utilities.codegen…
3
votes
0 answers

Sympy - generate fortran code with one dimensional array

I was trying to use sympy - codegen to get a fortran code. It works fine except for one annoying thing for which I can`t find a solution. I simplified my example to this: bar = Matrix([x*x,y*z,z*y]) result = codegen(('foo', bar), 'f95',…
MatG
  • 31
  • 1
3
votes
1 answer

LLVM Backend : Replacing indirect jmps for x86 backend

I want to replace indirect jmp *(eax) instructions in the code to mov *(eax),ebx; jmp *ebx for the x86 executables. Before implementing this, i would like to make LLVM compiler, log an output every time it detects a jmp *(eax) instruction by adding…
woodstok
  • 2,704
  • 3
  • 34
  • 50
3
votes
1 answer

How to generate Fortran subroutine with SymPy codegen

I want to generate a Fortran subroutine with SymPy codegen utility. I can generate a Fortran function without problem with codegen(("f", x*y*z), "f95", "filename"). But I want to generate a Fortran subroutine so I can modify input arrays. How can I…
Michael
  • 1,834
  • 2
  • 20
  • 33
3
votes
1 answer

Matlab Coder - Alternative for strcat function

Currently matlab coder is not supporting strcat or strjoin. Is there any anyway to circumvent this or custom function? Edit: Input= [a b c d] Expected output= 'a,b,c,d'
Joel
  • 1,650
  • 2
  • 22
  • 34
2
votes
3 answers

java peephole optimization beginner compilers

As part of a group project I'm writing a compiler for a simplified language. As one of the optional features I thought I'd add a peephole optimizer to go over the codegen's output intel assembly code and optimize it. Our compiler is done in java…
ddriver1
  • 723
  • 10
  • 18
2
votes
0 answers

Adding AtomicCmpXchg instruction with OCaml LLVM API

I’m trying to implement mutexes in the LLVM backend I’m writing for my programming language. I’m having trouble figuring out the exact API call, using the OCaml llvm bindings, to generate a cmpxchg instruction. I'm using OCaml 4.14.0 and…
Nick Doan
  • 31
  • 2
1 2
3
16 17