[Sema] Simplify CheckConstraintSatisfaction. NFC
authorIlya Biryukov <ibiryukov@google.com>
Wed, 4 May 2022 15:31:59 +0000 (15:31 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 4 May 2022 15:53:07 +0000 (15:53 +0000)
commit726d7b07fcde58c61743c45723c9b614911fe084
tree50c465d3d9492a006b60d26bb7017124a781401b
parent9c4770eaab9d95c93b65866e043f571b75d52386
[Sema] Simplify CheckConstraintSatisfaction. NFC

- Exit early when constraint caching is disabled.
- Use unique_ptr to manage temporary lifetime.
- Fix a typo in a comment (InsertPos instead of InsertNode).

The new code duplicates the forwarding call to CheckConstraintSatisfaction,
but reduces the number of interconnected if statements and simplifies lifetime
management.

This increases the overall readability.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D124923
clang/lib/Sema/SemaConcept.cpp