This is an archive of the discontinued LLVM Phabricator instance.

Remove addBlockByrefAddress(), it is dead code as far as clang is concerned.
ClosedPublic

Authored by aprantl on Sep 6 2018, 5:06 PM.

Details

Summary

This patch removes addBlockByrefAddress(), it is dead code as far as clang is concerned: Every byref block capture is emitted with a complex expression that is equivalent to what this function does.

Now if I can move the code from DbgVariable::getType() into Clang, too we can get rid of the entire BlockByrefStruct DIFlag!

Diff Detail

Event Timeline

aprantl created this revision.Sep 6 2018, 5:06 PM
dblaikie added inline comments.
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
981–982

Should this then be an assertion? And possibly a verifier check?

JDevlieghere added inline comments.Sep 7 2018, 3:10 AM
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
981–982

It's already part of the assertion on line 977; if it doesn't have a complex expression, then isBlockByrefVariable has to be false. Verifier check sounds reasonable.

aprantl updated this revision to Diff 164442.Sep 7 2018, 9:17 AM

Added a verifier check. It's the right thing to do, even if it is temporary.

FYI the block_var.m test in debuginfo-tests exercises this area end-to-end.

JDevlieghere accepted this revision as: JDevlieghere.Sep 7 2018, 3:04 PM

Neat, LGTM!

This revision is now accepted and ready to land.Sep 7 2018, 3:04 PM
This revision was automatically updated to reflect the committed changes.