]> granicus.if.org Git - clang/commit
Add caching when looking up coroutine_traits
authorBrian Gesiak <modocache@gmail.com>
Sat, 14 Jul 2018 18:21:44 +0000 (18:21 +0000)
committerBrian Gesiak <modocache@gmail.com>
Sat, 14 Jul 2018 18:21:44 +0000 (18:21 +0000)
commit6ffcf589f0d7c4b5e293ccfd3cff77945d3679e8
tree2ad8616ff727723bdd743c35815f498ddf23278d
parentbdb4f6d2d659950de9b4a8b317c8d5e82821461d
Add caching when looking up coroutine_traits

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.

Patch by Tanoy Sinha!

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.

Reviewers: modocache, GorNishanov

Reviewed By: modocache

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D48981

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337103 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/Sema.cpp
lib/Sema/SemaCoroutine.cpp