[llvm] r323688 - [CodeGen] Simplify conditional. NFC

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 12:28:04 PST 2018


Author: smeenai
Date: Mon Jan 29 12:28:04 2018
New Revision: 323688

URL: http://llvm.org/viewvc/llvm-project?rev=323688&view=rev
Log:
[CodeGen] Simplify conditional. NFC

Rafael pointed out that `hasInternalLinkage() || hasPrivateLinkage()` is
equivalent to `hasLocalLinkage()` in post-commit review.

I'm intentionally not updating the comment, partly because I like it
being explicit, and partly because "global symbols with local linkage"
sounds like an oxymoron.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=323688&r1=323687&r2=323688&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Jan 29 12:28:04 2018
@@ -1459,7 +1459,7 @@ bool AsmPrinter::doFinalization(Module &
           // Global symbols with internal or private linkage are not visible to
           // the linker, and thus would cause an error when the linker tried to
           // preserve the symbol due to the `/include:` directive.
-          if (GV->hasInternalLinkage() || GV->hasPrivateLinkage())
+          if (GV->hasLocalLinkage())
             continue;
 
           raw_string_ostream OS(Flags);




More information about the llvm-commits mailing list