[lld] r318825 - Add more blank lines to separate code chunks.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 22 01:06:27 PST 2017
Author: ruiu
Date: Wed Nov 22 01:06:27 2017
New Revision: 318825
URL: http://llvm.org/viewvc/llvm-project?rev=318825&view=rev
Log:
Add more blank lines to separate code chunks.
Modified:
lld/trunk/COFF/MinGW.cpp
Modified: lld/trunk/COFF/MinGW.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/MinGW.cpp?rev=318825&r1=318824&r2=318825&view=diff
==============================================================================
--- lld/trunk/COFF/MinGW.cpp (original)
+++ lld/trunk/COFF/MinGW.cpp Wed Nov 22 01:06:27 2017
@@ -19,7 +19,7 @@ using namespace llvm;
using namespace llvm::COFF;
AutoExporter::AutoExporter() {
- if (Config->Machine == I386)
+ if (Config->Machine == I386) {
ExcludeSymbols = {
"__NULL_IMPORT_DESCRIPTOR",
"__pei386_runtime_relocator",
@@ -35,7 +35,7 @@ AutoExporter::AutoExporter() {
"_DllEntryPoint at 12",
"_DllMainCRTStartup at 12",
};
- else
+ } else {
ExcludeSymbols = {
"_NULL_IMPORT_DESCRIPTOR",
"_pei386_runtime_relocator",
@@ -51,6 +51,7 @@ AutoExporter::AutoExporter() {
"DllEntryPoint",
"DllMainCRTStartup",
};
+ }
ExcludeLibs = {
"libgcc",
@@ -91,21 +92,27 @@ AutoExporter::AutoExporter() {
bool AutoExporter::shouldExport(Defined *Sym) const {
if (!Sym || !Sym->isLive() || !Sym->getChunk())
return false;
+
// Only allow the symbol kinds that make sense to export; in particular,
// disallow import symbols.
if (!isa<DefinedRegular>(Sym) && !isa<DefinedCommon>(Sym))
return false;
if (ExcludeSymbols.count(Sym->getName()))
return false;
+
// Check that file is non-null before dereferencing it, symbols not
// originating in regular object files probably shouldn't be exported.
if (!Sym->getFile())
return false;
+
StringRef LibName = sys::path::filename(Sym->getFile()->ParentName);
+
// Drop the file extension.
LibName = LibName.substr(0, LibName.rfind('.'));
+
if (ExcludeLibs.count(LibName))
return false;
+
StringRef FileName = sys::path::filename(Sym->getFile()->getName());
if (LibName.empty() && ExcludeObjects.count(FileName))
return false;
More information about the llvm-commits
mailing list