[all-commits] [llvm/llvm-project] 76eb16: Sema: remove unnecessary parameter for SwiftName h...

Saleem Abdulrasool via All-commits all-commits at lists.llvm.org
Fri Sep 25 10:01:55 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 76eb163259c46171559a49111a394a3e48d1e523
      https://github.com/llvm/llvm-project/commit/76eb163259c46171559a49111a394a3e48d1e523
  Author: Saleem Abdulrasool <compnerd at compnerd.org>
  Date:   2020-09-25 (Fri, 25 Sep 2020)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp

  Log Message:
  -----------
  Sema: remove unnecessary parameter for SwiftName handling (NFCI)

This code never actually did anything in the implementation.

`mergeDeclAttribute` is declared as `static`, and referenced exactly
once in the file: from `Sema::mergeDeclAttributes`.

`Sema::mergeDeclAttributes` sets `LocalAMK` to `AMK_None`.  If the
attribute is `DeprecatedAttr`, `UnavailableAttr`, or `AvailabilityAttr`
then the `LocalAMK` is updated.  However, because we are dealing with a
`SwiftNameDeclAttr` here, `LocalAMK` remains `AMK_None`.  This is then
passed to the function which will as a result pass the value of
`AMK_None == AMK_Override` aka `false`.  Simply propagate the value
through and erase the dead codepath.

Thanks to Aaron Ballman for flagging the use of the availability merge
kind here leading to this simplification!

Differential Revision: https://reviews.llvm.org/D88263
Reviewed By: Aaron Ballman




More information about the All-commits mailing list