This is an archive of the discontinued LLVM Phabricator instance.

[NFC][CodeGen] Remove rarely used DL variable from SelectionDAGBuilder
ClosedPublic

Authored by david-arm on Nov 23 2021, 9:21 AM.

Details

Summary

There is a pointer to the DataLayout in SelectionDAGBuilder called
'DL' that is hardly ever used. In most cases the code seems to just
use DAG.getDataLayout() instead. Given that DL is also often used
as a shadowed variable for the debug location it seems sensible to
just kill off the few remaining uses and be consistent with the rest
of the code.

Diff Detail

Event Timeline

david-arm created this revision.Nov 23 2021, 9:21 AM
david-arm requested review of this revision.Nov 23 2021, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2021, 9:21 AM

Have you encountered many -wShadow issues? I ask because I always thought it odd that most shadow variable warnings are disabled on MSVC builds, and enabling them creates a LOT of warnings.

-wd4456 # Suppress 'declaration of 'var' hides local variable'
-wd4457 # Suppress 'declaration of 'var' hides function parameter'
-wd4458 # Suppress 'declaration of 'var' hides class member'
-wd4459 # Suppress 'declaration of 'var' hides global declaration'
peterwaller-arm accepted this revision.Dec 8 2021, 7:32 AM
This revision is now accepted and ready to land.Dec 8 2021, 7:32 AM