[all-commits] [llvm/llvm-project] d1675e: [AttrBuilder] Remove empty() / td_empty() methods

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat Jan 15 08:57:34 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1675e494411050bd3b56ae55ff9c6fd93349c37
      https://github.com/llvm/llvm-project/commit/d1675e494411050bd3b56ae55ff9c6fd93349c37
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2022-01-15 (Sat, 15 Jan 2022)

  Changed paths:
    M llvm/include/llvm/IR/Attributes.h
    M llvm/lib/Transforms/Utils/InlineFunction.cpp

  Log Message:
  -----------
  [AttrBuilder] Remove empty() / td_empty() methods

The empty() method is a footgun: It only checks whether there are
non-string attributes, which is not at all obvious from its name,
and of dubious usefulness. td_empty() is entirely unused.

Drop these methods in favor of hasAttributes(), which checks
whether there are any attributes, regardless of whether these are
string or enum attributes.




More information about the All-commits mailing list