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

rustc_codegen_llvm cleanups #130506

Merged
merged 14 commits into from
Sep 20, 2024
Merged

Commits on Sep 19, 2024

  1. Streamline register methods.

    These can be made more concise, mostly through appropriate use of `use`
    declarations.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    785a26a View commit details
    Browse the repository at this point in the history
  2. Rename a parameter.

    This seems to be a typo. `singletree` doesn't make sense, and everywhere
    else it is `singlethread`.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    63210bd View commit details
    Browse the repository at this point in the history
  3. Streamline report_inline_asm.

    By using `use`.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9429e64 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0d78f1e View commit details
    Browse the repository at this point in the history
  5. Use a macro to factor out some repetitive code.

    Similar to the existing macro just above.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4ce010e View commit details
    Browse the repository at this point in the history
  6. Remove a low-value comment.

    We rarely use parameter comments, and these ones don't tell us anything
    interesting.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    eb57550 View commit details
    Browse the repository at this point in the history
  7. Streamline hidden visibility setting.

    In `get_fn` there is a complicated set of if/elses to determine if
    `hidden` visibility should be applied. There are five calls to
    `LLVMRustSetVisibility` and some repetition in the comments.
    
    This commit streamlines it a bit:
    - Computes `hidden` and then uses it to determine if a single call to
      `LLVMRustSetVisibility` occurs.
    - Converts some of the if/elses into boolean expressions.
    - Removes the repetitive comments.
    
    Overall this makes it quite a bit shorter, and I find it easier to read.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    fda530d View commit details
    Browse the repository at this point in the history
  8. Reorder ConstMethods.

    It's crazy to have the integer methods in something close to random
    order.
    
    The reordering makes the gaps clear: `const_i64`, `const_i128`,
    `const_isize`, and `const_u16`. I guess they just aren't needed.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    bfef261 View commit details
    Browse the repository at this point in the history
  9. Reduce visibility.

    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    badd8cc View commit details
    Browse the repository at this point in the history
  10. Fix a comment.

    I'm pretty sure `CodegenCx` applies to codegen units, rather than
    compilation units.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ccd6c61 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3b07169 View commit details
    Browse the repository at this point in the history
  12. Avoid heavy repetition in llvm/ffi.rs.

    Through judicious use of `use` and `Self`.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    c5af8b2 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    5fd16df View commit details
    Browse the repository at this point in the history
  14. Reformat some comments.

    So they are less than 100 chars.
    nnethercote committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    1f35940 View commit details
    Browse the repository at this point in the history