diff options
author | Anna Thomas <anna@azul.com> | 2021-09-15 17:06:18 -0400 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2021-09-15 17:06:20 -0400 |
commit | 3273430406c186f1f2af597adeedf21d4fa52b18 (patch) | |
tree | e8b3a815d2f509fa1d7e4f39dfe1ee766d39094e /llvm/lib/IR/Value.cpp | |
parent | 7d437cf76e3ac38d84b5d82e5412dd1b6746daa1 (diff) | |
download | llvm-3273430406c186f1f2af597adeedf21d4fa52b18.zip llvm-3273430406c186f1f2af597adeedf21d4fa52b18.tar.gz llvm-3273430406c186f1f2af597adeedf21d4fa52b18.tar.bz2 |
Re-add getSingleUndroppableUse API
The API was removed in 4ac4e52189aa in favor of
getUniqueUndroppableUser.
However, this caused a buildbot failure in AbstractCallSiteTest.cpp,
which uses the API and the AbstractCallSite class requires a "use"
rather than a user.
Retain the API so that the unittest compiles and passes.
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index a47ab68..7d2d73a 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -164,6 +164,18 @@ bool Value::hasOneUser() const { static bool isUnDroppableUser(const User *U) { return !U->isDroppable(); } +Use *Value::getSingleUndroppableUse() { + Use *Result = nullptr; + for (Use &U : uses()) { + if (!U.getUser()->isDroppable()) { + if (Result) + return nullptr; + Result = &U; + } + } + return Result; +} + User *Value::getUniqueUndroppableUser() { User *Result = nullptr; for (auto *U : users()) { |