This is an archive of the discontinued LLVM Phabricator instance.

PDBFPO: Use references instead of pointers, where possible
ClosedPublic

Authored by labath on Apr 4 2019, 8:38 AM.

Details

Summary

The code was passing pointers around, expecting they would be not null.
In c++ it is possible to convey this notion explicitly by using a
reference instead.

Not all uses of pointers could be converted to references (e.g. one
can't store references in a container), but this will at least make it
locally obvious that code is dealing with nonnull pointers.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Apr 4 2019, 8:38 AM
amccarth accepted this revision.Apr 4 2019, 9:41 AM

LGTM.

I noticed this also deleted two overloads of Visit from FPOProgramASTVisitorDWARFCodegen, but that appears to be harmless (the base class overloads were also no-ops).

This revision is now accepted and ready to land.Apr 4 2019, 9:41 AM

I noticed this also deleted two overloads of Visit from FPOProgramASTVisitorDWARFCodegen, but that appears to be harmless (the base class overloads were also no-ops).

Yep, that was a drive-by cleanup :P.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2019, 12:29 AM