[Attributes] Clean up handling of UB implying attributes (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 25 Jul 2021 16:21:13 +0000 (18:21 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 25 Jul 2021 16:21:13 +0000 (18:21 +0200)
commit087a8eea359a4d8ef22c42fddca3b09833928c6a
treedafacf5d78424c047f0c2742111ae13a39083961
parent99f869c8f00a36dac3c774178b69d05876a29a31
[Attributes] Clean up handling of UB implying attributes (NFC)

Rather than adding methods for dropping these attributes in
various places, add a function that returns an AttrBuilder with
these attributes, which can then be used with existing methods
for dropping attributes. This is with an eye on D104641, which
also needs to drop them from returns, not just parameters.

Also be more explicit about the semantics of the method in the
documentation. Refer to UB rather than Undef, which is what this
is actually about.
llvm/include/llvm/IR/Attributes.h
llvm/include/llvm/IR/InstrTypes.h
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/Function.cpp
llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp