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

Front-ends and modes in symtab2gb #6223

Closed
martin-cs opened this issue Jul 12, 2021 · 2 comments
Closed

Front-ends and modes in symtab2gb #6223

martin-cs opened this issue Jul 12, 2021 · 2 comments

Comments

@martin-cs
Copy link
Collaborator

I don't yet have a reproducer for this issue but it seems that there is a design / architectural problem.

  1. symtab2gb only loads the json_symtab language:

    register_language(new_json_symtab_language);

  2. It calls linking. The error reporting of linking calls from_type which uses the mode of the symbol:
    linkingt::copy_symbols
    linkingt::duplicate_non_type_symbol
    linkingt::duplicate_code_symbol
    linkingt::detailed_conflict_report
    linkingt::detailed_conflict_report_rec
    linkingt::type_to_string_verbose
    from_type

  3. At the moment having the mode as anything other than "json_symtab" will result in an invariant failure.

So, potential work-arounds or solutions:

  • Set the mode of all inputs using this interface to "json_symtab" ( paging @danielsn for the connection to RFC: Language mode for Rust  #6219 ).
  • Add the C language interface to symtab2gb and set the mode to ID_C (as it is at the moment).
  • Create modes for the various languages using this front-end and load all of them.

( See also #6219 (comment) )

@chrisr-diffblue
Copy link
Contributor

While its not the biggest problem in the world, it does seem that adding more 'language modes' to json_symtab_language makes it an increasing maintenance burden over time (e.g. harder to add sensible invariants, easier for language specific implementation details to leak into dark corners of code, etc). I think I prefer the proposals in #6219 personally (see comments I'm about to add there...)

@martin-cs
Copy link
Collaborator Author

#6233 works around this issue by supporting mode ID_C . To be resolved properly as part of #6219 .

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

No branches or pull requests

2 participants