[all-commits] [llvm/llvm-project] ac2226: [PDB] Improve error handling when writes fail

Reid Kleckner via All-commits all-commits at lists.llvm.org
Tue May 18 13:20:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac2226b0f573226620e8aecdcc079f74612dfe48
      https://github.com/llvm/llvm-project/commit/ac2226b0f573226620e8aecdcc079f74612dfe48
  Author: Reid Kleckner <rnk at google.com>
  Date:   2021-05-18 (Tue, 18 May 2021)

  Changed paths:
    M lld/COFF/PDB.cpp
    M llvm/include/llvm/DebugInfo/MSF/MSFError.h
    M llvm/lib/DebugInfo/MSF/MSFBuilder.cpp
    M llvm/lib/DebugInfo/MSF/MSFError.cpp

  Log Message:
  -----------
  [PDB] Improve error handling when writes fail

Handle PDB writing errors like any other error in LLD: emit an error and
continue. This allows the linker to print timing data and summary data
after linking, which can be helpful for finding PDB size problems. Also
report how large the file would have been.

Example output:

lld-link: error: Output data is larger than 4 GiB. File size would have been 6,937,108,480
lld-link: error: failed to write PDB file ./chrome.dll.pdb
                                    Summary
--------------------------------------------------------------------------------
          33282 Input OBJ files (expanded from all cmd-line inputs)
              4 PDB type server dependencies
              0 Precomp OBJ dependencies
       33396931 Input type records
... snip ...
  Input File Reading:           59756 ms ( 45.5%)
  GC:                            7500 ms (  5.7%)
  ICF:                           3336 ms (  2.5%)
  Code Layout:                   6329 ms (  4.8%)
  PDB Emission (Cumulative):    46192 ms ( 35.2%)
    Add Objects:                27609 ms ( 21.0%)
      Type Merging:             16740 ms ( 12.8%)
      Symbol Merging:           10761 ms (  8.2%)
    Publics Stream Layout:       9383 ms (  7.1%)
    TPI Stream Layout:           1678 ms (  1.3%)
    Commit to Disk:              3461 ms (  2.6%)
--------------------------------------------------
Total Link Time:               131244 ms (100.0%)

Differential Revision: https://reviews.llvm.org/D102713




More information about the All-commits mailing list