This is an archive of the discontinued LLVM Phabricator instance.

[NFC] follow up code cleanup after D123837
ClosedPublic

Authored by ChuanqiXu on Apr 20 2022, 11:35 PM.

Details

Summary

I found there are chances to do simplify the codes further after I landed D123837. This one should be NFC only.

Diff Detail

Event Timeline

ChuanqiXu created this revision.Apr 20 2022, 11:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 11:35 PM
ChuanqiXu requested review of this revision.Apr 20 2022, 11:35 PM
ChuanqiXu added inline comments.Apr 20 2022, 11:40 PM
clang/lib/Sema/SemaLookup.cpp
1573–1581

The definition of GlobalModuleFragment is The global module fragment of the current translation unit. So I feel it more natural to use this and I don't need to judge if it is GlobalModuleFragment anymore. The original looks more hack a little bit.

1581

And we don't need to check module private specially. So that we could filter more cases to avoid string comparison.

1784–1792

LLVM prefer shorter indentation. (Although I repeat ModulePrivate here, I feel the current one is better)

1787–1804

After D123837 is landed, the following two checks wouldn't be hit any more.

iains accepted this revision.May 9 2022, 5:00 AM

sorry for being slow, concentrating on module initialisers!

this LGTM (but we can still probably make the visibility code cleaner - perhaps after we get the main functionality installed).

This revision is now accepted and ready to land.May 9 2022, 5:00 AM

sorry for being slow, concentrating on module initialisers!

this LGTM (but we can still probably make the visibility code cleaner - perhaps after we get the main functionality installed).

Yeah, of course we need further cleaner code.

This revision was automatically updated to reflect the committed changes.