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

Avoid unnecessary copies of arguments that are simple bindings #45380

Merged
merged 2 commits into from
Oct 26, 2017

Commits on Oct 26, 2017

  1. Avoid unnecessary copies of arguments that are simple bindings

    Initially MIR differentiated between arguments and locals, which
    introduced a need to add extra copies assigning the argument to a
    local, even for simple bindings. This differentiation no longer exists,
    but we're still creating those copies, bloating the MIR and LLVM IR we
    emit.
    
    Additionally, the current approach means that we create debug info for
    both the incoming argument (marking it as an argument), and then
    immediately shadow it a local that goes by the same name. This can be
    confusing when using e.g. "info args" in gdb, or when e.g. a debugger
    with a GUI displays the function arguments separately from the local
    variables, especially when the binding is mutable, because the argument
    doesn't change, while the local variable does.
    dotdash committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    0473a4f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ad7c28 View commit details
    Browse the repository at this point in the history