willi19 / swpp202301-compiler-team6

MIT License
0 stars 0 forks source link

Generating benchmarkable-LL files #3

Open goranmoomin opened 1 year ago

goranmoomin commented 1 year ago

The irgen program crashes on C code that defines the read function as a variable function, not a void function.

i.e., if the benchmark code defines the read prototype as: uint64_t read() instead of: uint64_t read(void), the irgen program crashes on CF->getName() because the read() call compiles to IR as a cast instead of a direct call.

I ran the below in a shell to fix the problem. If you're on Linux with a GNU sed, you might have to replace sed -i '' to sed -i to run it.

$ grep -lr '^uint64_t read();$' . | tr '\n' '\0' | xargs -0 -I{} sed -i '' 's/^uint64_t read();$/uint64_t read(void);/g' {}
$ grep -lr '^int64_t read();$' . | tr '\n' '\0' | xargs -0 -I{} sed -i '' 's/^int64_t read();$/int64_t read(void);/g' {}
sharaelong commented 1 year ago

So does it mean that

  1. we have to change read prototype of the provided test cases, and
  2. we have to define read as int64_t read(void) when we make new test cases?
goranmoomin commented 1 year ago

Both are correct AFAIU.

willi19 commented 1 year ago

okay