This is an archive of the discontinued LLVM Phabricator instance.

[ORC] Fix name shadowing issue, NFC.
ClosedPublic

Authored by bzcheeseman on Mar 9 2023, 11:02 AM.

Details

Summary

Testing the COFFPlatform on MSVC, a name shadowing issue surfaced where LoadDynLibrary inside the constructor was actually using the moved-from function argument. This patch simply renames the argument to avoid that shadowing.

Diff Detail

Event Timeline

bzcheeseman created this revision.Mar 9 2023, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 11:02 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
bzcheeseman requested review of this revision.Mar 9 2023, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 11:02 AM
rriddle accepted this revision.Mar 9 2023, 11:05 AM
This revision is now accepted and ready to land.Mar 9 2023, 11:05 AM
This revision was automatically updated to reflect the committed changes.
lhames added a comment.Mar 9 2023, 7:28 PM

Hi Aman,

This change looks fine, however naming the constructor argument for the member variable is idiomatic in ORC (and common elsewhere in LLVM from memory), and something like this should usually be resolved by explicitly specifying this->. Ideally constructor bodies should be small enough to spot bugs like this easily, but that's not the case here -- we should probably try to break this constructor body out into a separate method (which has the advantage of simplifying error returns too).

  • Lang.