This is an archive of the discontinued LLVM Phabricator instance.

Add caching when looking up coroutine_traits
ClosedPublic

Authored by tks2103 on Jul 5 2018, 10:48 AM.

Details

Summary

Currently clang looks up the coroutine_traits ClassTemplateDecl
everytime it looks up the promise type. This is unnecessary
as coroutine_traits doesn't change between promise type lookups.

This diff caches the coroutine_traits lookup.

Test Plan:
I added log statements in the new lookupCoroutineTraits function
to ensure that LookupQualifiedName was only called once even
when multiple coroutines existed in the source file.

Diff Detail

Event Timeline

tks2103 created this revision.Jul 5 2018, 10:48 AM
modocache resigned from this revision.Jul 5 2018, 11:07 AM

This LGTM but I'll just wait for @GorNishanov to accept the patch, just in case I'm missing something. I'd be happy to commit this for you once Gor accepts! :)

modocache accepted this revision.Jul 14 2018, 11:04 AM

Yup, LGTM! I'll land this now.

This revision is now accepted and ready to land.Jul 14 2018, 11:04 AM
This revision was automatically updated to reflect the committed changes.