This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Make two local variables const
ClosedPublic

Authored by thakis on Oct 13 2022, 7:39 AM.

Details

Reviewers
int3
oontvoo
Group Reviewers
Restricted Project
Commits
rGad030740b2db: [lld/mac] Make two local variables const
Summary

While reading this code, I was wondering if we change these variables in the
loop. We don't, so make them const to make this easier to see next time.

No behavior change.

Diff Detail

Event Timeline

thakis created this revision.Oct 13 2022, 7:39 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 13 2022, 7:39 AM
thakis requested review of this revision.Oct 13 2022, 7:39 AM
tschuett added inline comments.
lld/MachO/InputFiles.cpp
813

symbolOffset is not const?

813

Sorry. It is not const.

844

These integers are not const?

int3 accepted this revision.Oct 13 2022, 8:04 AM
int3 added a subscriber: int3.

lgtm. seems like something that can be pushed w/o review tho

This revision is now accepted and ready to land.Oct 13 2022, 8:04 AM
oontvoo accepted this revision.Oct 13 2022, 8:05 AM
oontvoo added a subscriber: oontvoo.

LG

lld/MachO/InputFiles.cpp
813

I had the same question - then I saw that findCOntainingSubsection() takes an output param.
any objection to refactoring that too - then this one could be const? (doesn't have to be in this patch)

lgtm. seems like something that can be pushed w/o review tho

Yes, almost did that. Will do next time, sorry!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2022, 9:03 AM