[lld] r289330 - Create a TPI stream only when /debugpdb is given.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 10 09:23:24 PST 2016
Author: ruiu
Date: Sat Dec 10 11:23:23 2016
New Revision: 289330
URL: http://llvm.org/viewvc/llvm-project?rev=289330&view=rev
Log:
Create a TPI stream only when /debugpdb is given.
Adding type records to TPI stream is too time consuming.
It is reported that linking chrome_child.dll took 5 minutes.
Modified:
lld/trunk/COFF/Config.h
lld/trunk/COFF/Driver.cpp
lld/trunk/COFF/Options.td
lld/trunk/COFF/PDB.cpp
lld/trunk/test/COFF/pdb.test
Modified: lld/trunk/COFF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Config.h?rev=289330&r1=289329&r2=289330&view=diff
==============================================================================
--- lld/trunk/COFF/Config.h (original)
+++ lld/trunk/COFF/Config.h Sat Dec 10 11:23:23 2016
@@ -153,6 +153,7 @@ struct Configuration {
bool HighEntropyVA = false;
// This is for debugging.
+ bool DebugPdb = false;
bool DumpPdb = false;
};
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=289330&r1=289329&r2=289330&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Sat Dec 10 11:23:23 2016
@@ -540,6 +540,7 @@ void LinkerDriver::link(ArrayRef<const c
if (Args.hasArg(OPT_nosymtab))
Config->WriteSymtab = false;
Config->DumpPdb = Args.hasArg(OPT_dumppdb);
+ Config->DebugPdb = Args.hasArg(OPT_debugpdb);
// Create a list of input files. Files can be given as arguments
// for /defaultlib option.
Modified: lld/trunk/COFF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Options.td?rev=289330&r1=289329&r2=289330&view=diff
==============================================================================
--- lld/trunk/COFF/Options.td (original)
+++ lld/trunk/COFF/Options.td Sat Dec 10 11:23:23 2016
@@ -94,6 +94,7 @@ def help_q : Flag<["/?", "-?"], "">, Ali
def nosymtab : F<"nosymtab">;
// Flags for debugging
+def debugpdb : F<"debugpdb">;
def dumppdb : Joined<["/", "-"], "dumppdb">;
def lldmap : F<"lldmap">;
def lldmap_file : Joined<["/", "-"], "lldmap:">;
Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=289330&r1=289329&r2=289330&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Sat Dec 10 11:23:23 2016
@@ -162,7 +162,8 @@ void coff::createPDB(StringRef Path, Sym
// Add an empty TPI stream.
auto &TpiBuilder = Builder.getTpiBuilder();
TpiBuilder.setVersionHeader(pdb::PdbTpiV80);
- addTypeInfo(Symtab, TpiBuilder);
+ if (Config->DebugPdb)
+ addTypeInfo(Symtab, TpiBuilder);
// Add an empty IPI stream.
auto &IpiBuilder = Builder.getIpiBuilder();
Modified: lld/trunk/test/COFF/pdb.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb.test?rev=289330&r1=289329&r2=289330&view=diff
==============================================================================
--- lld/trunk/test/COFF/pdb.test (original)
+++ lld/trunk/test/COFF/pdb.test Sat Dec 10 11:23:23 2016
@@ -1,5 +1,6 @@
# RUN: yaml2obj %s > %t.obj
-# RUN: lld-link /debug /pdb:%t.pdb /dll /out:%t.dll /entry:main /nodefaultlib %t.obj
+# RUN: lld-link /debug /pdb:%t.pdb /dll /out:%t.dll /entry:main /nodefaultlib \
+# RUN: /debugpdb %t.obj
# RUN: llvm-pdbdump pdb2yaml -stream-metadata -stream-directory -pdb-stream \
# RUN: -dbi-stream -ipi-stream -tpi-stream %t.pdb | FileCheck %s
More information about the llvm-commits
mailing list