This is an archive of the discontinued LLVM Phabricator instance.

DebugInfo: Added support for Checksum debug info feature (Clang part)
ClosedPublic

Authored by aaboud on Dec 9 2016, 4:47 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

aaboud updated this revision to Diff 80973.Dec 9 2016, 4:47 PM
aaboud retitled this revision from to DebugInfo: Added support for Checksum debug info feature (Clang part).
aaboud updated this object.
aaboud added reviewers: rnk, probinson, rsmith.
aaboud added a subscriber: cfe-commits.
rnk added inline comments.Dec 12 2016, 9:21 AM
lib/Basic/SourceManager.cpp
1447 ↗(On Diff #80973)

Let's move this whole thing to CGDebugInfo::getOrCreateFile. SourceManager isn't caching or managing MD5 checksums at all in this CL.

1450–1451 ↗(On Diff #80973)

If this can fail, we should not pretend to have an MD5 checksum in the debug info.

1461 ↗(On Diff #80973)

This can use SmallString and stringifyResult() to avoid heap allocations.

lib/CodeGen/CGDebugInfo.cpp
350 ↗(On Diff #80973)

We should only do this if CGM.getCodeGenOpts().EmitCodeView, or we will regress compile time on other platforms without any added functionality.

probinson added inline comments.Dec 13 2016, 3:09 PM
lib/CodeGen/CGDebugInfo.cpp
350 ↗(On Diff #80973)

Eventually we'll want it for DWARF 5 also, but for now conditioning on CodeView is fine.

aaboud updated this revision to Diff 81640.Dec 15 2016, 1:00 PM
aaboud added a subscriber: bwyma.

Moved getChecksum from SourceManager to CGDebugInfo.
Also, now checksum is emitted only for CodeView.

rnk added inline comments.Dec 15 2016, 3:36 PM
test/CodeGen/debug-info-file-checksum.c
1 ↗(On Diff #81640)

Instead of %s.source, you can do %S/Inputs/debug-info-file-checksum.c.

test/CodeGen/debug-info-file-checksum.c.source
1 ↗(On Diff #81640)

This can live in test/CodeGen/Inputs/debug-info-file-checksum.c

majnemer added inline comments.
lib/CodeGen/CGDebugInfo.cpp
433–434 ↗(On Diff #81640)

Formatting looks wrong

aaboud updated this revision to Diff 81953.Dec 19 2016, 8:29 AM
aaboud marked 3 inline comments as done.

Addressed comments by Reid and David.

rnk accepted this revision.Dec 21 2016, 10:20 AM
rnk edited edge metadata.

This side looks good.

lib/CodeGen/CGDebugInfo.cpp
325 ↗(On Diff #81953)

This is uncached. Maybe call it computeChecksum to indicate that it is expensive?

This revision is now accepted and ready to land.Dec 21 2016, 10:20 AM
This revision was automatically updated to reflect the committed changes.
aaboud marked an inline comment as done.