-
Notifications
You must be signed in to change notification settings - Fork 26
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
Better c support #1059
Better c support #1059
Conversation
Does not yet produce code & struct can only be declared in global context for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, nice work! I am ok with the general structure of the changes and I've tried to provide some useful feedback. If there's particular areas you want me to have a more detailed look at feel free to let me know.
src/col/vct/col/ast/expr/apply/ProverFunctionInvocationImpl.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am finished with everything now. And I tried to comment on some stuff you wrote or fix what you were saying.
I've tried to include tests for all the functionality I wrote. The bigger things in the files. The potential errors/verification failures as smaller tests in CSpec.scala.
How would you want me to proceed @pieter-bos ?
Very nice work! Let's get it merged (I'm just running the test suite now, since GitHub doesn't do that for forks) |
Awesome, glad that it's merged! |
I've added some better C support for several things.
int a[5]
,int a[] = {0, 1, 2, 3, 4}
orint a[5] = {0, 1, 2, 3, 4}
int *xs = (int *) malloc(5*sizeof(int))
. It creates a pointer block withpointer_offset
set to0
. In the example, it has a length of 5.pointer_block
s which have thepointer_offset
set to 0. Furthermore, it requires write permission to the completepointer_block
, which is does not give back.#omp parallel for
#omp parallel for
? Or alternatively, if#omp parallel for
is present, it requires an iteration contract.%
in C%
is now working in better correspondence with the c99 compiler. (although to be completely fair, it is compiler/architecture dependent).inline
andpure
annotations were not actually processedint
float
(but actually rational)I did not make any test cases yet, which I could still make.
In some cases, I really had no clue how to get the correct blame for a node. So I made
PanicBlame("TODO")
in those cases, any advice on those would be great.