[llvm-branch-commits] [llvm] e4c360a - [MC][ELF] Drop MCSymbol::isExternal call sites

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Dec 20 21:22:58 PST 2020


Author: Fangrui Song
Date: 2020-12-20T21:18:22-08:00
New Revision: e4c360a897fe062914519d331e8f1e28b2b1fbfd

URL: https://github.com/llvm/llvm-project/commit/e4c360a897fe062914519d331e8f1e28b2b1fbfd
DIFF: https://github.com/llvm/llvm-project/commit/e4c360a897fe062914519d331e8f1e28b2b1fbfd.diff

LOG: [MC][ELF] Drop MCSymbol::isExternal call sites

ELF uses symbol bindings and MCSymbol::isExternal is not really useful.
The function is no longer used in ELF code now.

Added: 
    

Modified: 
    llvm/lib/MC/ELFObjectWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index d5da8deab0f0..69307b617552 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -464,7 +464,7 @@ void ELFWriter::writeHeader(const MCAssembler &Asm) {
 
 uint64_t ELFWriter::SymbolValue(const MCSymbol &Sym,
                                 const MCAsmLayout &Layout) {
-  if (Sym.isCommon() && (Sym.isTargetCommon() || Sym.isExternal()))
+  if (Sym.isCommon())
     return Sym.getCommonAlignment();
 
   uint64_t Res;
@@ -1278,7 +1278,6 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
 
     // Aliases defined with .symvar copy the binding from the symbol they alias.
     // This is the first place we are able to copy this information.
-    Alias->setExternal(Symbol.isExternal());
     Alias->setBinding(Symbol.getBinding());
     Alias->setVisibility(Symbol.getVisibility());
     Alias->setOther(Symbol.getOther());


        


More information about the llvm-branch-commits mailing list