aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index ce0f710..9c64cd1 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -966,9 +966,6 @@ bool Function::hasAddressTaken(const User **PutOffender,
bool IgnoreCastedDirectCall) const {
for (const Use &U : uses()) {
const User *FU = U.getUser();
- if (isa<BlockAddress>(FU))
- continue;
-
if (IgnoreCallbackUses) {
AbstractCallSite ACS(&U);
if (ACS && ACS.isCallbackCall())
@@ -1033,12 +1030,7 @@ bool Function::isDefTriviallyDead() const {
!hasAvailableExternallyLinkage())
return false;
- // Check if the function is used by anything other than a blockaddress.
- for (const User *U : users())
- if (!isa<BlockAddress>(U))
- return false;
-
- return true;
+ return use_empty();
}
/// callsFunctionThatReturnsTwice - Return true if the function has a call to