[Attributes] Remove trailing empty attribute sets (PR59746)
authorNikita Popov <npopov@redhat.com>
Thu, 5 Jan 2023 16:12:31 +0000 (17:12 +0100)
committerNikita Popov <npopov@redhat.com>
Thu, 5 Jan 2023 16:14:37 +0000 (17:14 +0100)
commit66dcb86b8bd9bdd1510c8eb797b4845cac0d3263
tree67f4f351c15d9df8539fef1abfec82b457843286
parenteebfee8f9ea7dfc9e7cf4326decadc779969994e
[Attributes] Remove trailing empty attribute sets (PR59746)

In setAttributesAtIndex(), remove any trailing empty attribute sets.
Also make sure that all the different attribute removal APIs go
through that method.

Fixes https://github.com/llvm/llvm-project/issues/59746.
llvm/lib/IR/Attributes.cpp
llvm/unittests/IR/AttributesTest.cpp