[all-commits] [llvm/llvm-project] 9afb63: [Attributes] Avoid duplicate hasAttribute() query ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Jan 9 03:59:32 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9afb6360fcbb5c94f37f6c1328bfa76ca8e20021
      https://github.com/llvm/llvm-project/commit/9afb6360fcbb5c94f37f6c1328bfa76ca8e20021
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-01-09 (Mon, 09 Jan 2023)

  Changed paths:
    M llvm/lib/IR/Attributes.cpp

  Log Message:
  -----------
  [Attributes] Avoid duplicate hasAttribute() query (NFC)

removeAttribute() already performs a hasAttribute() check, so no
need to also do it in the caller. Instead check whether the
attribute set was changed.

This makes the implementations in line with removeAttributesAtIndex().




More information about the All-commits mailing list