summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-12-21 22:26:44 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-12-21 22:26:44 +0000
commitb9a18fd0a2a659b9d03bdbe03bc3cba8db5c5e27 (patch)
treeacfc0aa0aa9d379ad3e488ea30029bbb843a5825
parent7279762fc05c8ada02b10ad83f9221bca84fc4ca (diff)
downloadbcm5719-llvm-b9a18fd0a2a659b9d03bdbe03bc3cba8db5c5e27.tar.gz
bcm5719-llvm-b9a18fd0a2a659b9d03bdbe03bc3cba8db5c5e27.zip
Define isUndefWeak inline.
This small function was showing up in the profile. Defining it inline gives about 0.3% speedup. llvm-svn: 321317
-rw-r--r--lld/ELF/Symbols.cpp6
-rw-r--r--lld/ELF/Symbols.h5
2 files changed, 4 insertions, 7 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index d80aba499ff..13a91aab80b 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -116,12 +116,6 @@ static uint64_t getSymVA(const Symbol &Sym, int64_t &Addend) {
llvm_unreachable("invalid symbol kind");
}
-// Returns true if this is a weak undefined symbol.
-bool Symbol::isUndefWeak() const {
- // See comment on Lazy in Symbols.h for the details.
- return isWeak() && (isUndefined() || isLazy());
-}
-
uint64_t Symbol::getVA(int64_t Addend) const {
uint64_t OutVA = getSymVA(*this, Addend);
return OutVA + Addend;
diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index c9ee2a00c5a..d7a89f81c4f 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -102,7 +102,10 @@ public:
// True is this is an undefined weak symbol. This only works once
// all input files have been added.
- bool isUndefWeak() const;
+ bool isUndefWeak() const {
+ // See comment on Lazy the details.
+ return isWeak() && (isUndefined() || isLazy());
+ }
StringRef getName() const { return Name; }
uint8_t getVisibility() const { return StOther & 0x3; }
OpenPOWER on IntegriCloud