This is an archive of the discontinued LLVM Phabricator instance.

[Modules][ObjC] Add protocol redefinition to the current scope/context
ClosedPublic

Authored by bruno on May 23 2018, 3:44 PM.

Details

Summary

Not doing so causes the AST writter to assert since the decl in question never gets emitted. This is fine when modules is not used, but otherwise we need to serialize something other than garbage.

rdar://problem/39844933

Diff Detail

Repository
rC Clang

Event Timeline

bruno created this revision.May 23 2018, 3:44 PM
arphaman added inline comments.Jun 29 2018, 10:38 AM
lib/Sema/SemaDeclObjC.cpp
1216

Is this a problem only for modules or does this show up in PCHs too? What would be the cost of using PushOnScopeChains unconditionally?

bruno added inline comments.Jun 29 2018, 11:37 AM
lib/Sema/SemaDeclObjC.cpp
1216

Is this a problem only for modules or does this show up in PCHs too?

It only shows up in PCHs if Modules are being used, otherwise works as expected, because we don't have to serialize a different module which contains the dup, we just ignore it.

What would be the cost of using PushOnScopeChains unconditionally?

I'm afraid that without the modules visibility rules, adding it unconditionally will make it available for name lookup, which we don't want here.

arphaman accepted this revision.Jun 29 2018, 11:51 AM

Thanks for explaining! LGTM

This revision is now accepted and ready to land.Jun 29 2018, 11:51 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.