[clang] Properly cache member pointer LLVM types
authorArthur Eubanks <aeubanks@google.com>
Tue, 8 Feb 2022 05:56:28 +0000 (21:56 -0800)
committerArthur Eubanks <aeubanks@google.com>
Tue, 8 Feb 2022 21:22:24 +0000 (13:22 -0800)
commitf05a63f9a09bdacab6a98683c5a4fc3f1f2a9149
tree619aa6050801526cd3c8d825ad83fbe3cf5ae2fb
parentc9e6678b56c4bed177d56136dad71b12198a4ebb
[clang] Properly cache member pointer LLVM types

When not going through the main Clang->LLVM type cache, we'd
accidentally create multiple different opaque types for a member pointer
type.

This allows us to remove the -verify-type-cache flag now that
check-clang passes with it on. We can do the verification in expensive
builds. Previously microsoft-abi-member-pointers.cpp was failing with
-verify-type-cache.

I suspect that there may be more issues when we have multiple member
pointer types and we clear the cache, but we can leave that for later.

Followup to D118744.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D119215
clang/lib/CodeGen/CodeGenTypes.cpp
clang/lib/CodeGen/CodeGenTypes.h
clang/test/CodeGenCXX/type-cache-2.cpp
clang/test/CodeGenCXX/type-cache-3.cpp
clang/test/CodeGenCXX/type-cache.cpp