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

Rudimentary name mangling support #4267

Merged
merged 46 commits into from
Sep 6, 2024

Commits on Sep 6, 2024

  1. Refactor name mangling into a separate class

    In preparation for adding broader name mangling support.
    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    450a2a2 View commit details
    Browse the repository at this point in the history
  2. Add a name mangling prefix.

    _C was chosen without special care or consideration - that C++ didn't
    choose _C for the itanium mangling probably says it's not the best
    letter to pick, but we don't have any particular detail about how
    different languages have chosen their mangling prefixes or other
    conflict avoidance.
    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    5ef42c7 View commit details
    Browse the repository at this point in the history
  3. Namespace mangling

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    b879dc7 View commit details
    Browse the repository at this point in the history
  4. Mangle class scopes

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    b692032 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    69d25d7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    21a6391 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c31e8c2 View commit details
    Browse the repository at this point in the history
  8. Mangle impls

    * mangle the fully qualified name of the class doing the implementing
    * do not mangle the qualifiers of the interfaces yet
    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    d6d2263 View commit details
    Browse the repository at this point in the history
  9. Match parameter names

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    5feca3d View commit details
    Browse the repository at this point in the history
  10. Add vertical whitespace to toolchain/lower/mangler.h

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    04b6dc3 View commit details
    Browse the repository at this point in the history
  11. Rename class_node -> class_info

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    12f35d4 View commit details
    Browse the repository at this point in the history
  12. Avoid unnecessary package namespace lookup

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    26f1b4b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6d6b07e View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c064332 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    c56c4f9 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    7438817 View commit details
    Browse the repository at this point in the history
  17. Use sem_ir() helper.

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    adc0aba View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    2c5cf62 View commit details
    Browse the repository at this point in the history
  19. Add comments for Mangler

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    248ca95 View commit details
    Browse the repository at this point in the history
  20. Use data iteration instead of a while loop for name printing.

    Laying the foundation for removing the recursion from the mangler.
    
    (also fixes the nested switch type, which didn't compile)
    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    c835a9e View commit details
    Browse the repository at this point in the history
  21. More data iteration stuff

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    b86c11c View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    08c2576 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    e08c432 View commit details
    Browse the repository at this point in the history
  24. Simplify the code a bit

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    e169dc7 View commit details
    Browse the repository at this point in the history
  25. Minor simplification

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    7d81cb5 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    6ab771e View commit details
    Browse the repository at this point in the history
  27. Use const ref to avoid accidental copy

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    6e199a0 View commit details
    Browse the repository at this point in the history
  28. Rename name_id to name_scope_id

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    e9f2cdd View commit details
    Browse the repository at this point in the history
  29. Add comment

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    a73c68e View commit details
    Browse the repository at this point in the history
  30. Clarify entry point return type comment

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    2468626 View commit details
    Browse the repository at this point in the history
  31. Remove out-of-place comment

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    004099a View commit details
    Browse the repository at this point in the history
  32. Spelling fix

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    c4d4be0 View commit details
    Browse the repository at this point in the history
  33. Rephrase comment, avoiding 'extern' terminology

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    cbdb9cf View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    89e1301 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    fb13336 View commit details
    Browse the repository at this point in the history
  36. Fixes for renamed member

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    2a25c6f View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    071f514 View commit details
    Browse the repository at this point in the history
  38. Continue mangling, even once reaching the package name

    This had been causing mangling to stop for impls, after reaching the
    package level of the first part of the name - missing the second part of
    the name.
    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    7cec2ef View commit details
    Browse the repository at this point in the history
  39. Comment formatting/sentencification

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    c99163d View commit details
    Browse the repository at this point in the history
  40. Ignore the scope an impl is defined in

    only the constraint and interface uniquely identify an impl
    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    24ba431 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    3d7f262 View commit details
    Browse the repository at this point in the history
  42. Line wrapping

    Co-authored-by: Carbon Infra Bot <[email protected]>
    dwblaikie and CarbonInfraBot authored Sep 6, 2024
    Configuration menu
    Copy the full SHA
    843b021 View commit details
    Browse the repository at this point in the history
  43. Remove unnecessary clear() call

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow authored Sep 6, 2024
    Configuration menu
    Copy the full SHA
    2ea5b0c View commit details
    Browse the repository at this point in the history
  44. Simplify code with pop_back_val()

    Co-authored-by: Jon Ross-Perkins <[email protected]>
    dwblaikie and jonmeow authored Sep 6, 2024
    Configuration menu
    Copy the full SHA
    1c215f2 View commit details
    Browse the repository at this point in the history
  45. Remove empty line

    Co-authored-by: Carbon Infra Bot <[email protected]>
    dwblaikie and CarbonInfraBot authored Sep 6, 2024
    Configuration menu
    Copy the full SHA
    10f0633 View commit details
    Browse the repository at this point in the history
  46. Update tests

    dwblaikie committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    0fefc7d View commit details
    Browse the repository at this point in the history