Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deftype #48

Merged
merged 5 commits into from
Sep 18, 2020
Merged

Add deftype #48

merged 5 commits into from
Sep 18, 2020

Conversation

water111
Copy link
Collaborator

Adds a parser for deftype type definitions in the common library, and moving GOOS to the common library to support this.

The deftype parser has some optional assert features which let you specify where fields should be in the type layout, where methods should be in the method table, the size of the type, and what the GOAL type flags should be. If the compiler comes up with a different result, it'll throw a compiler error. We can use this to make sure that our memory layout matches the original and that OpenGOAL's behavior matches the original compiler.

Also adds deftype to the compiler, including calling the new_type function in the runtime.

Adds bfloat's deftype to gcommon.gc.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 260348970

  • 234 of 299 (78.26%) changed or added relevant lines in 13 files are covered.
  • 50 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+2.07%) to 61.811%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/type_system/Type.cpp 0 1 0.0%
goalc/compiler/Compiler.cpp 0 1 0.0%
goalc/compiler/IR.cpp 16 17 94.12%
goalc/compiler/compilation/Function.cpp 0 2 0.0%
goalc/compiler/compilation/Type.cpp 21 23 91.3%
goalc/compiler/Val.h 3 6 50.0%
common/type_system/deftype.cpp 149 204 73.04%
Files with Coverage Reduction New Missed Lines %
goalc/compiler/Compiler.cpp 11 61.07%
goalc/emitter/IGen.h 39 92.85%
Totals Coverage Status
Change from base Build 256519513: 2.07%
Covered Lines: 13162
Relevant Lines: 21294

💛 - Coveralls

@water111 water111 merged commit abcd444 into master Sep 18, 2020
@water111 water111 deleted the w/deftype branch September 18, 2020 01:48
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