vast icon indicating copy to clipboard operation
vast copied to clipboard

Refactor function generation

Open xlauko opened this issue 1 year ago • 0 comments

At the moment the logic is on three places:

  • CodeGenDriver, CodeGen and CodeGenDeclVisitor
  • driver and visitor also duplicates some logic -- emit_function_prologue and VisitFunctionDecl
  • emit_function_prologue should not really exist

Ideally we want to have separated responsibility:

  • CodeGenDriver to parse frontend options
  • CodeGen orchestrate scoping
  • probably best option would be to extract separate component to handle funciton codegen -- move emit_function_prologue and start_function from CodeGen ?
  • CodeGenDeclVisitor orchestrate mlir generation

xlauko avatar Mar 24 '23 11:03 xlauko