1. 14 Dec, 2019 6 commits
  2. 12 Dec, 2019 7 commits
    • JoJo's avatar
      Pass `byval` when passing by reference · d9a33e51
      JoJo authored
      So instead of
        declare @foo(%Foo* %x)
        extern fn foo(x: &Foo) { ... }
      we do
        declare @foo(%Foo* byval %x)
        extern fn foo(x: Foo) { ... }
      It just seemed like a nice thing to do, especially now that
      we (mostly?) conform to C calling convention / System V ABI.
    • JoJo's avatar
      Make passByRef more exhaustive and correct · ca7366cf
      JoJo authored
      I think it's pretty close to System V ABI spec now.
      Sadly, access to env of datatypes is needed to do lookup for
      NamedTypeReference, and this had something of a chain reaction. Not
      only passByRef became Gen', but also toLlvmType! This had some effect
      throughout the module.
    • JoJo's avatar
      Don't greedily mark every call as tail -- causes segfaults & stuff! · b32b4f44
      JoJo authored
      For now, don't mark any call as tail. Gotta learn how it really works
      first. Seems like only calls that are actually in tail-position should
      be marked as tail, or mayhem ensues.
    • JoJo's avatar
      Properly mark out-params as sret in function defs · aa164fc1
      JoJo authored
    • JoJo's avatar
      Update README & TODO · 3a4386b5
      JoJo authored
      Jot down that algebraic datatypes are basically done, but we've got
      call conv bugs to squish.
    • JoJo's avatar
      Check that non-func var defs aren't recursive · c763695a
      JoJo authored
      Because we can't compile that with strict evaluation!
    • JoJo's avatar
      Rename main to start & fix start-related stuff · 8c7156e4
      JoJo authored
      First, the reason for the rename. Having both an "outer" and an
      "inner" main named main (with LLVM kindly generating some suffix to
      separate them) was just not very pretty looking. Another problem was
      that, while not possible before, e.g. recursing in main would not
      work, as the main found would not be the inner main, but the outer
      main. Renaming the inner (user defined) main to start alleviates this
      Another approach we could've taken is to rename the outer main, and
      tell the linker (via GCC/Clang) that we have another entrypoint than
      main. I started working on this, but just appending a "-e outer_main"
      flag was no good. The problem was that the entrypoint changed was not
      main to outer_main, but rather _start to outer_main. This was no good,
      as _start usually sets up some things before calling main, and the
      result was segfaults.
      Also, now start (main) is treated more like any other global def, and
      you can call main from other functions and recurse etc. I had to fix
      how main is typechecked a bit for this to work correctly.
  3. 11 Dec, 2019 5 commits
  4. 10 Dec, 2019 8 commits
  5. 09 Dec, 2019 8 commits
  6. 31 Oct, 2019 6 commits