This is an archive of the discontinued LLVM Phabricator instance.

Remove the obsolete BlockByRefStruct flag from LLVM IR
ClosedPublic

Authored by aprantl on Sep 11 2019, 11:33 AM.

Details

Summary

DIFlagBlockByRefStruct is an unused DIFlag that originally was used by clang to express (Objective-)C block captures in debug info. For the last year Clang has been emitting complex DIExpressions to describe block captures instead, which makes all the code supporting this flag redundant.

This patch removes the flag and all supporting "dead" code, so we can reuse the bit for something else in the future.

Since this only affects debug info generated by Clang with the block extension this mostly affects Apple platforms and I don't have any bitcode compatibility concerns for removing this. The Verifier will reject debug info that uses the bit and thus degrade gracefully when LTO'ing older bitcode with a newer compiler.

Diff Detail

Event Timeline

aprantl created this revision.Sep 11 2019, 11:33 AM
vsk added a comment.Sep 11 2019, 1:03 PM

Looks nice! One question: if DIFlagReservedBit4 is ever reused, will it break bitcode upgrades? Or is the idea that it won't ever be reused?

My plan is to reuse the bit for an attribute that does not appear inside of DICompositeType, so we could leave the Verifier check in indefinitely. I should have said so though.

vsk accepted this revision.Sep 11 2019, 1:23 PM

Makes sense, thanks!

llvm/include/llvm/IR/DebugInfoFlags.def
34

Maybe add a comment here explaining that ReservedBit4 can't be used within DICompositeType?

This revision is now accepted and ready to land.Sep 11 2019, 1:23 PM
aprantl updated this revision to Diff 219820.Sep 11 2019, 3:47 PM

Good point!

aprantl updated this revision to Diff 219823.Sep 11 2019, 3:58 PM

Found one more stale decl.

This revision was automatically updated to reflect the committed changes.