<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 23, 2015 at 10:53 AM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi, Richard. Thanks for all your improvements to modules this year! I just filedĀ <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23929&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=E7LI3b0x2gFYZ352J1Lqhk6A5KqSyH5Tg3z2Ib9hWDk&s=I3-tQ8DKsQlT9yePGUswoLRHSY744qBBw_X7YXQcg-U&e=" target="_blank">PR23929</a>, which shows how code completion is no longer finding macros that come from modules. Any idea what should be changed here? If you don't have time to fix this I'm happy to be the one who actually codes it up, but at the moment I'm not even quite sure what piece is missing.</div></blockquote><div><br></div><div>Identifiers that have macro names imported from modules get lazily updated, and macro_begin isn't triggering enough updating to produce a complete map. The easiest thing to do would be to walk the ModuleMacros map from within macro_begin, and add entries for each identifier with any module macros to the MacroMap in the CurSubmoduleState. (Alternatively, you could change macro_begin/macro_end to return iterators over the identifier table that filter out non-macro identifiers. Either way is a little wasteful, but avoiding that waste would require implementing a rather fancy iterator, which seems like overkill for this problem.)</div><div><br></div><div>I think this should be a straightforward fix; if you have problems, let me know and I'll tackle it. Sorry for breaking you :-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>(Apart from code completion, this also affects a few other features that want to know all names provided by a particular header file. *cough*Swift*cough*)<br><div><br></div><div>Thanks,</div><div>Jordan</div></div></div></blockquote></div><br></div></div>