This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Split special builtin type lookups into a separate function
ClosedPublic

Authored by tambre on Sep 20 2020, 1:16 AM.

Details

Summary

In case further such cases appear in the future we've got a generic function to add them to.
Additionally changed the ObjC special case to check the language and the identifier builtin ID instead of the name.

Addresses the cleanup suggestion from D87917.

Diff Detail

Event Timeline

tambre created this revision.Sep 20 2020, 1:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2020, 1:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tambre requested review of this revision.Sep 20 2020, 1:16 AM
rjmccall accepted this revision.Sep 20 2020, 2:50 PM

Thanks. Minor improvement and then LGTM.

clang/lib/Sema/SemaLookup.cpp
924

I'm pretty sure this builtin only exists in ObjC mode, so there's no need to separately check the language mode. (Even if you did want to check it, it would be better to check the builtin mode first, as that's a very trivial check.)

This revision is now accepted and ready to land.Sep 20 2020, 2:50 PM
This revision was automatically updated to reflect the committed changes.
tambre marked an inline comment as done.
tambre added inline comments.Sep 21 2020, 9:13 AM
clang/lib/Sema/SemaLookup.cpp
924

Fixed, thanks for the review!