aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-02 19:05:43 +0000
committerFangrui Song <i@maskray.me>2022-12-02 19:05:43 +0000
commitca23b7ca476fb66771d1c6d02c6837938fde6c7e (patch)
tree76c5e95cdee7818b1fa2bff56aaba1cba801b3a2 /llvm/lib/IR/Value.cpp
parent9f07256a51924feabf151b5f5fbbab16af2a76c5 (diff)
downloadllvm-ca23b7ca476fb66771d1c6d02c6837938fde6c7e.zip
llvm-ca23b7ca476fb66771d1c6d02c6837938fde6c7e.tar.gz
llvm-ca23b7ca476fb66771d1c6d02c6837938fde6c7e.tar.bz2
[AsmPrinter] .addrsig_sym: remove isTransitiveUsedByMetadataOnly
With D135642 ignoring unregistered symbols, isTransitiveUsedByMetadataOnly added by D101512 is no longer needed (the operation is potentially slow). There is a `.addrsig_sym` directive for an only-used-by-metadata symbol but it does not emit an entry. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D138362
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 0fc7f5f..4faf1ab 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -1022,22 +1022,6 @@ bool Value::isSwiftError() const {
return Alloca->isSwiftError();
}
-bool Value::isTransitiveUsedByMetadataOnly() const {
- SmallVector<const User *, 32> WorkList(user_begin(), user_end());
- SmallPtrSet<const User *, 32> Visited(user_begin(), user_end());
- while (!WorkList.empty()) {
- const User *U = WorkList.pop_back_val();
- // If it is transitively used by a global value or a non-constant value,
- // it's obviously not only used by metadata.
- if (!isa<Constant>(U) || isa<GlobalValue>(U))
- return false;
- for (const User *UU : U->users())
- if (Visited.insert(UU).second)
- WorkList.push_back(UU);
- }
- return true;
-}
-
//===----------------------------------------------------------------------===//
// ValueHandleBase Class
//===----------------------------------------------------------------------===//