================
@@ -153,23 +153,26 @@ class SetVector {
}
/// Insert a new element into the SetVector.
- /// \returns true if the element was inserted into the SetVector.
- bool insert(const value_type &X) {
+ /// \returns a pair, whose first member is the iterator pointed to the
+ /// element, and the second member indicates if the element was inserted.
+ std::pair<iterator, bool> insert(const value_type &X) {
if constexpr (canBeSmall())
if (isSmall()) {
if (!llvm::is_contained(vector_, X)) {
vector_.push_back(X);
if (vector_.size() > N)
makeBig();
- return true;
+ return {std::prev(vector_.end()), true};
}
- return false;
+ return {find(vector_, X), false};
----------------
aengelke wrote:
Are we sure this is always fully optimized out when unused? This also might
shift inlining thresholds.
https://github.com/llvm/llvm-project/pull/232372
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits