Skip to content

Add source location to invalid_source_file_exceptiont #5837

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

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Feb 18, 2021

This enables proper use in the C front-end in a way that is compatible
with the compiler-specific message handlers in goto-cc: those message
handlers generate source-location output that mimics that of the
compiler being emulated.

As future work it is thus possible to remove all "throw 0" instances
from the C front-end.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig self-assigned this Feb 18, 2021
@tautschnig tautschnig mentioned this pull request Feb 18, 2021
7 tasks
@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #5837 (0470384) into develop (bcca9da) will decrease coverage by 0.00%.
The diff coverage is 58.22%.

@@             Coverage Diff             @@
##           develop    #5837      +/-   ##
===========================================
- Coverage    77.80%   77.80%   -0.01%     
===========================================
  Files         1567     1566       -1     
  Lines       179916   179941      +25     
===========================================
+ Hits        139988   140007      +19     
- Misses       39928    39934       +6     
Impacted Files Coverage Δ
src/ansi-c/ansi_c_typecheck.cpp 67.85% <0.00%> (-8.15%) ⬇️
src/cpp/cpp_typecheck.cpp 77.70% <0.00%> (-1.52%) ⬇️
src/crangler/mini_c_parser.cpp 71.02% <0.00%> (-1.66%) ⬇️
src/goto-programs/string_instrumentation.cpp 25.11% <0.00%> (ø)
src/symtab2gb/symtab2gb_parse_options.cpp 60.00% <0.00%> (-3.39%) ⬇️
src/util/exception_utils.cpp 94.11% <66.66%> (-3.80%) ⬇️
src/ansi-c/c_typecheck_expr.cpp 77.04% <71.42%> (-0.02%) ⬇️
src/ansi-c/c_typecheck_type.cpp 77.11% <100.00%> (-0.08%) ⬇️
src/ansi-c/literals/convert_character_literal.cpp 85.71% <100.00%> (+13.91%) ⬆️
src/ansi-c/scanner.l 63.34% <100.00%> (-0.04%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c688efd...0470384. Read the comment docs.

@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont Add source location to invalid_source_file_exceptiont [depends-on: #5834, #5835, #5836] Mar 18, 2021
@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont [depends-on: #5834, #5835, #5836] Add source location to invalid_source_file_exceptiont [depends-on: #5834, #5835] May 4, 2021
Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a comment

Choose a reason for hiding this comment

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

That looks great to me, and is what we should have done when we first added the structured exceptions. Some nice code cleanups/refactoring along the way too.

@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont [depends-on: #5834, #5835] Add source location to invalid_source_file_exceptiont [depends-on: #5835] Jan 23, 2022
@tautschnig tautschnig force-pushed the c-no-structured-throws branch from 6c368cc to 8e72373 Compare January 23, 2022 20:41
@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont [depends-on: #5835] Add source location to invalid_source_file_exceptiont [depends-on: #5835,#6608] Jan 23, 2022
@tautschnig tautschnig force-pushed the c-no-structured-throws branch from 8e72373 to 0a6a600 Compare February 8, 2022 14:14
@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont [depends-on: #5835,#6608] Add source location to invalid_source_file_exceptiont [depends-on: #5835] Feb 8, 2022
@tautschnig tautschnig force-pushed the c-no-structured-throws branch 2 times, most recently from 6d2a0f0 to 8f50ea8 Compare February 8, 2022 14:42
@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont [depends-on: #5835] Add source location to invalid_source_file_exceptiont [depends-on: #6697] Feb 24, 2022
tautschnig added a commit that referenced this pull request Feb 28, 2022
De-duplicate initialize_goto_model's code [blocks: #5837]
@tautschnig tautschnig force-pushed the c-no-structured-throws branch from 8f50ea8 to 00270a6 Compare February 28, 2022 10:12
@tautschnig tautschnig marked this pull request as ready for review February 28, 2022 10:13
@tautschnig tautschnig force-pushed the c-no-structured-throws branch from 00270a6 to e482a61 Compare February 28, 2022 10:18
@tautschnig tautschnig changed the title Add source location to invalid_source_file_exceptiont [depends-on: #6697] Add source location to invalid_source_file_exceptiont Feb 28, 2022
@tautschnig tautschnig removed their assignment Feb 28, 2022
Copy link

@chris-ryder chris-ryder left a comment

Choose a reason for hiding this comment

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

Previously reviewed and approved with my Diffblue account, re-approving with my non-Diffblue account to keep the CODEOWNER review.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Yes. I don't think this breaks any scripting.

@tautschnig tautschnig force-pushed the c-no-structured-throws branch from e482a61 to 8bd17d9 Compare March 2, 2022 17:12
@tautschnig tautschnig removed their assignment Mar 2, 2022
None of our existing tests covers the failure paths of type checking
saturating arithmetic and character literal conversion, respectively.
This enables proper use in the C front-end in a way that is compatible
with the compiler-specific message handlers in goto-cc: those message
handlers generate source-location output that mimics that of the
compiler being emulated.

As future work it is thus possible to remove all "throw 0" instances
from the C front-end.
@tautschnig tautschnig force-pushed the c-no-structured-throws branch from 8bd17d9 to 0470384 Compare May 25, 2022 22:50
@@ -37,5 +38,11 @@ bool typecheckt::typecheck_main()
error() << e << eom;
}

catch(const invalid_source_file_exceptiont &e)
Copy link
Member

Choose a reason for hiding this comment

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

🎉

@peterschrammel peterschrammel removed their assignment Jun 30, 2022
@tautschnig tautschnig merged commit d8f3d49 into diffblue:develop Jun 30, 2022
@tautschnig tautschnig deleted the c-no-structured-throws branch June 30, 2022 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants