[lld] [LLD][COFF] Introduce Symbol::getDefined helper. (NFC) (PR #151253)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 30 09:26:16 PDT 2025
================
@@ -91,6 +91,14 @@ bool Symbol::isLive() const {
return true;
}
+Defined *Symbol::getDefined() {
+ if (auto d = dyn_cast<Defined>(this))
+ return d;
+ if (auto u = dyn_cast<Undefined>(this))
----------------
cjacek wrote:
Yes, I believe the assumption that only one of them can succeed is safe. I wrote it in this order because I’d expect `Defined` to be more common, but as you said, the performance impact is not really relevant.
https://github.com/llvm/llvm-project/pull/151253
More information about the llvm-commits
mailing list