Skip to content

Conversation

@datawater
Copy link
Contributor

  • #import syntax for fasm
  • System V AMD64 ABI calling for imported functions
  • static linking with libc (controlled with flags -lc)
  • cont bindings to libc functions
  • dynamic linking
  • linking with libraries other than libc
  • tests

Copy link
Owner

@farkon00 farkon00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you should separate out the changes into multiple commits and the nix changes should be moved to different PR.

}

REGULAR_OPTIONS: Dict[str, List[str]] = {
REGULAR_OPTIONS: Dict[str, Tuple[List[str], bool]] = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type annotation is wrong in master, but the new annotation is wrong as well, it's clearly Dict[str, Tuple[List[str], str]
TODO: make this a proper dataclass, maybe?

fget=lambda self, name=name: self.config.get(
name, getattr(self.args, name)
if getattr(self.args, name) is not None
else self.REGULAR_OPTIONS[name][1])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be else self.ARRAY_OPTIONS[name][1]

if the function is used in code and not by calling the script from command line.
"""
config = Config(sys.argv, lsp_mode=lsp_mode)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a change here?

buf = ""

if op.operand.is_imported:
calling_convention = ["rdi", "rsi", "rdx", "rcx", "r8", "r9"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a constant declared globally

calling_convention.pop(0)
in_stack.pop(0)

buf += f"call {op.operand.name}\npush rax\n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't push rax if the function does not return a value

error.name = "ContExitException";
return error;
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a change here?

else:
@pytest.mark.parametrize("test_name", tests)
def test_node_wat64(test_name):
if test_name == "extern":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better if this was a part of the test file itself, but this is a matter for a different PR for sure

return hash(self.text_repr())


class Void(Type):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the void type, because we have native untyped pointers in cont

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants