[lld] r244377 - COFF: Simplify.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 17:23:38 PDT 2015


Author: ruiu
Date: Fri Aug  7 19:23:37 2015
New Revision: 244377

URL: http://llvm.org/viewvc/llvm-project?rev=244377&view=rev
Log:
COFF: Simplify.

SymbolTable::find(mangle(X)) is equivalent to SymbolTable::findUnderscore(X)
except that the latter is slightly efficient as that doesn't allocate a new
string.

Modified:
    lld/trunk/COFF/Driver.cpp

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=244377&r1=244376&r2=244377&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Fri Aug  7 19:23:37 2015
@@ -226,9 +226,9 @@ StringRef LinkerDriver::findDefaultEntry
 WindowsSubsystem LinkerDriver::inferSubsystem() {
   if (Config->DLL)
     return IMAGE_SUBSYSTEM_WINDOWS_GUI;
-  if (Symtab.find(mangle("main")) || Symtab.find(mangle("wmain")))
+  if (Symtab.findUnderscore("main") || Symtab.findUnderscore("wmain"))
     return IMAGE_SUBSYSTEM_WINDOWS_CUI;
-  if (Symtab.find(mangle("WinMain")) || Symtab.find(mangle("wWinMain")))
+  if (Symtab.findUnderscore("WinMain") || Symtab.findUnderscore("wWinMain"))
     return IMAGE_SUBSYSTEM_WINDOWS_GUI;
   return IMAGE_SUBSYSTEM_UNKNOWN;
 }




More information about the llvm-commits mailing list