[PATCH] D41607: Do not parse the same /export string more than once.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 27 23:42:18 PST 2017
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL321513: Do not parse the same /export string more than once. (authored by ruiu, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41607?vs=128265&id=128269#toc
Repository:
rL LLVM
https://reviews.llvm.org/D41607
Files:
lld/trunk/COFF/Driver.cpp
lld/trunk/COFF/Driver.h
Index: lld/trunk/COFF/Driver.h
===================================================================
--- lld/trunk/COFF/Driver.h
+++ lld/trunk/COFF/Driver.h
@@ -16,6 +16,7 @@
#include "lld/Common/Reproduce.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/COFF.h"
#include "llvm/Option/Arg.h"
@@ -127,6 +128,8 @@
std::list<std::function<void()>> TaskQueue;
std::vector<StringRef> FilePaths;
std::vector<MemoryBufferRef> Resources;
+
+ llvm::StringSet<> DirectivesExports;
};
// Functions below this line are defined in DriverUtils.cpp.
Index: lld/trunk/COFF/Driver.cpp
===================================================================
--- lld/trunk/COFF/Driver.cpp
+++ lld/trunk/COFF/Driver.cpp
@@ -245,6 +245,13 @@
Config->Entry = addUndefined(mangle(Arg->getValue()));
break;
case OPT_export: {
+ // If a common header file contains dllexported function
+ // declarations, many object files may end up with having the
+ // same /EXPORT options. In order to save cost of parsing them,
+ // we dedup them first.
+ if (!DirectivesExports.insert(Arg->getValue()).second)
+ break;
+
Export E = parseExport(Arg->getValue());
if (Config->Machine == I386 && Config->MinGW) {
if (!isDecorated(E.Name))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41607.128269.patch
Type: text/x-patch
Size: 1393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171228/21e140fe/attachment.bin>
More information about the llvm-commits
mailing list