This is an archive of the discontinued LLVM Phabricator instance.

[PDB] Don't emit debug info associated with dead chunks
ClosedPublic

Authored by rnk on Jun 19 2017, 10:38 AM.

Details

Summary

Previously we didn't add debug info chunks to the SparseChunks array, so
they didn't participate in section GC. Now we do.

Event Timeline

rnk created this revision.Jun 19 2017, 10:38 AM
rnk updated this revision to Diff 103074.Jun 19 2017, 10:41 AM
  • Reduce yaml files a little
ruiu added inline comments.Jun 19 2017, 11:44 AM
lld/COFF/Chunks.h
182

Since this function is not called very often, I'd remove the member variable and check the condition every time the function is called.

rnk added inline comments.Jun 19 2017, 12:29 PM
lld/COFF/Chunks.h
182

Isn't this function called by the Writer for every chunk written to the output file?

ruiu added inline comments.Jun 19 2017, 12:33 PM
lld/COFF/Chunks.h
182

Even if it is, I think it is still negligible.

rnk updated this revision to Diff 103099.Jun 19 2017, 1:31 PM
  • check section names in isCodeView predicate
ruiu added inline comments.Jun 19 2017, 1:34 PM
lld/COFF/Chunks.h
183–184

I'm sorry to be too picky, but isn't SectionName == ".debug" || SectionName.startswith(".debug$") enough? In LLD I'm really trying hard to make our code simple, boring and straightforward unless there's a strong reason to make it clever.

rnk added inline comments.Jun 19 2017, 1:52 PM
lld/COFF/Chunks.h
183–184

Sure, we can do that. I felt like if this was going to be on the main path, then we should at least try to be clever...

rnk updated this revision to Diff 103102.Jun 19 2017, 1:52 PM
  • don't be clever
ruiu accepted this revision.Jun 19 2017, 1:54 PM

LGTM

This revision is now accepted and ready to land.Jun 19 2017, 1:54 PM
This revision was automatically updated to reflect the committed changes.