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

Show line number in runtime panic #51

Closed
jclark opened this issue Jun 14, 2021 · 5 comments
Closed

Show line number in runtime panic #51

jclark opened this issue Jun 14, 2021 · 5 comments
Assignees
Projects
Milestone

Comments

@jclark
Copy link
Contributor

jclark commented Jun 14, 2021

Preferably column too.

This requires passing line/column info through the compilation pipeline from parsing to LLVM building.

@jclark
Copy link
Contributor Author

jclark commented Jun 14, 2021

Plan:

  • for AST node for binary + - * / %, and unary -, include position
  • include that also in relevant BIR insn
  • when building LLVM, put the column and line in the argument passed to panic (we can either make a LLVM struct or do the encoding with bitwise operations ourself)

@jclark
Copy link
Contributor Author

jclark commented Jun 16, 2021

This will require changing AST, so this one is waiting on #50. Apart from adding position info, I want to separate out the arithmetic binary ops from the other ones.

@jclark
Copy link
Contributor Author

jclark commented Jun 20, 2021

When we do this, we also need to fix testll.sh to check that the line number is correct.

@jclark jclark added this to Top priority quality improvements in Ongoing Jun 20, 2021
@jclark
Copy link
Contributor Author

jclark commented Jun 23, 2021

Handle type casts too: they already have the position in BIR.

jclark added a commit that referenced this issue Jun 26, 2021
@jclark
Copy link
Contributor Author

jclark commented Jun 26, 2021

  • Separate out arithmetic binary ops from other ones
  • Include position in AST for arithmetic binary ops
  • Include position in BIR for arithmetic binary ops
  • Pass position information to panic function for arithmetic ops
  • Pass position information to panic function for type cast
  • Fix runtime to print out position information if present
  • Fix testll.sh to check that line number is correct

@jclark jclark closed this as completed in 16be236 Jun 27, 2021
manuranga pushed a commit that referenced this issue Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Ongoing
Other improvements
Development

No branches or pull requests

1 participant