瀏覽代碼

Define isUndefWeak inline.

This small function was showing up in the profile. Defining it inline
gives about 0.3% speedup.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@321317 91177308-0d34-0410-b5e6-96231b3b80d8
Rafael Espindola 7 年之前
父節點
當前提交
5c19e66d4a
共有 2 個文件被更改,包括 4 次插入7 次删除
  1. 0 6
      ELF/Symbols.cpp
  2. 4 1
      ELF/Symbols.h

+ 0 - 6
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;

+ 4 - 1
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; }